/[gentoo]/src/patchsets/gcc/make-tarball.sh
Gentoo

Contents of /src/patchsets/gcc/make-tarball.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (show annotations) (download) (as text)
Tue Jan 12 18:44:19 2016 UTC (22 months, 1 week ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.14: +1 -1 lines
File MIME type: text/x-sh
update my local git path

1 #!/bin/bash
2
3 if [[ $# -ne 1 ]] ; then
4 echo "Usage: $0 <gcc ebuild>"
5 exit 1
6 fi
7
8 ver=${1%/}
9 for ebuild in \
10 ${ver} \
11 /usr/local/src/gentoo/repo/gentoo/sys-devel/gcc/gcc-${ver}.ebuild \
12 /usr/portage/sys-devel/gcc/gcc-${ver}.ebuild \
13 ""
14 do
15 [[ -f ${ebuild} ]] && break
16 done
17 if [[ -z ${ebuild} ]] ; then
18 echo "!!! gcc ebuild '${ver}' does not exist"
19 exit 1
20 fi
21
22 digest=${ebuild/.ebuild}
23 rm -f ${digest/gcc\//gcc\/files\/digest-}
24 gver=${ebuild##*/gcc/gcc-} # trim leading path
25 gver=${gver%%.ebuild} # trim post .ebuild
26 gver=${gver%%-*} # trim any -r#'s
27
28 # trim branch update number
29 sgver=$(echo ${gver} | sed -e 's:[0-9]::g')
30 [[ ${#sgver} -gt 2 ]] \
31 && sgver=${gver%.*} \
32 || sgver=${gver}
33
34 eread() {
35 inherit(){ :;}
36 while [[ $# -gt 0 ]] ; do
37 export $1=$(source ${ebuild} 2>/dev/null; echo ${!1})
38 shift
39 done
40 }
41 eread UCLIBC_VER PP_VER HTB_VER HTB_GCC_VER MAN_VER SPECS_VER SPECS_GCC_VER
42 [[ -n ${HTB_VER} && -z ${HTB_GCC_VER} ]] && HTB_GCC_VER=${gver}
43 PATCH_VER=$(awk '{print $1; exit}' ./${gver}/gentoo/README.history)
44 PIE_VER=$(awk '{print $1; exit}' ./${gver}/pie/README.history)
45
46 if [[ ! -d ./${gver} ]] ; then
47 echo "Error: ${gver} is not a valid gcc ver"
48 exit 1
49 fi
50
51 echo "Building patches for gcc version ${gver}"
52 echo " - PATCH: ${PATCH_VER} (taken from ${gver}/gentoo/README.history)"
53 echo " - UCLIBC: ${UCLIBC_VER}"
54 echo " - PIE: ${PIE_VER} (taken from ${gver}/pie/README.history)"
55 echo " - SPECS: ${SPECS_VER} (${SPECS_GCC_VER:-${gver}})"
56 echo " - SSP: ${PP_VER}"
57 echo " - BOUNDS: ${HTB_GCC_VER}-${HTB_VER}"
58 echo " - MAN: ${MAN_VER}"
59
60 rm -rf tmp
61 rm -f gcc-${gver}-*.tar.bz2
62
63 # standard jobbies
64 mkdir -p tmp/patch/exclude tmp/uclibc tmp/piepatch tmp/specs
65 [[ -n ${PATCH_VER} ]] && cp ${gver}/gentoo/*.patch ../README* tmp/patch/
66 [[ -d ${gver}/man ]] && cp -r ${gver}/man tmp/
67 [[ -n ${UCLIBC_VER} ]] && cp -r ${gver}/uclibc/* ../README* tmp/uclibc/
68 [[ -n ${PIE_VER} ]] && cp -r ${gver}/pie/* ../README* tmp/piepatch/
69 [[ -n ${PP_VER} ]] && cp -r ${gver}/ssp tmp/
70 [[ -n ${SPECS_VER} ]] && cp -r ${SPECS_GCC_VER:-${gver}}/specs/* tmp/specs/
71 # extra cruft
72 [[ -n ${HTB_VER} ]] && \
73 cp ${gver}/misc/bounds-checking-gcc*.patch \
74 tmp/bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch
75 find tmp/ -name CVS -type d | xargs rm -rf
76
77 # standard jobbies
78 [[ -n ${PATCH_VER} ]] && {
79 tar -jcf gcc-${sgver}-patches-${PATCH_VER}.tar.bz2 \
80 -C tmp patch || exit 1 ; }
81 [[ -n ${UCLIBC_VER} ]] && {
82 tar -jcf gcc-${sgver}-uclibc-patches-${UCLIBC_VER}.tar.bz2 \
83 -C tmp uclibc || exit 1 ; }
84 [[ -n ${PIE_VER} ]] && {
85 tar -jcf gcc-${sgver}-piepatches-v${PIE_VER}.tar.bz2 \
86 -C tmp piepatch || exit 1 ; }
87 [[ -n ${SPECS_VER} ]] && {
88 tar -jcf gcc-${sgver}-specs-${SPECS_VER}.tar.bz2 \
89 -C tmp specs || exit 1 ; }
90 [[ -n ${PP_VER} ]] && {
91 mv tmp/ssp/protector.patch tmp/ssp/gcc-${gver}-ssp.patch
92 tar -jcf gcc-${gver}-ssp-${PP_VER}.tar.bz2 \
93 -C tmp ssp || exit 1 ; }
94 [[ -d ${gver}/man ]] && {
95 tar -jcf gcc-${MAN_VER}-manpages.tar.bz2 \
96 -C tmp/man . || exit 1 ; }
97 # extra cruft
98 [[ -n ${HTB_VER} ]] && {
99 bzip2 tmp/bounds-checking-*.patch \
100 && cp tmp/bounds-checking-*.patch.bz2 . || exit 1 ; }
101 rm -rf tmp
102
103 du -b *.bz2

  ViewVC Help
Powered by ViewVC 1.1.20