Ignore:
Timestamp:
Jan 20, 2009, 4:01:19 PM (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:
550b73d
Parents:
d8b9d99
Message:

Added Perl Patch and cleaned up

File:
1 edited

Legend:

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

    rd8b9d99 r9676bac  
    99#
    1010if [ "${VERSION}" = "" ]; then
    11         echo "$0 - Bash_Version"
    12         echo "This will Create a Patch for Bash Bash_Version"
     11  echo "$0 - Bash_Version"
     12  echo "This will Create a Patch for Bash Bash_Version"
     13  exit 255
    1314fi
    1415
     
    2728#
    2829if ! [ -e bash-${VERSION}.tar.gz ]; then
    29         wget ftp://ftp.cwru.edu/pub/bash/bash-${VERSION}.tar.gz
     30  wget ftp://ftp.cwru.edu/pub/bash/bash-${VERSION}.tar.gz
    3031fi
    3132
     
    4445COUNT=1
    4546while [ ${COUNT} -le ${FILES} ]; do
    46         cd /tmp/bash-${VERSION}           
    47         DLCOUNT="${COUNT}"
    48         SKIPME=no
    49         if [ "${COUNT}" -lt "100" ]; then
    50                 DLCOUNT="0${COUNT}"
    51         fi
    52         if [ "${COUNT}" -lt "10" ]; then
    53                 DLCOUNT="00${COUNT}"
    54         fi
    55         for skip in ${SKIPPATCH} ; do
    56                 if [ "${DLCOUNT}" = "$skip" ]; then
    57                         echo "Patch bash${VERSION2}-${DLCOUNT} skipped"
    58                         SKIPPED="${SKIPPED} ${DLCOUNT}"
    59                         SKIPME=yes
    60                 fi
    61         done
    62         if [ "${SKIPME}" != "yes" ]; then
    63                 if ! [ -e ${VERSION}.${DLCOUNT} ]; then
    64                         wget --quiet ${PATCHURL}/bash${VERSION2}-${DLCOUNT}
    65                 fi
    66                 cd ${CURRENTDIR}
    67                 patch --dry-run -s -f -Np0 -i /tmp/bash-${VERSION}/bash${VERSION2}-${DLCOUNT}
    68                 if [ "$?" = "0" ]; then
    69                         echo "Patch bash${VERSION2}-${DLCOUNT} applied"
    70                         patch -s -Np0 -i /tmp/bash-${VERSION}/bash${VERSION2}-${DLCOUNT}
    71                 else
    72                         echo "Patch bash${VERSION2}-${DLCOUNT} not applied"
    73                         rm -f /tmp/bash-${VERSION}/bash${VERSION2}-${DLCOUNT}
    74                         SKIPPED="${SKIPPED} ${DLCOUNT}"
    75                 fi
    76         fi
    77         COUNT=`expr ${COUNT} + 1`
     47  cd /tmp/bash-${VERSION}           
     48  DLCOUNT="${COUNT}"
     49  SKIPME=no
     50  if [ "${COUNT}" -lt "100" ]; then
     51    DLCOUNT="0${COUNT}"
     52  fi
     53  if [ "${COUNT}" -lt "10" ]; then
     54    DLCOUNT="00${COUNT}"
     55  fi
     56  for skip in ${SKIPPATCH} ; do
     57    if [ "${DLCOUNT}" = "$skip" ]; then
     58      echo "Patch bash${VERSION2}-${DLCOUNT} skipped"
     59      SKIPPED="${SKIPPED} ${DLCOUNT}"
     60      SKIPME=yes
     61    fi
     62  done
     63  if [ "${SKIPME}" != "yes" ]; then
     64    if ! [ -e ${VERSION}.${DLCOUNT} ]; then
     65      wget --quiet ${PATCHURL}/bash${VERSION2}-${DLCOUNT}
     66    fi
     67    cd ${CURRENTDIR}
     68    patch --dry-run -s -f -Np0 -i /tmp/bash-${VERSION}/bash${VERSION2}-${DLCOUNT}
     69    if [ "$?" = "0" ]; then
     70      echo "Patch bash${VERSION2}-${DLCOUNT} applied"
     71      patch -s -Np0 -i /tmp/bash-${VERSION}/bash${VERSION2}-${DLCOUNT}
     72    else
     73     echo "Patch bash${VERSION2}-${DLCOUNT} not applied"
     74     rm -f /tmp/bash-${VERSION}/bash${VERSION2}-${DLCOUNT}
     75     SKIPPED="${SKIPPED} ${DLCOUNT}"
     76    fi
     77  fi
     78  COUNT=`expr ${COUNT} + 1`
    7879done
    7980
     
    8283
    8384for dir in $(find * -type d); do
    84         cd /usr/src/bash-${VERSION}/${dir}
    85         for file in $(find . -name '*~'); do
    86                 rm -f ${file}
    87         done
    88         for file in $(find . -name '*.orig'); do
    89                 rm -f ${file}
    90         done
     85  cd /usr/src/bash-${VERSION}/${dir}
     86  for file in $(find . -name '*~'); do
     87    rm -f ${file}
     88  done
     89  for file in $(find . -name '*.orig'); do
     90    rm -f ${file}
     91  done
    9192done
    9293cd /usr/src/bash-${VERSION}
     
    103104echo "Description: Contains all upstream patches up to ${VERSION}-${FILES}" >> bash-${VERSION}-branch_update-x.patch
    104105if [ -n "${SKIPPED}" ]; then
    105         echo "             The following patches were skipped" >> bash-${VERSION}-branch_update-x.patch
    106         echo "            ${SKIPPED}" >> bash-${VERSION}-branch_update-x.patch
     106  echo "             The following patches were skipped" >> bash-${VERSION}-branch_update-x.patch
     107  echo "            ${SKIPPED}" >> bash-${VERSION}-branch_update-x.patch
    107108fi
    108109echo "" >> bash-${VERSION}-branch_update-x.patch
    109110diff -Naur bash-${VERSION}.orig bash-${VERSION} >> bash-${VERSION}-branch_update-x.patch
    110111echo "Created /usr/src/bash-${VERSION}-branch_update-x.patch."
    111 
Note: See TracChangeset for help on using the changeset viewer.