- Timestamp:
- Jun 15, 2009, 3:03:52 PM (15 years ago)
- Branches:
- clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- 9c80698
- Parents:
- 3152429
- Location:
- scripts/patch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/patch/binutils-patch.sh
r3152429 r3820147 81 81 cd /usr/src/binutils-${SOURCEVERSION} 82 82 sed -i "s:@PKGVERSION@:(GNU Binutils for Cross-LFS) :" bfd/Makefile.in 83 sed -i "s:^[[:space:]]VERSION=\(.*\)$:VERSION=\1.${DATE_STAMP}:g" bfd/configure 84 85 # Cleanliness is the name of my game! 86 # 87 unset DATE_STAMP 83 sed -i "s:^[[:space:]]VERSION=\(.*\)$: VERSION=\1.${DATE_STAMP}:g" bfd/configure 88 84 89 85 # Create Patch … … 98 94 echo " rechecked periodically." >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 99 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 100 98 diff -Naur binutils-${SOURCEVERSION}.orig binutils-${SOURCEVERSION} >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch 101 99 echo "Created /usr/src/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch." 100 101 # Cleanliness is the name of my game! 102 # 103 unset DATE_STAMP -
scripts/patch/gcc-patch.sh
r3152429 r3820147 14 14 fi 15 15 16 # Set Patch Directory 17 # 18 PATCH_DIR=$(pwd -P)/gcc 19 16 20 # Download GCC Source 17 21 # … … 24 28 # 25 29 cd /usr/src 26 wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing 30 wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing > /dev/null 2>&1 27 31 PATCH_NUM=$(cat index.html | grep gcc | grep "${VERSION}" | grep branch_update | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1) 28 32 PATCH_NUM=$(expr ${PATCH_NUM} + 1) 33 PATCH_NUM2=$(cat index.html | grep gcc | grep "${VERSION}" | grep fixes | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1) 34 PATCH_NUM2=$(expr ${PATCH_NUM2} + 1) 29 35 rm -f index.html 30 36 31 37 # Cleanup Directory 32 38 # 33 #rm -rf gcc-${VERSION} gcc-${VERSION}.orig34 #tar xvf gcc-${VERSION}.tar.bz235 #mv gcc-${VERSION} gcc-${VERSION}.orig39 rm -rf gcc-${VERSION} gcc-${VERSION}.orig 40 tar xvf gcc-${VERSION}.tar.bz2 41 mv gcc-${VERSION} gcc-${VERSION}.orig 36 42 CURRENTDIR=$(pwd -P) 37 43 38 44 # Get Current Updates from SVN 39 45 # 40 #cd /usr/src 41 #NUM1=$(echo ${VERSION} | cut -f1 -d.) 42 #NUM2=$(echo ${VERSION} | cut -f2 -d.) 43 #FIXEDVERSION=$(echo -n "$NUM1" ; echo -n "_" ; echo -e "$NUM2") 44 #svn export svn://gcc.gnu.org/svn/gcc/branches/gcc-${FIXEDVERSION}-branch gcc-${VERSION} 46 cd /usr/src 47 NUM1=$(echo ${VERSION} | cut -f1 -d.) 48 NUM2=$(echo ${VERSION} | cut -f2 -d.) 49 FIXEDVERSION=$(echo -n "$NUM1" ; echo -n "_" ; echo -e "$NUM2") 50 REVISION=$(svn info svn://gcc.gnu.org/svn/gcc/branches/gcc-${FIXEDVERSION}-branch | grep "Last Changed Rev" | cut -f2 -d: | sed -e 's/ //g') 51 svn export svn://gcc.gnu.org/svn/gcc/branches/gcc-${FIXEDVERSION}-branch gcc-${VERSION} 45 52 46 53 # Add a custom version string … … 51 58 52 59 # Cleanup 60 # 53 61 DIRS="gcc-${VERSION} gcc-${VERSION}.orig" 54 62 for DIRECTORY in ${DIRS}; do … … 85 93 echo " rechecked periodically." >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch 86 94 echo "" >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch 95 echo "This patch was made from Revision # ${REVISION}." >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch 96 echo "" >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch 87 97 diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch 88 98 echo "Created /usr/src/gcc-${VERSION}-branch_update-${PATCH_NUM}.patch." 99 100 # Create Another Copy to create fixes patch 101 # 102 cd /usr/src 103 rm -rf gcc-${VERSION}.orig 104 cp -ar gcc-${VERSION} gcc-${VERSION}.orig 105 106 # Apply Patches from directories 107 # 108 cd /usr/src/gcc-${VERSION} 109 if [ -e ${PATCH_DIR}/${VERSION} ]; then 110 PATCH_FILES=$(ls ${PATCH_DIR}/${VERSION}/*.patch) 111 if [ "${PATCH_FILES}" != "" ]; then 112 for pfile in ${PATCH_FILES}; do 113 echo "Applying - ${pfile}..." 114 for pvalue in $(seq 0 5); do 115 patch --dry-run -Np${pvalue} -i ${pfile} > /dev/null 2>&1 116 if [ "${?}" = "0" ]; then 117 PVALUE=${pvalue} 118 break 119 fi 120 done 121 if [ "${PVALUE}" != "" ]; then 122 patch -Np${PVALUE} -i ${pfile} 123 else 124 echo "Patch: ${pfile} Failed to Apply..." 125 exit 255 126 fi 127 done 128 fi 129 fi 130 131 # Cleanup Directory 132 # 133 134 for dir in $(find * -type d); do 135 cd /usr/src/gcc-${VERSION}/${dir} 136 for file in $(find . -name '*~'); do 137 rm -f ${file} 138 done 139 for file in $(find . -name '*.orig'); do 140 rm -f ${file} 141 done 142 for file in $(find . -name '*.rej'); do 143 rm -f ${file} 144 done 145 done 146 cd /usr/src/gcc-${VERSION}/ 147 rm -rf *.orig *~ *.rej 148 149 # Create Patch 150 # 151 cd /usr/src 152 echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > gcc-${VERSION}-fixes-${PATCH_NUM2}.patch 153 echo "Date: `date +%m-%d-%Y`" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch 154 echo "Initial Package Version: ${VERSION}" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch 155 echo "Origin: Upstream" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch 156 echo "Upstream Status: Applied" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch 157 echo "Description: This Patch contains fixes for gcc-${VERSION}, and should be" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch 158 echo " rechecked periodically." >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch 159 echo "" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch 160 diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch 161 echo "Created /usr/src/gcc-${VERSION}-fixes-${PATCH_NUM2}.patch."
Note:
See TracChangeset
for help on using the changeset viewer.