[06dcdf6] | 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
|
---|
[9676bac] | 11 | echo "$0 - GCC_Version"
|
---|
| 12 | echo "This will Create a Patch for GCC GCC_Version"
|
---|
| 13 | exit 255
|
---|
[06dcdf6] | 14 | fi
|
---|
| 15 |
|
---|
| 16 | # Download GCC Source
|
---|
| 17 | #
|
---|
| 18 | cd /usr/src
|
---|
| 19 | if ! [ -e gcc-${VERSION}.tar.bz2 ]; then
|
---|
[0804c00] | 20 | wget ftp://gcc.gnu.org/pub/gcc/releases/gcc-${VERSION}/gcc-${VERSION}.tar.bz2
|
---|
[06dcdf6] | 21 | fi
|
---|
| 22 |
|
---|
[c7ef534] | 23 | # Set Patch Number
|
---|
| 24 | #
|
---|
| 25 | cd /usr/src
|
---|
| 26 | wget http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/ --no-remove-listing
|
---|
| 27 | PATCH_NUM=$(cat index.html | grep gcc | grep "${VERSION}" | grep branch_update | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)
|
---|
| 28 | PATCH_NUM=$(expr ${PATCH_NUM} + 1)
|
---|
| 29 | rm -f index.html
|
---|
| 30 |
|
---|
[06dcdf6] | 31 | # Cleanup Directory
|
---|
| 32 | #
|
---|
[d8bd081] | 33 | #rm -rf gcc-${VERSION} gcc-${VERSION}.orig
|
---|
| 34 | #tar xvf gcc-${VERSION}.tar.bz2
|
---|
| 35 | #mv gcc-${VERSION} gcc-${VERSION}.orig
|
---|
[06dcdf6] | 36 | CURRENTDIR=$(pwd -P)
|
---|
| 37 |
|
---|
| 38 | # Get Current Updates from SVN
|
---|
| 39 | #
|
---|
[d8bd081] | 40 | #cd /usr/src
|
---|
| 41 | #NUM1=$(echo ${VERSION} | cut -f1 -d.)
|
---|
| 42 | #NUM2=$(echo ${VERSION} | cut -f2 -d.)
|
---|
| 43 | #FIXEDVERSION=$(echo -n "$NUM1" ; echo -n "_" ; echo -e "$NUM2")
|
---|
| 44 | #svn export svn://gcc.gnu.org/svn/gcc/branches/gcc-${FIXEDVERSION}-branch gcc-${VERSION}
|
---|
[06dcdf6] | 45 |
|
---|
[099bfc2] | 46 | # Add a custom version string
|
---|
[27e5b8e] | 47 | #
|
---|
[ead347c] | 48 | DATE_STAMP=$(cat gcc-${VERSION}/gcc/DATESTAMP)
|
---|
[f81e00b] | 49 | echo "${VERSION}" > gcc-${VERSION}/gcc/BASE-VER
|
---|
[ead347c] | 50 | sed -i "s:PKGVERSION:\"(GCC for Cross-LFS ${VERSION}.${DATE_STAMP}) \":" gcc-${VERSION}/gcc/version.c
|
---|
[099bfc2] | 51 |
|
---|
[06dcdf6] | 52 | # Cleanup
|
---|
| 53 | DIRS="gcc-${VERSION} gcc-${VERSION}.orig"
|
---|
| 54 | for DIRECTORY in ${DIRS}; do
|
---|
[9676bac] | 55 | cd ${DIRECTORY}
|
---|
[d8bd081] | 56 | REMOVE="ABOUT-NLS COPYING COPYING.LIB MAINTAINERS Makefile.def
|
---|
| 57 | Makefile.in Makefile.tpl README README.SCO BUGS FAQ LAST_UPDATED
|
---|
| 58 | MD5SUMS NEWS bugs.html faq.html gcc/BASE-VER gcc/DEV-PHASE
|
---|
| 59 | gcc/f/BUGS gcc/f/NEWS gcc/c-parse.c gcc/gengtype-lex.c gcc/c-parse.y
|
---|
| 60 | gcc/gengtype-yacc.c gcc/gengtype-yacc.h gcc/java/parse-scan.c
|
---|
| 61 | gcc/java/parse.c gcc/objc/objc-parse.c gcc/objc/objc-parse.y
|
---|
| 62 | libjava/classpath/doc/cp-tools.info"
|
---|
[9676bac] | 63 | for file in ${REMOVE}; do
|
---|
| 64 | rm -f $file
|
---|
| 65 | done
|
---|
[d8bd081] | 66 | for file in $(find . -name "ChangeLog*" | sed -e 's@./@@'); do
|
---|
| 67 | rm -f ${file}
|
---|
| 68 | done
|
---|
[9676bac] | 69 | rm -rf INSTALL
|
---|
| 70 | rm -f fastjar/*.{1,info} gcc/doc/*.{1,info,7} gcc/fortran/*.{1,info,7}
|
---|
| 71 | rm -f gcc/po/*.{gmo,po} libcpp/po/*.{gmo,po} libgomp/*.{1,info,7}
|
---|
[d8bd081] | 72 | rm -f libjava/classpath/doc/*.{1,info}
|
---|
[9676bac] | 73 | cd ..
|
---|
[06dcdf6] | 74 | done
|
---|
| 75 |
|
---|
| 76 | # Create Patch
|
---|
| 77 | #
|
---|
| 78 | cd /usr/src
|
---|
[c7ef534] | 79 | echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 80 | echo "Date: `date +%m-%d-%Y`" >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 81 | echo "Initial Package Version: ${VERSION}" >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 82 | echo "Origin: Upstream" >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 83 | echo "Upstream Status: Applied" >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 84 | echo "Description: This is a branch update for gcc-${VERSION}, and should be" >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 85 | echo " rechecked periodically." >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 86 | echo "" >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 87 | diff -Naur gcc-${VERSION}.orig gcc-${VERSION} >> gcc-${VERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 88 | echo "Created /usr/src/gcc-${VERSION}-branch_update-${PATCH_NUM}.patch."
|
---|