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