Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • scripts/patch/readline-patch.sh

    rd8a9d8b r10b98b1  
    1616# Get the # of Patches
    1717#
    18 cd ~/tmp
     18cd /usr/src
    1919wget ftp://ftp.cwru.edu/pub/bash/readline-${VERSION}-patches/ --no-remove-listing
    2020VERSION2=$(echo ${VERSION} | sed -e 's/\.//g')
     
    2727# Download Readline Source
    2828#
    29 cd ~/tmp
    3029if ! [ -e readline-${VERSION}.tar.gz ]; then
    3130  wget ftp://ftp.cwru.edu/pub/bash/readline-${VERSION}.tar.gz
     
    3433# Set Patch Number
    3534#
    36 cd ~/tmp
     35cd /usr/src
    3736wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing
    3837PATCH_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)
     
    4241# Cleanup Directory
    4342#
    44 cd ~/tmp
    4543rm -rf readline-${VERSION} readline-${VERSION}.orig
    4644tar xvf readline-${VERSION}.tar.gz
    4745cp -ar readline-${VERSION} readline-${VERSION}.orig
     46cd readline-${VERSION}
     47CURRENTDIR=$(pwd -P)
    4848
    4949# Download and Apply Patches
    5050#
    51 install -d ~/tmp/readline-${VERSION}-patches
    52 cd ~/tmp/readline-${VERSION}
    53 CURRENTDIR=$(pwd -P)
    5451PATCHURL=ftp://ftp.cwru.edu/pub/bash/readline-${VERSION}-patches
    5552mkdir /tmp/readline-${VERSION}
    5653COUNT=1
    5754while [ ${COUNT} -le ${FILES} ]; do
    58   cd ~/tmp/readline-${VERSION}           
     55  cd /tmp/readline-${VERSION}           
    5956  DLCOUNT="${COUNT}"
    6057  SKIPME=no
     
    7471  if [ "${SKIPME}" != "yes" ]; then
    7572    if ! [ -e ${VERSION}.${DLCOUNT} ]; then
    76       cd ~/tmp/readline-${VERSION}-patches
    7773      wget --quiet ${PATCHURL}/readline${VERSION2}-${DLCOUNT}
    7874    fi
    7975    cd ${CURRENTDIR}
    80     patch --dry-run -s -f -Np0 -i ~/tmp/readline-${VERSION}-patches/readline${VERSION2}-${DLCOUNT}
     76    patch --dry-run -s -f -Np0 -i /tmp/readline-${VERSION}/readline${VERSION2}-${DLCOUNT}
    8177    if [ "$?" = "0" ]; then
    8278      echo "Patch readline${VERSION2}-${DLCOUNT} applied"
    83       patch -s -Np0 -i ~/tmp/readline-${VERSION}-patches/readline${VERSION2}-${DLCOUNT}
     79      patch -s -Np0 -i /tmp/readline-${VERSION}/readline${VERSION2}-${DLCOUNT}
    8480    else
    8581      echo "Patch readline${VERSION2}-${DLCOUNT} not applied"
    86       rm -f ~/tmp/readline-${VERSION}-patches/readline${VERSION2}-${DLCOUNT}
     82      rm -f /tmp/readline-${VERSION}/readline${VERSION2}-${DLCOUNT}
    8783      SKIPPED="${SKIPPED} ${DLCOUNT}"
    8884     fi
     
    9692#
    9793for dir in $(find * -type d); do
    98   cd ~/tmp/readline-${VERSION}/${dir}
     94  cd /usr/src/readline-${VERSION}/${dir}
    9995  for file in $(find . -name '*~'); do
    10096    rm -f ${file}
     
    104100  done
    105101done
    106 cd ~/tmp/readline-${VERSION}
     102cd /usr/src/readline-${VERSION}
    107103rm -f *~ *.orig
    108104
    109105# Create Patch
    110106#
    111 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
     107cd /usr/src
     108echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > readline-${VERSION}-branch_update-${PATCH_NUM}.patch
     109echo "Date: `date +%m-%d-%Y`" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
     110echo "Initial Package Version: ${VERSION}" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
     111echo "Origin: Upstream" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
     112echo "Upstream Status: Applied" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
     113echo "Description: Contains all upstream patches up to ${VERSION}-${FILES}" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
    118114if [ -n "${SKIPPED}" ]; then
    119   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
     115  echo "            Thee following patches were skipped" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
     116  echo "            ${SKIPPED}" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
    121117fi
    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
     118echo "" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
     119diff -Naur readline-${VERSION}.orig readline-${VERSION} >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
     120echo "Created /usr/src/readline-${VERSION}-branch_update-${PATCH_NUM}.patch."
Note: See TracChangeset for help on using the changeset viewer.