Ignore:
Timestamp:
Jul 3, 2009, 11:26:52 AM (15 years ago)
Author:
Jim Gifford <clfs@…>
Branches:
clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
Children:
acf32d0
Parents:
2349999
Message:

Updates to Patch Scripts

File:
1 edited

Legend:

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

    r2349999 rd8a9d8b  
    1616# Get Patch Names
    1717#
    18 cd /usr/src
     18cd ~/tmp
    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#
     28cd ~/tmp
    2829if ! [ -e ncurses-${VERSION}.tar.gz ]; then
    2930  wget ftp://invisible-island.net/ncurses/ncurses-${VERSION}.tar.gz
     
    3233# Set Patch Number
    3334#
    34 cd /usr/src
     35cd ~/tmp
    3536wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing
    3637PATCH_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)
     
    4041# Cleanup Directory
    4142#
     43cd ~/tmp
    4244rm -rf ncurses-${VERSION} ncurses-${VERSION}.orig
    4345tar xvf ncurses-${VERSION}.tar.gz
    4446cp -ar ncurses-${VERSION} ncurses-${VERSION}.orig
    45 cd ncurses-${VERSION}
    4647
    4748# Download and Apply Rollup Patch
    4849#
     50cd ~/tmp/ncurses-${VERSION}
    4951CURRENTDIR=$(pwd -P)
    50 mkdir /tmp/ncurses-${VERSION}
    51 cd /tmp/ncurses-${VERSION}
     52mkdir ~/tmp/ncurses-${VERSION}-patches
     53cd ~/tmp/ncurses-${VERSION}
    5254if [ "${ROLLUP}" != "" ]; then
    5355  echo "Getting Rollup ${ROLLUP} Patch..."
     56  cd ~/tmp/ncurses-${VERSION}-patches
    5457  wget --quiet ftp://invisible-island.net/ncurses/${VERSION}/${ROLLUP}
    5558  cd ${CURRENTDIR}
    5659  echo "Applying Rollup ${ROLLUP} Patch..."
    57   cp /tmp/ncurses-${VERSION}/${ROLLUP} ${CURRENTDIR}/${ROLLUP}
     60  cp ~/tmp/ncurses-${VERSION}-patches/${ROLLUP} ${CURRENTDIR}/${ROLLUP}
    5861  bunzip2 ${ROLLUP}
    5962  ROLLUP2=$(echo ${ROLLUP} | sed -e 's/.bz2//g')
     
    6366# Download and Apply Patches
    6467#
     68install -d ~/tmp/ncurses-${VERSION}-patches
     69cd ~/tmp/ncurses-${VERSION}
     70CURRENTDIR=$(pwd -P)
    6571for file in ${FILES}; do
    6672  if [ "${ROLLPATCH}" != "" ]; then
     
    7076  fi
    7177  if [ "${TEST}" = "0" ]; then
    72     cd /tmp/ncurses-${VERSION}
     78    cd ~/tmp/ncurses-${VERSION}-patches
    7379    echo "Getting Patch ${file}..."
    7480    wget --quiet ftp://invisible-island.net/ncurses/${VERSION}/${file}
    7581    cd ${CURRENTDIR}
    76     gunzip -c /tmp/ncurses-${VERSION}/${file} | patch --dry-run -s -f -Np1
     82    gunzip -c ~/tmp/ncurses-${VERSION}-patches/${file} | patch --dry-run -s -f -Np1
    7783    if [ "$?" = "0" ]; then
    7884      echo "Apply Patch ${file}..."
    79       gunzip -c /tmp/ncurses-${VERSION}/${file} | patch -Np1
     85      gunzip -c ~/tmp/ncurses-${VERSION}-patches/${file} | patch -Np1
    8086      LASTFILE=$(echo ${file} | cut -f2 -d. | cut -f2 -d-)
    8187    fi
     
    8591# Cleanup Directory
    8692#
    87 # Cleanup Directory
    88 #
     93cd ~/tmp
     94cd ncurses-${VERSION}
    8995for dir in $(find * -type d); do
    90   cd /usr/src/ncurses-${VERSION}/${dir}
     96  cd ~/tmp/ncurses-${VERSION}/${dir}
    9197  for file in $(find . -name '*~'); do
    9298    rm -f ${file}
     
    96102  done
    97103done
    98 cd /usr/src/ncurses-${VERSION}
     104cd ~/tmp/ncurses-${VERSION}
    99105rm -f *~ *.orig
    100106
    101107# Create Patch
    102108#
    103 cd /usr/src
    104 echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    105 echo "Date: `date +%m-%d-%Y`" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    106 echo "Initial Package Version: ${VERSION}" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    107 echo "Origin: Upstream" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    108 echo "Upstream Status: Applied" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    109 echo "Description: This is a branch update for NCurses-${VERSION}, and should be" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    110 echo "             rechecked periodically. This patch covers up to ${VERSION}-${LASTFILE}." >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    111 echo "" >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    112 diff -Naur ncurses-${VERSION}.orig ncurses-${VERSION} >> ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
    113 echo "Created /usr/src/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch."
     109cd ~/tmp
     110echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     111echo "Date: `date +%m-%d-%Y`" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     112echo "Initial Package Version: ${VERSION}" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     113echo "Origin: Upstream" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     114echo "Upstream Status: Applied" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     115echo "Description: This is a branch update for NCurses-${VERSION}, and should be" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     116echo "             rechecked periodically. This patch covers up to ${VERSION}-${LASTFILE}." >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     117echo "" >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     118diff -Naur ncurses-${VERSION}.orig ncurses-${VERSION} >> ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch
     119echo "Created ~/patches/ncurses-${VERSION}-branch_update-${PATCH_NUM}.patch."
     120
     121# Cleanup Directory
     122#
     123cd ~/tmp
     124rm -rf ncurses-${VERSION} ncurses-${VERSION}.orig
Note: See TracChangeset for help on using the changeset viewer.