[9676bac] | 1 | #!/bin/bash
|
---|
| 2 | # Create a Perl Patch
|
---|
| 3 |
|
---|
| 4 | # Get Version #
|
---|
| 5 | #
|
---|
| 6 | VERSION=$1
|
---|
| 7 |
|
---|
| 8 | # Check Input
|
---|
| 9 | #
|
---|
| 10 | if [ "${VERSION}" = "" ]; then
|
---|
| 11 | echo "$0 - Perl_Version"
|
---|
| 12 | echo "This will Create a Patch for Perl Perl_Version"
|
---|
| 13 | exit 255
|
---|
| 14 | fi
|
---|
| 15 |
|
---|
| 16 | # Download Perl Source
|
---|
| 17 | #
|
---|
| 18 | cd /usr/src
|
---|
| 19 | if ! [ -e perl-${VERSION}.tar.gz ]; then
|
---|
| 20 | wget http://www.cpan.org/src/perl-${VERSION}.tar.gz
|
---|
| 21 | fi
|
---|
| 22 |
|
---|
| 23 | # Cleanup Directory
|
---|
| 24 | #
|
---|
| 25 | rm -rf perl-${VERSION} perl-${VERSION}.orig
|
---|
| 26 | tar xvf perl-${VERSION}.tar.gz
|
---|
| 27 | mv perl-${VERSION} perl-${VERSION}.orig
|
---|
| 28 | CURRENTDIR=$(pwd -P)
|
---|
| 29 |
|
---|
| 30 | # Get Current Updates from CVS
|
---|
| 31 | #
|
---|
| 32 | cd /usr/src
|
---|
| 33 | FIXEDVERSION=$(echo ${VERSION} | sed -e 's ..$ ')
|
---|
| 34 | rsync -avz rsync://perl5.git.perl.org/APC/perl-${FIXEDVERSION}.x perl-${VERSION}
|
---|
| 35 |
|
---|
| 36 | # Cleanup
|
---|
| 37 | #
|
---|
| 38 | DIRS="perl-${VERSION} perl-${VERSION}.orig"
|
---|
| 39 | for DIRECTORY in ${DIRS}; do
|
---|
| 40 | cd /usr/src/${DIRECTORY}
|
---|
| 41 | FILE_LIST=".patch"
|
---|
| 42 | for files in ${FILE_LIST}; do
|
---|
| 43 | REMOVE=$(find * -name ${files})
|
---|
| 44 | for file in $REMOVE; do
|
---|
| 45 | rm -f ${file}
|
---|
| 46 | done
|
---|
| 47 | done
|
---|
| 48 |
|
---|
| 49 | REMOVE="Changes Changes5.10 Changes5.8"
|
---|
| 50 | for file in $REMOVE; do
|
---|
| 51 | rm -f ${file}
|
---|
| 52 | done
|
---|
| 53 | cd ..
|
---|
| 54 | done
|
---|
| 55 |
|
---|
| 56 | # Cleanup Directory
|
---|
| 57 | #
|
---|
| 58 | for dir in $(find * -type d); do
|
---|
| 59 | cd /usr/src/perl-${VERSION}
|
---|
| 60 | for file in $(find . -name '*~'); do
|
---|
| 61 | rm -f ${file}
|
---|
| 62 | done
|
---|
| 63 | for file in $(find . -name '*.orig'); do
|
---|
| 64 | rm -f ${file}
|
---|
| 65 | done
|
---|
| 66 | done
|
---|
| 67 | cd /usr/src/perl-${VERSION}
|
---|
| 68 | rm -f *~ *.orig
|
---|
| 69 | rm -f /usr/src/perl-${VERSION}.orig/md5.sum
|
---|
| 70 |
|
---|
| 71 | # Create Patch
|
---|
| 72 | #
|
---|
| 73 | cd /usr/src
|
---|
| 74 | echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > perl-${VERSION}-branch_update-x.patch
|
---|
| 75 | echo "Date: `date +%m-%d-%Y`" >> perl-${VERSION}-branch_update-x.patch
|
---|
| 76 | echo "Initial Package Version: ${VERSION}" >> perl-${VERSION}-branch_update-x.patch
|
---|
| 77 | echo "Origin: Upstream" >> perl-${VERSION}-branch_update-x.patch
|
---|
| 78 | echo "Upstream Status: Applied" >> perl-${VERSION}-branch_update-x.patch
|
---|
| 79 | echo "Description: This is a branch update for perl-${VERSION}, and should be" >> perl-${VERSION}-branch_update-x.patch
|
---|
| 80 | echo " rechecked periodically." >> perl-${VERSION}-branch_update-x.patch
|
---|
| 81 | echo "" >> perl-${VERSION}-branch_update-x.patch
|
---|
| 82 | diff -Naur perl-${VERSION}.orig perl-${VERSION} >> perl-${VERSION}-branch_update-x.patch
|
---|
| 83 | echo "Created /usr/src/perl-${VERSION}-branch_update-x.patch."
|
---|