Ignore:
File:
1 edited

Legend:

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

    r10b98b1 rd8a9d8b  
    1616# Get the # of Patches
    1717#
    18 cd /usr/src
     18cd ~/tmp
    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#
     29cd ~/tmp
    2930if ! [ -e readline-${VERSION}.tar.gz ]; then
    3031  wget ftp://ftp.cwru.edu/pub/bash/readline-${VERSION}.tar.gz
     
    3334# Set Patch Number
    3435#
    35 cd /usr/src
     36cd ~/tmp
    3637wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing
    3738PATCH_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)
     
    4142# Cleanup Directory
    4243#
     44cd ~/tmp
    4345rm -rf readline-${VERSION} readline-${VERSION}.orig
    4446tar xvf readline-${VERSION}.tar.gz
    4547cp -ar readline-${VERSION} readline-${VERSION}.orig
    46 cd readline-${VERSION}
    47 CURRENTDIR=$(pwd -P)
    4848
    4949# Download and Apply Patches
    5050#
     51install -d ~/tmp/readline-${VERSION}-patches
     52cd ~/tmp/readline-${VERSION}
     53CURRENTDIR=$(pwd -P)
    5154PATCHURL=ftp://ftp.cwru.edu/pub/bash/readline-${VERSION}-patches
    5255mkdir /tmp/readline-${VERSION}
    5356COUNT=1
    5457while [ ${COUNT} -le ${FILES} ]; do
    55   cd /tmp/readline-${VERSION}           
     58  cd ~/tmp/readline-${VERSION}           
    5659  DLCOUNT="${COUNT}"
    5760  SKIPME=no
     
    7174  if [ "${SKIPME}" != "yes" ]; then
    7275    if ! [ -e ${VERSION}.${DLCOUNT} ]; then
     76      cd ~/tmp/readline-${VERSION}-patches
    7377      wget --quiet ${PATCHURL}/readline${VERSION2}-${DLCOUNT}
    7478    fi
    7579    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}
    7781    if [ "$?" = "0" ]; then
    7882      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}
    8084    else
    8185      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}
    8387      SKIPPED="${SKIPPED} ${DLCOUNT}"
    8488     fi
     
    9296#
    9397for dir in $(find * -type d); do
    94   cd /usr/src/readline-${VERSION}/${dir}
     98  cd ~/tmp/readline-${VERSION}/${dir}
    9599  for file in $(find . -name '*~'); do
    96100    rm -f ${file}
     
    100104  done
    101105done
    102 cd /usr/src/readline-${VERSION}
     106cd ~/tmp/readline-${VERSION}
    103107rm -f *~ *.orig
    104108
    105109# Create Patch
    106110#
    107 cd /usr/src
    108 echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > readline-${VERSION}-branch_update-${PATCH_NUM}.patch
    109 echo "Date: `date +%m-%d-%Y`" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
    110 echo "Initial Package Version: ${VERSION}" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
    111 echo "Origin: Upstream" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
    112 echo "Upstream Status: Applied" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
    113 echo "Description: Contains all upstream patches up to ${VERSION}-${FILES}" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
     111cd ~/tmp
     112echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
     113echo "Date: `date +%m-%d-%Y`" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
     114echo "Initial Package Version: ${VERSION}" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
     115echo "Origin: Upstream" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
     116echo "Upstream Status: Applied" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
     117echo "Description: Contains all upstream patches up to ${VERSION}-${FILES}" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
    114118if [ -n "${SKIPPED}" ]; then
    115   echo "            Thee following patches were skipped" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
    116   echo "            ${SKIPPED}" >> readline-${VERSION}-branch_update-${PATCH_NUM}.patch
     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
    117121fi
    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."
     122echo "" >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
     123diff -Naur readline-${VERSION}.orig readline-${VERSION} >> ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch
     124echo "Created ~/patches/readline-${VERSION}-branch_update-${PATCH_NUM}.patch."
     125
     126# Cleanup Directory
     127#
     128cd ~/tmp
     129rm -rf readline-${VERSION} readline-${VERSION}.orig
Note: See TracChangeset for help on using the changeset viewer.