Changeset 3820147 for scripts


Ignore:
Timestamp:
Jun 15, 2009, 3:03:52 PM (16 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:
9c80698
Parents:
3152429
Message:

Update Patch Scripts

Location:
scripts/patch
Files:
2 edited

Legend:

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

    r3152429 r3820147  
    8181cd /usr/src/binutils-${SOURCEVERSION}
    8282sed -i "s:@PKGVERSION@:(GNU Binutils for Cross-LFS) :" bfd/Makefile.in
    83 sed -i "s:^[[:space:]]VERSION=\(.*\)$:VERSION=\1.${DATE_STAMP}:g" bfd/configure
    84 
    85 # Cleanliness is the name of my game!
    86 #
    87 unset DATE_STAMP
     83sed -i "s:^[[:space:]]VERSION=\(.*\)$: VERSION=\1.${DATE_STAMP}:g" bfd/configure
    8884
    8985# Create Patch
     
    9894echo "             rechecked periodically." >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
    9995echo "" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
     96echo "This patch was created on ${DATE_STAMP}" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
     97echo "" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
    10098diff -Naur binutils-${SOURCEVERSION}.orig binutils-${SOURCEVERSION} >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
    10199echo "Created /usr/src/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch."
     100
     101# Cleanliness is the name of my game!
     102#
     103unset DATE_STAMP
  • scripts/patch/gcc-patch.sh

    r3152429 r3820147  
    1414fi
    1515
     16# Set Patch Directory
     17#
     18PATCH_DIR=$(pwd -P)/gcc
     19
    1620# Download GCC Source
    1721#
     
    2428#
    2529cd /usr/src
    26 wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing
     30wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing > /dev/null 2>&1
    2731PATCH_NUM=$(cat index.html | grep gcc | grep "${VERSION}" | grep branch_update | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)
    2832PATCH_NUM=$(expr ${PATCH_NUM} + 1)
     33PATCH_NUM2=$(cat index.html | grep gcc | grep "${VERSION}" | grep fixes | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)
     34PATCH_NUM2=$(expr ${PATCH_NUM2} + 1)
    2935rm -f index.html
    3036
    3137# Cleanup Directory
    3238#
    33 #rm -rf gcc-${VERSION} gcc-${VERSION}.orig
    34 #tar xvf gcc-${VERSION}.tar.bz2
    35 #mv gcc-${VERSION} gcc-${VERSION}.orig
     39rm -rf gcc-${VERSION} gcc-${VERSION}.orig
     40tar xvf gcc-${VERSION}.tar.bz2
     41mv gcc-${VERSION} gcc-${VERSION}.orig
    3642CURRENTDIR=$(pwd -P)
    3743
    3844# Get Current Updates from SVN
    3945#
    40 #cd /usr/src
    41 #NUM1=$(echo ${VERSION} | cut -f1 -d.)
    42 #NUM2=$(echo ${VERSION} | cut -f2 -d.)
    43 #FIXEDVERSION=$(echo -n "$NUM1" ; echo -n "_" ; echo -e "$NUM2")
    44 #svn export svn://gcc.gnu.org/svn/gcc/branches/gcc-${FIXEDVERSION}-branch gcc-${VERSION}
     46cd /usr/src
     47NUM1=$(echo ${VERSION} | cut -f1 -d.)
     48NUM2=$(echo ${VERSION} | cut -f2 -d.)
     49FIXEDVERSION=$(echo -n "$NUM1" ; echo -n "_" ; echo -e "$NUM2")
     50REVISION=$(svn info svn://gcc.gnu.org/svn/gcc/branches/gcc-${FIXEDVERSION}-branch | grep "Last Changed Rev" | cut -f2 -d: | sed -e 's/ //g')
     51svn export svn://gcc.gnu.org/svn/gcc/branches/gcc-${FIXEDVERSION}-branch gcc-${VERSION}
    4552
    4653# Add a custom version string
     
    5158
    5259# Cleanup
     60#
    5361DIRS="gcc-${VERSION} gcc-${VERSION}.orig"
    5462for DIRECTORY in ${DIRS}; do
     
    8593echo "             rechecked periodically." >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
    8694echo "" >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
     95echo "This patch was made from Revision # ${REVISION}." >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
     96echo "" >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
    8797diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
    8898echo "Created /usr/src/gcc-${VERSION}-branch_update-${PATCH_NUM}.patch."
     99
     100# Create Another Copy to create fixes patch
     101#
     102cd /usr/src
     103rm -rf gcc-${VERSION}.orig
     104cp -ar gcc-${VERSION} gcc-${VERSION}.orig
     105
     106# Apply Patches from directories
     107#
     108cd /usr/src/gcc-${VERSION}
     109if [ -e ${PATCH_DIR}/${VERSION} ]; then
     110  PATCH_FILES=$(ls ${PATCH_DIR}/${VERSION}/*.patch)
     111  if [ "${PATCH_FILES}" != "" ]; then
     112    for pfile in ${PATCH_FILES}; do
     113      echo "Applying - ${pfile}..."
     114      for pvalue in $(seq 0 5); do
     115        patch --dry-run -Np${pvalue} -i ${pfile} > /dev/null 2>&1
     116        if [ "${?}" = "0" ]; then
     117          PVALUE=${pvalue}
     118          break
     119        fi
     120      done
     121      if [ "${PVALUE}" != "" ]; then
     122        patch -Np${PVALUE} -i ${pfile}
     123      else
     124        echo "Patch: ${pfile} Failed to Apply..."
     125        exit 255
     126      fi
     127    done
     128  fi
     129fi
     130
     131# Cleanup Directory
     132#
     133
     134for dir in $(find * -type d); do
     135  cd /usr/src/gcc-${VERSION}/${dir}
     136  for file in $(find . -name '*~'); do
     137    rm -f ${file}
     138  done
     139  for file in $(find . -name '*.orig'); do
     140    rm -f ${file}
     141  done
     142  for file in $(find . -name '*.rej'); do
     143    rm -f ${file}
     144  done
     145done
     146cd /usr/src/gcc-${VERSION}/
     147rm -rf *.orig *~ *.rej
     148
     149# Create Patch
     150#
     151cd /usr/src
     152echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
     153echo "Date: `date +%m-%d-%Y`" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
     154echo "Initial Package Version: ${VERSION}" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
     155echo "Origin: Upstream" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
     156echo "Upstream Status: Applied" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
     157echo "Description: This Patch contains fixes for gcc-${VERSION}, and should be" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
     158echo "             rechecked periodically." >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
     159echo "" >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
     160diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> gcc-${VERSION}-fixes-${PATCH_NUM2}.patch
     161echo "Created /usr/src/gcc-${VERSION}-fixes-${PATCH_NUM2}.patch."
Note: See TracChangeset for help on using the changeset viewer.