source: scripts/patch/binutils-patch.sh@ 33917e8

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

Updated to Binutils Patch Creater

  • 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
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# Cleanup Directory
27#
28rm -rf binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig
29tar xvf binutils-${SOURCEVERSION}.tar.bz2
30mv binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig
31CURRENTDIR=$(pwd -P)
32
33# Get Current Updates from CVS
34#
35cd /usr/src
36FIXEDVERSION=$(echo ${VERSION} | sed -e 's/\./_/g')
37cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src export -rbinutils-${FIXEDVERSION}-branch binutils
38mv src binutils-${SOURCEVERSION}
39
40# Cleanup
41#
42DIRS="binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig"
43for DIRECTORY in ${DIRS}; do
44 cd /usr/src/${DIRECTORY}
45 FILE_LIST=".cvsignore *.gmo"
46 for files in ${FILE_LIST}; do
47 REMOVE=$(find * -name ${files})
48 for file in $REMOVE; do
49 rm -f ${file}
50 done
51 done
52
53 REMOVE=".cvsignore MAINTAINERS COPYING.LIBGLOSS COPYING.NEWLIB README-maintainer-mode depcomp
54 ChangeLog compile ltgcc.m4 lt~obsolete.m4 etc/ChangeLog etc/add-log.el etc/add-log.vi"
55 for file in $REMOVE; do
56 rm -f ${file}
57 done
58 cd ..
59done
60cd /usr/src/binutils-${SOURCEVERSION}
61rm -f /usr/src/binutils-${SOURCEVERSION}.orig/md5.sum
62
63# Make Binutils a Release
64#
65cd /usr/src/binutils-${SOURCEVERSION}
66sed -i 's/# RELEASE=y/RELEASE=y/g' bfd/Makefile.am
67sed -i 's/# RELEASE=y/RELEASE=y/g' bfd/Makefile.in
68
69# Create Patch
70#
71cd /usr/src
72echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > binutils-${SOURCEVERSION}-branch_update-x.patch
73echo "Date: `date +%m-%d-%Y`" >> binutils-${SOURCEVERSION}-branch_update-x.patch
74echo "Initial Package Version: ${SOURCEVERSION}" >> binutils-${SOURCEVERSION}-branch_update-x.patch
75echo "Origin: Upstream" >> binutils-${SOURCEVERSION}-branch_update-x.patch
76echo "Upstream Status: Applied" >> binutils-${SOURCEVERSION}-branch_update-x.patch
77echo "Description: This is a branch update for binutils-${SOURCEVERSION}, and should be" >> binutils-${SOURCEVERSION}-branch_update-x.patch
78echo " rechecked periodically." >> binutils-${SOURCEVERSION}-branch_update-x.patch
79echo "" >> binutils-${SOURCEVERSION}-branch_update-x.patch
80diff -Naur binutils-${SOURCEVERSION}.orig binutils-${SOURCEVERSION} >> binutils-${SOURCEVERSION}-branch_update-x.patch
81echo "Created /usr/src/binutils-${SOURCEVERSION}-branch_update-x.patch."
Note: See TracBrowser for help on using the repository browser.