source: scripts/patch/perl-patch.sh@ f59c2ec

Last change on this file since f59c2ec was 4648865, checked in by Jim Gifford <clfs@…>, 15 years ago

Really fix the patch scripts.

  • Property mode set to 100755
File size: 2.3 KB
RevLine 
[9676bac]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.gz ]; then
20 wget http://www.cpan.org/src/perl-${VERSION}.tar.gz
21fi
22
[7f4caf0]23# Set Patch Number
24#
25cd /usr/src
[29f6db3]26wget http://svn.cross-lfs.org/svn/repos/patches/perl/ --no-remove-listing
27for 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
37done
[7f4caf0]38rm -f index.html
39
[9676bac]40# Cleanup Directory
41#
42rm -rf perl-${VERSION} perl-${VERSION}.orig
43tar xvf perl-${VERSION}.tar.gz
44mv perl-${VERSION} perl-${VERSION}.orig
45CURRENTDIR=$(pwd -P)
46
[7f4caf0]47# Get Current Updates from GIT
[9676bac]48#
49cd /usr/src
[7f4caf0]50mkdir perl.git
51cd perl.git
52git clone git://perl5.git.perl.org/perl.git
[9676bac]53
54# Cleanup
55#
[550b73d]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}
[9676bac]63done
[550b73d]64cd ..
[9676bac]65
[550b73d]66# Remove Directories
[9676bac]67#
[550b73d]68cd /usr/src/perl-${VERSION}
69REMOVE="os2 vms win32"
70for 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]75done
[550b73d]76cd ..
[9676bac]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.