source: scripts/patch/perl-patch.sh@ 8a51bde

Last change on this file since 8a51bde was 7ffbb9c, checked in by William Harrington <kb0iic@…>, 11 years ago

Update suffix for perl tarball.

  • Property mode set to 100755
File size: 2.3 KB
Line 
1#!/bin/bash
2# Create a Perl Patch
3
4# Get Version #
5#
6VERSION=$1
7
8# Check Input
9#
10if [ "${VERSION}" = "" ]; then
11 echo "$0 - Perl_Version"
12 echo "This will Create a Patch for Perl Perl_Version"
13 exit 255
14fi
15
16# Download Perl Source
17#
18cd /usr/src
19if ! [ -e perl-${VERSION}.tar.bz2 ]; then
20 wget http://www.cpan.org/src/perl-${VERSION}.tar.bz2
21fi
22
23# Set Patch Number
24#
25cd /usr/src
26wget http://svn.cross-lfs.org/svn/repos/patches/perl/ --no-remove-listing
27for num in $(seq 1 99); do
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)
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
37done
38rm -f index.html
39
40# Cleanup Directory
41#
42rm -rf perl-${VERSION} perl-${VERSION}.orig
43tar xvf perl-${VERSION}.tar.bz2
44mv perl-${VERSION} perl-${VERSION}.orig
45CURRENTDIR=$(pwd -P)
46
47# Get Current Updates from GIT
48#
49cd /usr/src
50mkdir perl.git
51cd perl.git
52git clone git://perl5.git.perl.org/perl.git
53
54# Cleanup
55#
56cd /usr/src/perl-${VERSION}
57REMOVE=".patch AUTHORS Changes*"
58for 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}
63done
64cd ..
65
66# Remove Directories
67#
68cd /usr/src/perl-${VERSION}
69REMOVE="os2 vms win32"
70for dir in $REMOVE; do
71 cd /usr/src/perl-${VERSION}
72 rm -rf ${dir}
73 cd /usr/src/perl-${VERSION}.orig
74 rm -rf ${dir}
75done
76cd ..
77
78# Create Patch
79#
80cd /usr/src
81echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > perl-${VERSION}-branch_update-x.patch
82echo "Date: `date +%m-%d-%Y`" >> perl-${VERSION}-branch_update-x.patch
83echo "Initial Package Version: ${VERSION}" >> perl-${VERSION}-branch_update-x.patch
84echo "Origin: Upstream" >> perl-${VERSION}-branch_update-x.patch
85echo "Upstream Status: Applied" >> perl-${VERSION}-branch_update-x.patch
86echo "Description: This is a branch update for perl-${VERSION}, and should be" >> perl-${VERSION}-branch_update-x.patch
87echo " rechecked periodically." >> perl-${VERSION}-branch_update-x.patch
88echo "" >> perl-${VERSION}-branch_update-x.patch
89diff -Naur perl-${VERSION}.orig perl-${VERSION} >> perl-${VERSION}-branch_update-x.patch
90echo "Created /usr/src/perl-${VERSION}-branch_update-x.patch."
Note: See TracBrowser for help on using the repository browser.