1 | #!/bin/bash
|
---|
2 | # Create a Binutils Patch
|
---|
3 |
|
---|
4 | # Get Version #
|
---|
5 | #
|
---|
6 | VERSION=$1
|
---|
7 |
|
---|
8 | # Check Input
|
---|
9 | #
|
---|
10 | if [ "${VERSION}" = "" ]; then
|
---|
11 | echo "$0 - Binutils_Version"
|
---|
12 | echo "This will Create a Patch for Binutls Binutils_Version"
|
---|
13 | fi
|
---|
14 |
|
---|
15 | # Download Binutils Source
|
---|
16 | #
|
---|
17 | cd /usr/src
|
---|
18 | if ! [ -e binutils-${VERSION}.tar.bz2 ]; then
|
---|
19 | wget ftp://ftp.gnu.org/gnu/binutils/binutils-${VERSION}.tar.bz2
|
---|
20 | fi
|
---|
21 |
|
---|
22 | # Cleanup Directory
|
---|
23 | #
|
---|
24 | rm -rf binutils-${VERSION} binutils-${VERSION}.orig
|
---|
25 | tar xvf binutils-${VERSION}.tar.bz2
|
---|
26 | mv binutils-${VERSION} binutils-${VERSION}.orig
|
---|
27 | CURRENTDIR=$(pwd -P)
|
---|
28 |
|
---|
29 | # Get Current Updates from CVS
|
---|
30 | #
|
---|
31 | cd /usr/src
|
---|
32 | FIXEDVERSION=$(echo ${VERSION} | sed -e 's/\./_/g')
|
---|
33 | cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src export -rbinutils-${FIXEDVERSION}-branch binutils
|
---|
34 | mv src binutils-${VERSION}
|
---|
35 |
|
---|
36 | # Cleanup
|
---|
37 | #
|
---|
38 | DIRS="binutils-${VERSION} binutils-${VERSION}.orig"
|
---|
39 | for DIRECTORY in ${DIRS}; do
|
---|
40 | cd /usr/src/${DIRECTORY}
|
---|
41 | FILE_LIST=".cvsignore *.gmo"
|
---|
42 | for files in ${FILE_LIST}; do
|
---|
43 | REMOVE=$(find * -name ${files})
|
---|
44 | for file in $REMOVE; do
|
---|
45 | rm -f ${file}
|
---|
46 | done
|
---|
47 | done
|
---|
48 |
|
---|
49 | REMOVE=".cvsignore MAINTAINERS COPYING.LIBGLOSS COPYING.NEWLIB README-maintainer-mode depcomp
|
---|
50 | ChangeLog compile ltgcc.m4 lt~obsolete.m4 etc/ChangeLog etc/add-log.el etc/add-log.vi"
|
---|
51 | for file in $REMOVE; do
|
---|
52 | rm -f ${file}
|
---|
53 | done
|
---|
54 | cd ..
|
---|
55 | done
|
---|
56 |
|
---|
57 | rm -f /usr/src/binutils-${VERSION}.orig/md5.sum
|
---|
58 |
|
---|
59 | # Make Binutils a Release
|
---|
60 | #
|
---|
61 | cd /usr/src/binutils-${VERSION}
|
---|
62 | sed -i 's/# RELEASE=y/RELEASE=y/g' bfd/Makefile.am
|
---|
63 | sed -i 's/# RELEASE=y/RELEASE=y/g' bfd/Makefile.in
|
---|
64 |
|
---|
65 | # Create Patch
|
---|
66 | #
|
---|
67 | cd /usr/src
|
---|
68 | echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > binutils-${VERSION}-branch_update-x.patch
|
---|
69 | echo "Date: `date +%m-%d-%Y`" >> binutils-${VERSION}-branch_update-x.patch
|
---|
70 | echo "Initial Package Version: ${VERSION}" >> binutils-${VERSION}-branch_update-x.patch
|
---|
71 | echo "Origin: Upstream" >> binutils-${VERSION}-branch_update-x.patch
|
---|
72 | echo "Upstream Status: Applied" >> binutils-${VERSION}-branch_update-x.patch
|
---|
73 | echo "Description: This is a branch update for binutils-${VERSION}, and should be" >> binutils-${VERSION}-branch_update-x.patch
|
---|
74 | echo " rechecked periodically." >> binutils-${VERSION}-branch_update-x.patch
|
---|
75 | echo "" >> binutils-${VERSION}-branch_update-x.patch
|
---|
76 | diff -Naur binutils-${VERSION}.orig binutils-${VERSION} >> binutils-${VERSION}-branch_update-x.patch
|
---|
77 | echo "Created /usr/src/binutils-${VERSION}-branch_update-x.patch."
|
---|
78 |
|
---|