source: scripts/patch/gcc-patch.sh @ 9408eb8c

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since 9408eb8c was 9408eb8c, checked in by Jim Gifford <clfs@…>, 15 years ago

Finally Fixed Branding of GCC

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