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