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