source: scripts/patch/binutils-patch.sh@ 3faa5de

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 3faa5de was 9676bac, checked in by Jim Gifford <clfs@…>, 16 years ago

Added Perl Patch and cleaned up

  • Property mode set to 100755
File size: 2.6 KB
Line 
1#!/bin/bash
2# Create a Binutils Patch
3
4# Get Version #
5#
6VERSION=$1
7
8# Check Input
9#
10if [ "${VERSION}" = "" ]; then
11 echo "$0 - Binutils_Version"
12 echo "This will Create a Patch for Binutils Binutils_Version"
13 exit 255
14fi
15
16# Download Binutils Source
17#
18cd /usr/src
19if ! [ -e binutils-${VERSION}.tar.bz2 ]; then
20 wget ftp://ftp.gnu.org/gnu/binutils/binutils-${VERSION}.tar.bz2
21fi
22
23# Cleanup Directory
24#
25rm -rf binutils-${VERSION} binutils-${VERSION}.orig
26tar xvf binutils-${VERSION}.tar.bz2
27mv binutils-${VERSION} binutils-${VERSION}.orig
28CURRENTDIR=$(pwd -P)
29
30# Get Current Updates from CVS
31#
32cd /usr/src
33FIXEDVERSION=$(echo ${VERSION} | sed -e 's/\./_/g')
34cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src export -rbinutils-${FIXEDVERSION}-branch binutils
35mv src binutils-${VERSION}
36
37# Cleanup
38#
39DIRS="binutils-${VERSION} binutils-${VERSION}.orig"
40for DIRECTORY in ${DIRS}; do
41 cd /usr/src/${DIRECTORY}
42 FILE_LIST=".cvsignore *.gmo"
43 for files in ${FILE_LIST}; do
44 REMOVE=$(find * -name ${files})
45 for file in $REMOVE; do
46 rm -f ${file}
47 done
48 done
49
50 REMOVE=".cvsignore MAINTAINERS COPYING.LIBGLOSS COPYING.NEWLIB README-maintainer-mode depcomp
51 ChangeLog compile ltgcc.m4 lt~obsolete.m4 etc/ChangeLog etc/add-log.el etc/add-log.vi"
52 for file in $REMOVE; do
53 rm -f ${file}
54 done
55 cd ..
56done
57
58# Cleanup Directory
59#
60for dir in $(find * -type d); do
61 cd /usr/src/binutils-${VERSION}
62 for file in $(find . -name '*~'); do
63 rm -f ${file}
64 done
65 for file in $(find . -name '*.orig'); do
66 rm -f ${file}
67 done
68done
69cd /usr/src/binutils-${VERSION}
70rm -f *~ *.orig
71rm -f /usr/src/binutils-${VERSION}.orig/md5.sum
72
73# Make Binutils a Release
74#
75cd /usr/src/binutils-${VERSION}
76sed -i 's/# RELEASE=y/RELEASE=y/g' bfd/Makefile.am
77sed -i 's/# RELEASE=y/RELEASE=y/g' bfd/Makefile.in
78
79# Create Patch
80#
81cd /usr/src
82echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > binutils-${VERSION}-branch_update-x.patch
83echo "Date: `date +%m-%d-%Y`" >> binutils-${VERSION}-branch_update-x.patch
84echo "Initial Package Version: ${VERSION}" >> binutils-${VERSION}-branch_update-x.patch
85echo "Origin: Upstream" >> binutils-${VERSION}-branch_update-x.patch
86echo "Upstream Status: Applied" >> binutils-${VERSION}-branch_update-x.patch
87echo "Description: This is a branch update for binutils-${VERSION}, and should be" >> binutils-${VERSION}-branch_update-x.patch
88echo " rechecked periodically." >> binutils-${VERSION}-branch_update-x.patch
89echo "" >> binutils-${VERSION}-branch_update-x.patch
90diff -Naur binutils-${VERSION}.orig binutils-${VERSION} >> binutils-${VERSION}-branch_update-x.patch
91echo "Created /usr/src/binutils-${VERSION}-branch_update-x.patch."
Note: See TracBrowser for help on using the repository browser.