1 | #!/bin/bash
|
---|
2 | # Create a GCC Patch
|
---|
3 |
|
---|
4 | # Get Version #
|
---|
5 | #
|
---|
6 | VERSION=$1
|
---|
7 |
|
---|
8 | # Check Input
|
---|
9 | #
|
---|
10 | if [ "${VERSION}" = "" ]; then
|
---|
11 | echo "$0 - GCC_Version"
|
---|
12 | echo "This will Create a Patch for GCC GCC_Version"
|
---|
13 | exit 255
|
---|
14 | fi
|
---|
15 |
|
---|
16 | # Download GCC Source
|
---|
17 | #
|
---|
18 | cd /usr/src
|
---|
19 | if ! [ -e gcc-${VERSION}.tar.bz2 ]; then
|
---|
20 | wget ftp://ftp.gnu.org/gnu/gcc/gcc-${VERSION}/gcc-${VERSION}.tar.bz2
|
---|
21 | fi
|
---|
22 |
|
---|
23 | # Cleanup Directory
|
---|
24 | #
|
---|
25 | rm -rf gcc-${VERSION} gcc-${VERSION}.orig
|
---|
26 | tar xvf gcc-${VERSION}.tar.bz2
|
---|
27 | mv gcc-${VERSION} gcc-${VERSION}.orig
|
---|
28 | CURRENTDIR=$(pwd -P)
|
---|
29 |
|
---|
30 | # Get Current Updates from SVN
|
---|
31 | #
|
---|
32 | cd /usr/src
|
---|
33 | NUM1=$(echo ${VERSION} | cut -f1 -d.)
|
---|
34 | NUM2=$(echo ${VERSION} | cut -f2 -d.)
|
---|
35 | FIXEDVERSION=$(echo -n "$NUM1" ; echo -n "_" ; echo -e "$NUM2")
|
---|
36 | svn export svn://gcc.gnu.org/svn/gcc/branches/gcc-${FIXEDVERSION}-branch gcc-${VERSION}
|
---|
37 |
|
---|
38 | # Cleanup
|
---|
39 | DIRS="gcc-${VERSION} gcc-${VERSION}.orig"
|
---|
40 | for DIRECTORY in ${DIRS}; do
|
---|
41 | cd ${DIRECTORY}
|
---|
42 | REMOVE="ABOUT-NLS COPYING COPYING.LIB ChangeLog ChangeLog.tree-ssa MAINTAINERS Makefile.def
|
---|
43 | Makefile.in Makefile.tpl README README.SCO boehm-gc/ChangeLog BUGS FAQ LAST_UPDATED
|
---|
44 | MD5SUMS NEWS bugs.html faq.html gcc/BASE-VER gcc/DATESTAMP gcc/DEV-PHASE gcc/c-parse.c
|
---|
45 | gcc/gengtype-lex.c gcc/c-parse.y gcc/gengtype-yacc.c gcc/gengtype-yacc.h gcc/f/BUGS gcc/f/NEWS
|
---|
46 | gcc/java/parse-scan.c gcc/java/parse.c gcc/objc/objc-parse.c gcc/objc/objc-parse.y"
|
---|
47 | for file in ${REMOVE}; do
|
---|
48 | rm -f $file
|
---|
49 | done
|
---|
50 | rm -rf INSTALL
|
---|
51 | rm -f fastjar/*.{1,info} gcc/doc/*.{1,info,7} gcc/fortran/*.{1,info,7}
|
---|
52 | rm -f gcc/po/*.{gmo,po} libcpp/po/*.{gmo,po} libgomp/*.{1,info,7}
|
---|
53 | cd ..
|
---|
54 | done
|
---|
55 |
|
---|
56 | # Create Patch
|
---|
57 | #
|
---|
58 | cd /usr/src
|
---|
59 | echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > gcc-${VERSION}-branch_update-x.patch
|
---|
60 | echo "Date: `date +%m-%d-%Y`" >> gcc-${VERSION}-branch_update-x.patch
|
---|
61 | echo "Initial Package Version: ${VERSION}" >> gcc-${VERSION}-branch_update-x.patch
|
---|
62 | echo "Origin: Upstream" >> gcc-${VERSION}-branch_update-x.patch
|
---|
63 | echo "Upstream Status: Applied" >> gcc-${VERSION}-branch_update-x.patch
|
---|
64 | echo "Description: This is a branch update for gcc-${VERSION}, and should be" >> gcc-${VERSION}-branch_update-x.patch
|
---|
65 | echo " rechecked periodically." >> gcc-${VERSION}-branch_update-x.patch
|
---|
66 | echo "" >> gcc-${VERSION}-branch_update-x.patch
|
---|
67 | diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> gcc-${VERSION}-branch_update-x.patch
|
---|
68 | echo "Created /usr/src/gcc-${VERSION}-branch_update-x.patch."
|
---|