source: scripts/patch/perl-patch.sh @ 9676bac

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since 9676bac was 9676bac, checked in by Jim Gifford <clfs@…>, 15 years ago

Added Perl Patch and cleaned up

  • Property mode set to 100755
File size: 2.1 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.gz  ]; then
20  wget http://www.cpan.org/src/perl-${VERSION}.tar.gz
21fi
22
23# Cleanup Directory
24#
25rm -rf perl-${VERSION} perl-${VERSION}.orig
26tar xvf perl-${VERSION}.tar.gz
27mv perl-${VERSION} perl-${VERSION}.orig
28CURRENTDIR=$(pwd -P)
29
30# Get Current Updates from CVS
31#
32cd /usr/src
33FIXEDVERSION=$(echo ${VERSION} | sed -e 's ..$  ')
34rsync -avz rsync://perl5.git.perl.org/APC/perl-${FIXEDVERSION}.x perl-${VERSION}
35
36# Cleanup
37#
38DIRS="perl-${VERSION} perl-${VERSION}.orig"
39for 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 ..
54done
55
56# Cleanup Directory
57#
58for 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
66done
67cd /usr/src/perl-${VERSION}
68rm -f *~ *.orig
69rm -f /usr/src/perl-${VERSION}.orig/md5.sum
70
71# Create Patch
72#
73cd /usr/src
74echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > perl-${VERSION}-branch_update-x.patch
75echo "Date: `date +%m-%d-%Y`" >> perl-${VERSION}-branch_update-x.patch
76echo "Initial Package Version: ${VERSION}" >> perl-${VERSION}-branch_update-x.patch
77echo "Origin: Upstream" >> perl-${VERSION}-branch_update-x.patch
78echo "Upstream Status: Applied" >> perl-${VERSION}-branch_update-x.patch
79echo "Description: This is a branch update for perl-${VERSION}, and should be" >> perl-${VERSION}-branch_update-x.patch
80echo "             rechecked periodically." >> perl-${VERSION}-branch_update-x.patch
81echo "" >> perl-${VERSION}-branch_update-x.patch
82diff -Naur perl-${VERSION}.orig perl-${VERSION} >> perl-${VERSION}-branch_update-x.patch
83echo "Created /usr/src/perl-${VERSION}-branch_update-x.patch."
Note: See TracBrowser for help on using the repository browser.