[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 |
|
---|
[7f4caf0] | 23 | # Set Patch Number
|
---|
| 24 | #
|
---|
| 25 | cd /usr/src
|
---|
[29f6db3] | 26 | wget http://svn.cross-lfs.org/svn/repos/patches/perl/ --no-remove-listing
|
---|
| 27 | for num in $(seq 1 99); do
|
---|
[4648865] | 28 | PATCH_NUM=$(cat index.html | grep "${VERSION}" | grep branch_update-${num}.patch | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)
|
---|
[29f6db3] | 29 | if [ "${PATCH_NUM}" = "0" -a "${num}" = "1" ]; then
|
---|
| 30 | PATCH_NUM=$(expr ${PATCH_NUM} + 1)
|
---|
| 31 | break
|
---|
| 32 | fi
|
---|
| 33 | if [ "${PATCH_NUM}" != "${num}" ]; then
|
---|
| 34 | PATCH_NUM=$(expr ${num})
|
---|
| 35 | break
|
---|
| 36 | fi
|
---|
| 37 | done
|
---|
[7f4caf0] | 38 | rm -f index.html
|
---|
| 39 |
|
---|
[9676bac] | 40 | # Cleanup Directory
|
---|
| 41 | #
|
---|
| 42 | rm -rf perl-${VERSION} perl-${VERSION}.orig
|
---|
| 43 | tar xvf perl-${VERSION}.tar.gz
|
---|
| 44 | mv perl-${VERSION} perl-${VERSION}.orig
|
---|
| 45 | CURRENTDIR=$(pwd -P)
|
---|
| 46 |
|
---|
[7f4caf0] | 47 | # Get Current Updates from GIT
|
---|
[9676bac] | 48 | #
|
---|
| 49 | cd /usr/src
|
---|
[7f4caf0] | 50 | mkdir perl.git
|
---|
| 51 | cd perl.git
|
---|
| 52 | git clone git://perl5.git.perl.org/perl.git
|
---|
[9676bac] | 53 |
|
---|
| 54 | # Cleanup
|
---|
| 55 | #
|
---|
[550b73d] | 56 | cd /usr/src/perl-${VERSION}
|
---|
| 57 | REMOVE=".patch AUTHORS Changes*"
|
---|
| 58 | for file in $REMOVE; do
|
---|
| 59 | cd /usr/src/perl-${VERSION}
|
---|
| 60 | rm -f ${file}
|
---|
| 61 | cd /usr/src/perl-${VERSION}.orig
|
---|
| 62 | rm -f ${file}
|
---|
[9676bac] | 63 | done
|
---|
[550b73d] | 64 | cd ..
|
---|
[9676bac] | 65 |
|
---|
[550b73d] | 66 | # Remove Directories
|
---|
[9676bac] | 67 | #
|
---|
[550b73d] | 68 | cd /usr/src/perl-${VERSION}
|
---|
| 69 | REMOVE="os2 vms win32"
|
---|
| 70 | for dir in $REMOVE; do
|
---|
[9676bac] | 71 | cd /usr/src/perl-${VERSION}
|
---|
[550b73d] | 72 | rm -rf ${dir}
|
---|
| 73 | cd /usr/src/perl-${VERSION}.orig
|
---|
| 74 | rm -rf ${dir}
|
---|
[9676bac] | 75 | done
|
---|
[550b73d] | 76 | cd ..
|
---|
[9676bac] | 77 |
|
---|
| 78 | # Create Patch
|
---|
| 79 | #
|
---|
| 80 | cd /usr/src
|
---|
| 81 | echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > perl-${VERSION}-branch_update-x.patch
|
---|
| 82 | echo "Date: `date +%m-%d-%Y`" >> perl-${VERSION}-branch_update-x.patch
|
---|
| 83 | echo "Initial Package Version: ${VERSION}" >> perl-${VERSION}-branch_update-x.patch
|
---|
| 84 | echo "Origin: Upstream" >> perl-${VERSION}-branch_update-x.patch
|
---|
| 85 | echo "Upstream Status: Applied" >> perl-${VERSION}-branch_update-x.patch
|
---|
| 86 | echo "Description: This is a branch update for perl-${VERSION}, and should be" >> perl-${VERSION}-branch_update-x.patch
|
---|
| 87 | echo " rechecked periodically." >> perl-${VERSION}-branch_update-x.patch
|
---|
| 88 | echo "" >> perl-${VERSION}-branch_update-x.patch
|
---|
| 89 | diff -Naur perl-${VERSION}.orig perl-${VERSION} >> perl-${VERSION}-branch_update-x.patch
|
---|
| 90 | echo "Created /usr/src/perl-${VERSION}-branch_update-x.patch."
|
---|