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 tmp
|
---|
35 | cd tmp
|
---|
36 | mv perl-${FIXEDVERSION}.x /usr/src/perl-${VERSION}
|
---|
37 |
|
---|
38 | # Cleanup
|
---|
39 | #
|
---|
40 | cd /usr/src/perl-${VERSION}
|
---|
41 | REMOVE=".patch AUTHORS Changes*"
|
---|
42 | for file in $REMOVE; do
|
---|
43 | cd /usr/src/perl-${VERSION}
|
---|
44 | rm -f ${file}
|
---|
45 | cd /usr/src/perl-${VERSION}.orig
|
---|
46 | rm -f ${file}
|
---|
47 | done
|
---|
48 | cd ..
|
---|
49 |
|
---|
50 | # Remove Directories
|
---|
51 | #
|
---|
52 | cd /usr/src/perl-${VERSION}
|
---|
53 | REMOVE="os2 vms win32"
|
---|
54 | for dir in $REMOVE; do
|
---|
55 | cd /usr/src/perl-${VERSION}
|
---|
56 | rm -rf ${dir}
|
---|
57 | cd /usr/src/perl-${VERSION}.orig
|
---|
58 | rm -rf ${dir}
|
---|
59 | done
|
---|
60 | cd ..
|
---|
61 |
|
---|
62 | # Create Patch
|
---|
63 | #
|
---|
64 | cd /usr/src
|
---|
65 | echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > perl-${VERSION}-branch_update-x.patch
|
---|
66 | echo "Date: `date +%m-%d-%Y`" >> perl-${VERSION}-branch_update-x.patch
|
---|
67 | echo "Initial Package Version: ${VERSION}" >> perl-${VERSION}-branch_update-x.patch
|
---|
68 | echo "Origin: Upstream" >> perl-${VERSION}-branch_update-x.patch
|
---|
69 | echo "Upstream Status: Applied" >> perl-${VERSION}-branch_update-x.patch
|
---|
70 | echo "Description: This is a branch update for perl-${VERSION}, and should be" >> perl-${VERSION}-branch_update-x.patch
|
---|
71 | echo " rechecked periodically." >> perl-${VERSION}-branch_update-x.patch
|
---|
72 | echo "" >> perl-${VERSION}-branch_update-x.patch
|
---|
73 | diff -Naur perl-${VERSION}.orig perl-${VERSION} >> perl-${VERSION}-branch_update-x.patch
|
---|
74 | echo "Created /usr/src/perl-${VERSION}-branch_update-x.patch."
|
---|