source: scripts/patch/binutils-patch.sh@ 7e3b152

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 7e3b152 was c7ef534, checked in by Jim Gifford <clfs@…>, 16 years ago

Figure out what the last patch # is and grab the next #

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