source: scripts/patch/binutils-patch.sh@ 883964a

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

Updated Bash Branch Update Patch to -4

  • Property mode set to 100755
File size: 3.4 KB
RevLine 
[06dcdf6]1#!/bin/bash
2# Create a Binutils Patch
3
4# Get Version #
5#
6VERSION=$1
[06fb515]7SOURCEVERSION=$2
[06dcdf6]8
9# Check Input
10#
[7df856d]11if [ "${VERSION}" = "" -o "${SOURCEVERSION}" = "" ]; then
[9676bac]12 echo "$0 - Binutils_Version"
[06fb515]13 echo "This will Create a Patch for Binutils Binutils_Series Binutils_Version"
[7df856d]14 echo "Example $0 2.19 2.19.1"
[9676bac]15 exit 255
[06dcdf6]16fi
17
[06fb515]18#
[06dcdf6]19# Download Binutils Source
20#
21cd /usr/src
[06fb515]22if ! [ -e binutils-${SOURCEVERSION}.tar.bz2 ]; then
23 wget ftp://ftp.gnu.org/gnu/binutils/binutils-${SOURCEVERSION}.tar.bz2
[06dcdf6]24fi
25
[c7ef534]26# Set Patch Number
27#
28cd /usr/src
29wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing
[e6b4db2]30PATCH_NUM=$(cat index.html | grep binutils | grep "${SOURCEVERSION}" | grep branch_update | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)
[c7ef534]31PATCH_NUM=$(expr ${PATCH_NUM} + 1)
32rm -f index.html
33
[06dcdf6]34# Cleanup Directory
35#
[06fb515]36rm -rf binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig
37tar xvf binutils-${SOURCEVERSION}.tar.bz2
38mv binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig
[06dcdf6]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
[06fb515]46mv src binutils-${SOURCEVERSION}
[06dcdf6]47
48# Cleanup
49#
[06fb515]50DIRS="binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig"
[06dcdf6]51for DIRECTORY in ${DIRS}; do
[9676bac]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
[06dcdf6]60
[9676bac]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 ..
[06dcdf6]67done
[06fb515]68cd /usr/src/binutils-${SOURCEVERSION}
69rm -f /usr/src/binutils-${SOURCEVERSION}.orig/md5.sum
[06dcdf6]70
71# Make Binutils a Release
72#
[06fb515]73cd /usr/src/binutils-${SOURCEVERSION}
[06dcdf6]74sed -i 's/# RELEASE=y/RELEASE=y/g' bfd/Makefile.am
75sed -i 's/# RELEASE=y/RELEASE=y/g' bfd/Makefile.in
76
[cd317ff]77# Customize the version string, so we know it's patched
78#
79cd /usr/src/binutils-${SOURCEVERSION}
[08433c1]80DATE_STAMP=$(date +%Y%m%d)
[e6c6e3e]81cd /usr/src/binutils-${SOURCEVERSION}
[5d01446]82sed -i "s:@PKGVERSION@:(GNU Binutils for Cross-LFS) :" bfd/Makefile.in
[e6c6e3e]83sed -i "s:^[[:space:]]VERSION=\(.*\)$:VERSION=\1.${DATE_STAMP}:g" bfd/configure
[27e5b8e]84
[e6c6e3e]85# Cleanliness is the name of my game!
[27e5b8e]86#
[e6c6e3e]87unset DATE_STAMP
[cd317ff]88
[06dcdf6]89# Create Patch
90#
91cd /usr/src
[c7ef534]92echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
93echo "Date: `date +%m-%d-%Y`" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
94echo "Initial Package Version: ${SOURCEVERSION}" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
95echo "Origin: Upstream" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
96echo "Upstream Status: Applied" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
97echo "Description: This is a branch update for binutils-${SOURCEVERSION}, and should be" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
98echo " rechecked periodically." >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
99echo "" >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
100diff -Naur binutils-${SOURCEVERSION}.orig binutils-${SOURCEVERSION} >> binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
101echo "Created /usr/src/binutils-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch."
Note: See TracBrowser for help on using the repository browser.