[06dcdf6] | 1 | #!/bin/bash |
---|
| 2 | # Create a Binutils Patch |
---|
| 3 | |
---|
| 4 | # Get Version # |
---|
| 5 | # |
---|
| 6 | VERSION=$1 |
---|
| 7 | |
---|
| 8 | # Check Input |
---|
| 9 | # |
---|
| 10 | if [ "${VERSION}" = "" ]; then |
---|
| 11 | echo "$0 - Binutils_Version" |
---|
[be71788] | 12 | echo "This will Create a Patch for Binutils Binutils_Version" |
---|
[06dcdf6] | 13 | fi |
---|
| 14 | |
---|
| 15 | # Download Binutils Source |
---|
| 16 | # |
---|
| 17 | cd /usr/src |
---|
| 18 | if ! [ -e binutils-${VERSION}.tar.bz2 ]; then |
---|
| 19 | wget ftp://ftp.gnu.org/gnu/binutils/binutils-${VERSION}.tar.bz2 |
---|
| 20 | fi |
---|
| 21 | |
---|
| 22 | # Cleanup Directory |
---|
| 23 | # |
---|
| 24 | rm -rf binutils-${VERSION} binutils-${VERSION}.orig |
---|
| 25 | tar xvf binutils-${VERSION}.tar.bz2 |
---|
| 26 | mv binutils-${VERSION} binutils-${VERSION}.orig |
---|
| 27 | CURRENTDIR=$(pwd -P) |
---|
| 28 | |
---|
| 29 | # Get Current Updates from CVS |
---|
| 30 | # |
---|
| 31 | cd /usr/src |
---|
| 32 | FIXEDVERSION=$(echo ${VERSION} | sed -e 's/\./_/g') |
---|
| 33 | cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src export -rbinutils-${FIXEDVERSION}-branch binutils |
---|
| 34 | mv src binutils-${VERSION} |
---|
| 35 | |
---|
| 36 | # Cleanup |
---|
| 37 | # |
---|
| 38 | DIRS="binutils-${VERSION} binutils-${VERSION}.orig" |
---|
| 39 | for DIRECTORY in ${DIRS}; do |
---|
| 40 | cd /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 .. |
---|
| 55 | done |
---|
| 56 | |
---|
[c0d5090] | 57 | # Cleanup Directory |
---|
| 58 | # |
---|
| 59 | for 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 |
---|
| 67 | done |
---|
[d57287f4] | 68 | cd /usr/src/binutils-${VERSION} |
---|
| 69 | rm -f *.orig *~ |
---|
[06dcdf6] | 70 | rm -f /usr/src/binutils-${VERSION}.orig/md5.sum |
---|
| 71 | |
---|
| 72 | # Make Binutils a Release |
---|
| 73 | # |
---|
| 74 | cd /usr/src/binutils-${VERSION} |
---|
| 75 | sed -i 's/# RELEASE=y/RELEASE=y/g' bfd/Makefile.am |
---|
| 76 | sed -i 's/# RELEASE=y/RELEASE=y/g' bfd/Makefile.in |
---|
| 77 | |
---|
| 78 | # Create Patch |
---|
| 79 | # |
---|
| 80 | cd /usr/src |
---|
[c94176e] | 81 | echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > binutils-${VERSION}-branch_update-x.patch |
---|
[06dcdf6] | 82 | echo "Date: `date +%m-%d-%Y`" >> binutils-${VERSION}-branch_update-x.patch |
---|
| 83 | echo "Initial Package Version: ${VERSION}" >> binutils-${VERSION}-branch_update-x.patch |
---|
| 84 | echo "Origin: Upstream" >> binutils-${VERSION}-branch_update-x.patch |
---|
| 85 | echo "Upstream Status: Applied" >> binutils-${VERSION}-branch_update-x.patch |
---|
| 86 | echo "Description: This is a branch update for binutils-${VERSION}, and should be" >> binutils-${VERSION}-branch_update-x.patch |
---|
| 87 | echo " rechecked periodically." >> binutils-${VERSION}-branch_update-x.patch |
---|
| 88 | echo "" >> binutils-${VERSION}-branch_update-x.patch |
---|
| 89 | diff -Naur binutils-${VERSION}.orig binutils-${VERSION} >> binutils-${VERSION}-branch_update-x.patch |
---|
| 90 | echo "Created /usr/src/binutils-${VERSION}-branch_update-x.patch." |
---|
| 91 | |
---|