source: scripts/patch/binutils-patch.sh@ 0f6ac75

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 0f6ac75 was 2803d79, checked in by Jim Gifford <clfs@…>, 16 years ago

Fixes to Patch Creaters

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