Changes in scripts/patch/bash-patch.sh [d8a9d8b:c7ef534]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/patch/bash-patch.sh
rd8a9d8b rc7ef534 16 16 # Get the # of Patches 17 17 # 18 install -d ~/tmp 19 cd ~/tmp 18 cd /usr/src 20 19 wget ftp://ftp.cwru.edu/pub/bash/bash-${VERSION}-patches/ --no-remove-listing 21 20 VERSION2=$(echo ${VERSION} | sed -e 's/\.//g') … … 34 33 # Set Patch Number 35 34 # 36 cd ~/tmp35 cd /usr/src 37 36 wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing 38 37 PATCH_NUM=$(cat index.html | grep bash | grep "${VERSION}" | grep branch_update | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1) … … 42 41 # Cleanup Directory 43 42 # 44 cd ~/tmp45 43 rm -rf bash-${VERSION} bash-${VERSION}.orig 46 44 tar xvf bash-${VERSION}.tar.gz 47 45 cp -ar bash-${VERSION} bash-${VERSION}.orig 46 cd bash-${VERSION} 47 CURRENTDIR=$(pwd -P) 48 48 49 49 # Download and Apply Patches 50 50 # 51 install -d ~/tmp/bash-${VERSION}-patches52 cd ~/tmp/bash-${VERSION}53 CURRENTDIR=$(pwd -P)54 51 PATCHURL=ftp://ftp.cwru.edu/pub/bash/bash-${VERSION}-patches 52 mkdir /tmp/bash-${VERSION} 55 53 COUNT=1 56 54 while [ ${COUNT} -le ${FILES} ]; do 57 cd ~/tmp/bash-${VERSION}55 cd /tmp/bash-${VERSION} 58 56 DLCOUNT="${COUNT}" 59 57 SKIPME=no … … 73 71 if [ "${SKIPME}" != "yes" ]; then 74 72 if ! [ -e ${VERSION}.${DLCOUNT} ]; then 75 cd ~/tmp/bash-${VERSION}-patches76 73 wget --quiet ${PATCHURL}/bash${VERSION2}-${DLCOUNT} 77 74 fi 78 75 cd ${CURRENTDIR} 79 patch --dry-run -s -f -Np0 -i ~/tmp/bash-${VERSION}-patches/bash${VERSION2}-${DLCOUNT}76 patch --dry-run -s -f -Np0 -i /tmp/bash-${VERSION}/bash${VERSION2}-${DLCOUNT} 80 77 if [ "$?" = "0" ]; then 81 78 echo "Patch bash${VERSION2}-${DLCOUNT} applied" 82 patch -s -Np0 -i ~/tmp/bash-${VERSION}-patches/bash${VERSION2}-${DLCOUNT}79 patch -s -Np0 -i /tmp/bash-${VERSION}/bash${VERSION2}-${DLCOUNT} 83 80 else 84 81 echo "Patch bash${VERSION2}-${DLCOUNT} not applied" 85 rm -f ~/tmp/bash-${VERSION}-patches/bash${VERSION2}-${DLCOUNT}82 rm -f /tmp/bash-${VERSION}/bash${VERSION2}-${DLCOUNT} 86 83 SKIPPED="${SKIPPED} ${DLCOUNT}" 87 84 fi … … 92 89 # Cleanup Directory 93 90 # 94 cd ~/tmp/bash-${VERSION} 91 95 92 for dir in $(find * -type d); do 96 cd ~/tmp/bash-${VERSION}/${dir}93 cd /usr/src/bash-${VERSION}/${dir} 97 94 for file in $(find . -name '*~'); do 98 95 rm -f ${file} … … 102 99 done 103 100 done 104 cd ~/tmp/bash-${VERSION}101 cd /usr/src/bash-${VERSION} 105 102 rm -f *~ *.orig 106 103 107 104 # Create Patch 108 105 # 109 cd ~/tmp 110 install -d ~/patches 111 echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch 112 echo "Date: `date +%m-%d-%Y`" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch 113 echo "Initial Package Version: ${VERSION}" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch 114 echo "Origin: Upstream" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch 115 echo "Upstream Status: Applied" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch 116 echo "Description: Contains all upstream patches up to ${VERSION}-${FILES}" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch 106 cd /usr/src 107 echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > bash-${VERSION}-branch_update-${PATCH_NUM}.patch 108 echo "Date: `date +%m-%d-%Y`" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch 109 echo "Initial Package Version: ${VERSION}" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch 110 echo "Origin: Upstream" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch 111 echo "Upstream Status: Applied" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch 112 echo "Description: Contains all upstream patches up to ${VERSION}-${FILES}" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch 117 113 if [ -n "${SKIPPED}" ]; then 118 echo " The following patches were skipped" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch119 echo " ${SKIPPED}" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch114 echo " The following patches were skipped" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch 115 echo " ${SKIPPED}" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch 120 116 fi 121 echo "" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch 122 diff -Naur bash-${VERSION}.orig bash-${VERSION} >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch 123 echo "Created ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch." 124 125 # Cleanup Directory 126 # 127 cd ~/tmp 128 rm -rf bash-${VERSION} bash-${VERSION}.orig 117 echo "" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch 118 diff -Naur bash-${VERSION}.orig bash-${VERSION} >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch 119 echo "Created /usr/src/bash-${VERSION}-branch_update-${PATCH_NUM}.patch."
Note:
See TracChangeset
for help on using the changeset viewer.