Ignore:
File:
1 edited

Legend:

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

    rd8a9d8b rc7ef534  
    1616# Get Patch Names
    1717#
    18 cd ~/tmp
     18cd /usr/src
    1919wget ftp://invisible-island.net/ncurses/${VERSION}/ --no-remove-listing
    2020ROLLUP=$(cat index.html | grep bz2 | cut -f2 -d'>' | cut -f1 -d'<' | tail -n 1)
     
    2626# Download Ncurses Source
    2727#
    28 cd ~/tmp
    2928if ! [ -e ncurses-${VERSION}.tar.gz ]; then
    3029  wget ftp://invisible-island.net/ncurses/ncurses-${VERSION}.tar.gz
     
    3332# Set Patch Number
    3433#
    35 cd ~/tmp
     34cd /usr/src
    3635wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing
    3736PATCH_NUM=$(cat index.html | grep ncurses | grep "${VERSION}" | grep branch_update | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)
     
    4140# Cleanup Directory
    4241#
    43 cd ~/tmp
    4442rm -rf ncurses-${VERSION} ncurses-${VERSION}.orig
    4543tar xvf ncurses-${VERSION}.tar.gz
    4644cp -ar ncurses-${VERSION} ncurses-${VERSION}.orig
     45cd ncurses-${VERSION}
    4746
    4847# Download and Apply Rollup Patch
    4948#
    50 cd ~/tmp/ncurses-${VERSION}
    5149CURRENTDIR=$(pwd -P)
    52 mkdir ~/tmp/ncurses-${VERSION}-patches
    53 cd ~/tmp/ncurses-${VERSION}
     50mkdir /tmp/ncurses-${VERSION}
     51cd /tmp/ncurses-${VERSION}
    5452if [ "${ROLLUP}" != "" ]; then
    5553  echo "Getting Rollup ${ROLLUP} Patch..."
    56   cd ~/tmp/ncurses-${VERSION}-patches
    5754  wget --quiet ftp://invisible-island.net/ncurses/${VERSION}/${ROLLUP}
    5855  cd ${CURRENTDIR}
    5956  echo "Applying Rollup ${ROLLUP} Patch..."
    60   cp ~/tmp/ncurses-${VERSION}-patches/${ROLLUP} ${CURRENTDIR}/${ROLLUP}
     57  cp /tmp/ncurses-${VERSION}/${ROLLUP} ${CURRENTDIR}/${ROLLUP}
    6158  bunzip2 ${ROLLUP}
    6259  ROLLUP2=$(echo ${ROLLUP} | sed -e 's/.bz2//g')
     
    6663# Download and Apply Patches
    6764#
    68 install -d ~/tmp/ncurses-${VERSION}-patches
    69 cd ~/tmp/ncurses-${VERSION}
    70 CURRENTDIR=$(pwd -P)
    7165for file in ${FILES}; do
    7266  if [ "${ROLLPATCH}" != "" ]; then
     
    7670  fi
    7771  if [ "${TEST}" = "0" ]; then
    78     cd ~/tmp/ncurses-${VERSION}-patches
     72    cd /tmp/ncurses-${VERSION}
    7973    echo "Getting Patch ${file}..."
    8074    wget --quiet ftp://invisible-island.net/ncurses/${VERSION}/${file}
    8175    cd ${CURRENTDIR}
    82     gunzip -c ~/tmp/ncurses-${VERSION}-patches/${file} | patch --dry-run -s -f -Np1
     76    gunzip -c /tmp/ncurses-${VERSION}/${file} | patch --dry-run -s -f -Np1
    8377    if [ "$?" = "0" ]; then
    8478      echo "Apply Patch ${file}..."
    85       gunzip -c ~/tmp/ncurses-${VERSION}-patches/${file} | patch -Np1
     79      gunzip -c /tmp/ncurses-${VERSION}/${file} | patch -Np1
    8680      LASTFILE=$(echo ${file} | cut -f2 -d. | cut -f2 -d-)
    8781    fi
     
    9185# Cleanup Directory
    9286#
    93 cd ~/tmp
    94 cd ncurses-${VERSION}
     87# Cleanup Directory
     88#
    9589for dir in $(find * -type d); do
    96   cd ~/tmp/ncurses-${VERSION}/${dir}
     90  cd /usr/src/ncurses-${VERSION}/${dir}
    9791  for file in $(find . -name '*~'); do
    9892    rm -f ${file}
     
    10296  done
    10397done
    104 cd ~/tmp/ncurses-${VERSION}
     98cd /usr/src/ncurses-${VERSION}
    10599rm -f *~ *.orig
    106100
    107101# Create Patch
    108102#
    109 cd ~/tmp
    110 echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    111 echo "Date: `date +%m-%d-%Y`" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    112 echo "Initial Package Version: ${VERSION}" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    113 echo "Origin: Upstream" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    114 echo "Upstream Status: Applied" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    115 echo "Description: This is a branch update for NCurses-${VERSION}, and should be" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    116 echo "             rechecked periodically. This patch covers up to ${VERSION}-${LASTFILE}." >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    117 echo "" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    118 diff -Naur ncurses-${VERSION}.orig ncurses-${VERSION} >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    119 echo "Created ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch."
    120 
    121 # Cleanup Directory
    122 #
    123 cd ~/tmp
    124 rm -rf ncurses-${VERSION} ncurses-${VERSION}.orig
     103cd /usr/src
     104echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     105echo "Date: `date +%m-%d-%Y`" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     106echo "Initial Package Version: ${VERSION}" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     107echo "Origin: Upstream" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     108echo "Upstream Status: Applied" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     109echo "Description: This is a branch update for NCurses-${VERSION}, and should be" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     110echo "             rechecked periodically. This patch covers up to ${VERSION}-${LASTFILE}." >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     111echo "" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     112diff -Naur ncurses-${VERSION}.orig ncurses-${VERSION} >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     113echo "Created /usr/src/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch."
Note: See TracChangeset for help on using the changeset viewer.