Changes in scripts/patch/bash-patch.sh [c7ef534:d8a9d8b]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/patch/bash-patch.sh
rc7ef534 rd8a9d8b 16 16 # Get the # of Patches 17 17 # 18 cd /usr/src 18 install -d ~/tmp 19 cd ~/tmp 19 20 wget ftp://ftp.cwru.edu/pub/bash/bash-${VERSION}-patches/ --no-remove-listing 20 21 VERSION2=$(echo ${VERSION} | sed -e 's/\.//g') … … 33 34 # Set Patch Number 34 35 # 35 cd /usr/src36 cd ~/tmp 36 37 wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing 37 38 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) … … 41 42 # Cleanup Directory 42 43 # 44 cd ~/tmp 43 45 rm -rf bash-${VERSION} bash-${VERSION}.orig 44 46 tar xvf bash-${VERSION}.tar.gz 45 47 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}-patches 52 cd ~/tmp/bash-${VERSION} 53 CURRENTDIR=$(pwd -P) 51 54 PATCHURL=ftp://ftp.cwru.edu/pub/bash/bash-${VERSION}-patches 52 mkdir /tmp/bash-${VERSION}53 55 COUNT=1 54 56 while [ ${COUNT} -le ${FILES} ]; do 55 cd /tmp/bash-${VERSION}57 cd ~/tmp/bash-${VERSION} 56 58 DLCOUNT="${COUNT}" 57 59 SKIPME=no … … 71 73 if [ "${SKIPME}" != "yes" ]; then 72 74 if ! [ -e ${VERSION}.${DLCOUNT} ]; then 75 cd ~/tmp/bash-${VERSION}-patches 73 76 wget --quiet ${PATCHURL}/bash${VERSION2}-${DLCOUNT} 74 77 fi 75 78 cd ${CURRENTDIR} 76 patch --dry-run -s -f -Np0 -i /tmp/bash-${VERSION}/bash${VERSION2}-${DLCOUNT}79 patch --dry-run -s -f -Np0 -i ~/tmp/bash-${VERSION}-patches/bash${VERSION2}-${DLCOUNT} 77 80 if [ "$?" = "0" ]; then 78 81 echo "Patch bash${VERSION2}-${DLCOUNT} applied" 79 patch -s -Np0 -i /tmp/bash-${VERSION}/bash${VERSION2}-${DLCOUNT}82 patch -s -Np0 -i ~/tmp/bash-${VERSION}-patches/bash${VERSION2}-${DLCOUNT} 80 83 else 81 84 echo "Patch bash${VERSION2}-${DLCOUNT} not applied" 82 rm -f /tmp/bash-${VERSION}/bash${VERSION2}-${DLCOUNT}85 rm -f ~/tmp/bash-${VERSION}-patches/bash${VERSION2}-${DLCOUNT} 83 86 SKIPPED="${SKIPPED} ${DLCOUNT}" 84 87 fi … … 89 92 # Cleanup Directory 90 93 # 91 94 cd ~/tmp/bash-${VERSION} 92 95 for dir in $(find * -type d); do 93 cd /usr/src/bash-${VERSION}/${dir}96 cd ~/tmp/bash-${VERSION}/${dir} 94 97 for file in $(find . -name '*~'); do 95 98 rm -f ${file} … … 99 102 done 100 103 done 101 cd /usr/src/bash-${VERSION}104 cd ~/tmp/bash-${VERSION} 102 105 rm -f *~ *.orig 103 106 104 107 # Create Patch 105 108 # 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 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 113 117 if [ -n "${SKIPPED}" ]; then 114 echo " The following patches were skipped" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch115 echo " ${SKIPPED}" >> bash-${VERSION}-branch_update-${PATCH_NUM}.patch118 echo " The following patches were skipped" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch 119 echo " ${SKIPPED}" >> ~/patches/bash-${VERSION}-branch_update-${PATCH_NUM}.patch 116 120 fi 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." 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
Note:
See TracChangeset
for help on using the changeset viewer.