Changes in scripts/patch/binutils-patch.sh [d8a9d8b:3820147]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/patch/binutils-patch.sh
rd8a9d8b r3820147 19 19 # Download Binutils Source 20 20 # 21 install -d ~/tmp 22 cd ~/tmp 21 cd /usr/src 23 22 if ! [ -e binutils-${SOURCEVERSION}.tar.bz2 ]; then 24 23 wget ftp://ftp.gnu.org/gnu/binutils/binutils-${SOURCEVERSION}.tar.bz2 … … 27 26 # Set Patch Number 28 27 # 29 cd ~/tmp28 cd /usr/src 30 29 wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing 31 30 PATCH_NUM=$(cat index.html | grep binutils | grep "${SOURCEVERSION}" | grep branch_update | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1) 32 31 PATCH_NUM=$(expr ${PATCH_NUM} + 1) 33 PATCH_NUM2=$(cat index.html | grep binutils | grep "${SOURCEVERSION}" | grep fixes | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)34 PATCH_NUM2=$(expr ${PATCH_NUM2} + 1)35 32 rm -f index.html 36 33 37 34 # Cleanup Directory 38 35 # 39 cd ~/tmp40 36 rm -rf binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig 41 37 tar xvf binutils-${SOURCEVERSION}.tar.bz2 38 mv binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig 39 CURRENTDIR=$(pwd -P) 42 40 43 41 # Get Current Updates from CVS 44 42 # 45 cd ~/tmp 46 mv binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig 47 CURRENTDIR=$(pwd -P) 43 cd /usr/src 48 44 FIXEDVERSION=$(echo ${VERSION} | sed -e 's/\./_/g') 49 45 cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src export -rbinutils-${FIXEDVERSION}-branch binutils … … 52 48 # Cleanup 53 49 # 54 cd ~/tmp55 50 DIRS="binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig" 56 51 for DIRECTORY in ${DIRS}; do 57 cd ~/tmp/${DIRECTORY}52 cd /usr/src/${DIRECTORY} 58 53 FILE_LIST=".cvsignore *.gmo" 59 54 for files in ${FILE_LIST}; do … … 71 66 cd .. 72 67 done 73 cd ~/tmp/binutils-${SOURCEVERSION}74 rm -f ~/tmp/binutils-${SOURCEVERSION}.orig/md5.sum68 cd /usr/src/binutils-${SOURCEVERSION} 69 rm -f /usr/src/binutils-${SOURCEVERSION}.orig/md5.sum 75 70 76 71 # Make Binutils a Release 77 72 # 78 cd ~/tmp/binutils-${SOURCEVERSION}73 cd /usr/src/binutils-${SOURCEVERSION} 79 74 sed -i 's/# RELEASE=y/RELEASE=y/g' bfd/Makefile.am 80 75 sed -i 's/# RELEASE=y/RELEASE=y/g' bfd/Makefile.in … … 82 77 # Customize the version string, so we know it's patched 83 78 # 84 cd ~/tmp/binutils-${SOURCEVERSION}79 cd /usr/src/binutils-${SOURCEVERSION} 85 80 DATE_STAMP=$(date +%Y%m%d) 86 cd ~/tmp/binutils-${SOURCEVERSION}81 cd /usr/src/binutils-${SOURCEVERSION} 87 82 sed -i "s:@PKGVERSION@:(GNU Binutils for Cross-LFS) :" bfd/Makefile.in 88 83 sed -i "s:^[[:space:]]VERSION=\(.*\)$: VERSION=\1.${DATE_STAMP}:g" bfd/configure … … 90 85 # Create Patch 91 86 # 92 cd ~/tmp 93 install -d ~/patches 94 echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 95 echo "Date: `date +%m-%d-%Y`" >> ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 96 echo "Initial Package Version: ${SOURCEVERSION}" >> ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 97 echo "Origin: Upstream" >> ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 98 echo "Upstream Status: Applied" >> ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 99 echo "Description: This is a branch update for binutils-${SOURCEVERSION}, and should be" >> ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 100 echo " rechecked periodically." >> ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 101 echo "" >> ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 102 echo "This patch was created on ${DATE_STAMP}" >> ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 103 echo "" >> ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 104 diff -Naur binutils-${SOURCEVERSION}.orig binutils-${SOURCEVERSION} >> ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 105 echo "Created ~/patches/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch." 87 cd /usr/src 88 echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 89 echo "Date: `date +%m-%d-%Y`" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 90 echo "Initial Package Version: ${SOURCEVERSION}" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 91 echo "Origin: Upstream" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 92 echo "Upstream Status: Applied" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 93 echo "Description: This is a branch update for binutils-${SOURCEVERSION}, and should be" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 94 echo " rechecked periodically." >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 95 echo "" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 96 echo "This patch was created on ${DATE_STAMP}" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 97 echo "" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 98 diff -Naur binutils-${SOURCEVERSION}.orig binutils-${SOURCEVERSION} >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 99 echo "Created /usr/src/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch." 106 100 107 101 # Cleanliness is the name of my game! 108 102 # 109 103 unset DATE_STAMP 110 111 # Create Another Copy to create fixes patch112 #113 cd ~/tmp114 if [ -e ${PATCH_DIR}/${VERSION} ]; then115 rm -rf binutils-${SOURCEVERSION}.orig116 cp -ar binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig117 118 # Apply Patches from directories119 #120 cd ~/tmp/binutils-${SOURCEVERSION}121 PATCH_FILES=$(ls ${PATCH_DIR}/${VERSION}/*.patch)122 if [ "${PATCH_FILES}" != "" ]; then123 for pfile in ${PATCH_FILES}; do124 echo "Applying - ${pfile}..."125 for pvalue in $(seq 0 5); do126 patch --dry-run -Np${pvalue} -i ${pfile} > /dev/null 2>&1127 if [ "${?}" = "0" ]; then128 PVALUE=${pvalue}129 break130 fi131 done132 if [ "${PVALUE}" != "" ]; then133 patch -Np${PVALUE} -i ${pfile}134 else135 echo "Patch: ${pfile} Failed to Apply..."136 exit 255137 fi138 done139 fi140 141 # Cleanup Directory142 #143 cd ~/tmp/binutils-${SOURCEVERSION}144 rm -f $(find * -name "*~")145 rm -f $(find * -name "*.orig")146 rm -f $(find * -name "*.rej")147 rm -f *.orig *~ *.rej148 149 # Create Patch150 #151 cd ~/tmp152 install -d ~/patches153 echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch154 echo "Date: `date +%m-%d-%Y`" >> ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch155 echo "Initial Package Version: ${VERSION}" >> ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch156 echo "Origin: Upstream" >> ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch157 echo "Upstream Status: Applied" >> ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch158 echo "Description: This Patch contains fixes for binutils-${SOURCEVERSION}, and should be" >> ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch159 echo " rechecked periodically." >> ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch160 echo "" >> ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch161 diff -Naur binutils-${SOURCEVERSION}.orig binutils-${SOURCEVERSION} >> ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch162 echo "Created ~/patches/binutils-${SOURCEVERSION}-fixes-${PATCH_NUM2}.patch."163 fi164 165 # Cleanup Directory166 #167 cd ~/tmp168 rm -rf binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig
Note:
See TracChangeset
for help on using the changeset viewer.