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
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
26# Cleanup Directory
27#
[06fb515]28rm -rf binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig
29tar xvf binutils-${SOURCEVERSION}.tar.bz2
30mv binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig
[06dcdf6]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
[06fb515]38mv src binutils-${SOURCEVERSION}
[06dcdf6]39
40# Cleanup
41#
[06fb515]42DIRS="binutils-${SOURCEVERSION} binutils-${SOURCEVERSION}.orig"
[06dcdf6]43for DIRECTORY in ${DIRS}; do
[9676bac]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
[06dcdf6]52
[9676bac]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 ..
[06dcdf6]59done
[06fb515]60cd /usr/src/binutils-${SOURCEVERSION}
61rm -f /usr/src/binutils-${SOURCEVERSION}.orig/md5.sum
[06dcdf6]62
63# Make Binutils a Release
64#
[06fb515]65cd /usr/src/binutils-${SOURCEVERSION}
[06dcdf6]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
[06fb515]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.