Changes in scripts/patch/readline-patch.sh [10b98b1:d8a9d8b]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/patch/readline-patch.sh
r10b98b1 rd8a9d8b 16 16 # Get the # of Patches 17 17 # 18 cd /usr/src18 cd ~/tmp 19 19 wget ftp://ftp.cwru.edu/pub/bash/readline-${VERSION}-patches/ --no-remove-listing 20 20 VERSION2=$(echo ${VERSION} | sed -e 's/\.//g') … … 27 27 # Download Readline Source 28 28 # 29 cd ~/tmp 29 30 if ! [ -e readline-${VERSION}.tar.gz ]; then 30 31 wget ftp://ftp.cwru.edu/pub/bash/readline-${VERSION}.tar.gz … … 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 readline | 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 readline-${VERSION} readline-${VERSION}.orig 44 46 tar xvf readline-${VERSION}.tar.gz 45 47 cp -ar readline-${VERSION} readline-${VERSION}.orig 46 cd readline-${VERSION}47 CURRENTDIR=$(pwd -P)48 48 49 49 # Download and Apply Patches 50 50 # 51 install -d ~/tmp/readline-${VERSION}-patches 52 cd ~/tmp/readline-${VERSION} 53 CURRENTDIR=$(pwd -P) 51 54 PATCHURL=ftp://ftp.cwru.edu/pub/bash/readline-${VERSION}-patches 52 55 mkdir /tmp/readline-${VERSION} 53 56 COUNT=1 54 57 while [ ${COUNT} -le ${FILES} ]; do 55 cd /tmp/readline-${VERSION}58 cd ~/tmp/readline-${VERSION} 56 59 DLCOUNT="${COUNT}" 57 60 SKIPME=no … … 71 74 if [ "${SKIPME}" != "yes" ]; then 72 75 if ! [ -e ${VERSION}.${DLCOUNT} ]; then 76 cd ~/tmp/readline-${VERSION}-patches 73 77 wget --quiet ${PATCHURL}/readline${VERSION2}-${DLCOUNT} 74 78 fi 75 79 cd ${CURRENTDIR} 76 patch --dry-run -s -f -Np0 -i /tmp/readline-${VERSION}/readline${VERSION2}-${DLCOUNT}80 patch --dry-run -s -f -Np0 -i ~/tmp/readline-${VERSION}-patches/readline${VERSION2}-${DLCOUNT} 77 81 if [ "$?" = "0" ]; then 78 82 echo "Patch readline${VERSION2}-${DLCOUNT} applied" 79 patch -s -Np0 -i /tmp/readline-${VERSION}/readline${VERSION2}-${DLCOUNT}83 patch -s -Np0 -i ~/tmp/readline-${VERSION}-patches/readline${VERSION2}-${DLCOUNT} 80 84 else 81 85 echo "Patch readline${VERSION2}-${DLCOUNT} not applied" 82 rm -f /tmp/readline-${VERSION}/readline${VERSION2}-${DLCOUNT}86 rm -f ~/tmp/readline-${VERSION}-patches/readline${VERSION2}-${DLCOUNT} 83 87 SKIPPED="${SKIPPED} ${DLCOUNT}" 84 88 fi … … 92 96 # 93 97 for dir in $(find * -type d); do 94 cd /usr/src/readline-${VERSION}/${dir}98 cd ~/tmp/readline-${VERSION}/${dir} 95 99 for file in $(find . -name '*~'); do 96 100 rm -f ${file} … … 100 104 done 101 105 done 102 cd /usr/src/readline-${VERSION}106 cd ~/tmp/readline-${VERSION} 103 107 rm -f *~ *.orig 104 108 105 109 # Create Patch 106 110 # 107 cd /usr/src108 echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > readline-${VERSION}-branch_update-${PATCH_NUM}.patch109 echo "Date: `date +%m-%d-%Y`" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch110 echo "Initial Package Version: ${VERSION}" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch111 echo "Origin: Upstream" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch112 echo "Upstream Status: Applied" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch113 echo "Description: Contains all upstream patches up to ${VERSION}-${FILES}" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch111 cd ~/tmp 112 echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch 113 echo "Date: `date +%m-%d-%Y`" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch 114 echo "Initial Package Version: ${VERSION}" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch 115 echo "Origin: Upstream" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch 116 echo "Upstream Status: Applied" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch 117 echo "Description: Contains all upstream patches up to ${VERSION}-${FILES}" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch 114 118 if [ -n "${SKIPPED}" ]; then 115 echo " Thee following patches were skipped" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch116 echo " ${SKIPPED}" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch119 echo " Thee following patches were skipped" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch 120 echo " ${SKIPPED}" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch 117 121 fi 118 echo "" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch 119 diff -Naur readline-${VERSION}.orig readline-${VERSION} >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch 120 echo "Created /usr/src/readline-${VERSION}-branch_update-${PATCH_NUM}.patch." 122 echo "" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch 123 diff -Naur readline-${VERSION}.orig readline-${VERSION} >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch 124 echo "Created ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch." 125 126 # Cleanup Directory 127 # 128 cd ~/tmp 129 rm -rf readline-${VERSION} readline-${VERSION}.orig
Note:
See TracChangeset
for help on using the changeset viewer.