Contents of /trunk/pkgtools/rebuild-everything.sh
Parent Directory | Revision Log
Revision 2017 -
(show annotations)
(download)
(as text)
Thu Jan 3 10:02:24 2013 UTC (11 years, 5 months ago) by niro
File MIME type: application/x-sh
File size: 1992 byte(s)
Thu Jan 3 10:02:24 2013 UTC (11 years, 5 months ago) by niro
File MIME type: application/x-sh
File size: 1992 byte(s)
-added more scripts
1 | #!/bin/bash |
2 | |
3 | source /etc/mage.rc.global |
4 | source /etc/mage.rc |
5 | |
6 | die() { echo "Error: $@"; exit 1; } |
7 | |
8 | CURRENT_TIME="$(date +%Y%m%d-%H%M)" |
9 | |
10 | add2mage() |
11 | { |
12 | echo "$@" >> ${MAGEFILE} || die "adding '$@' to ${MAGEFILE}" |
13 | } |
14 | |
15 | generate_fake_everything() |
16 | { |
17 | local DEPEND |
18 | local MAGEFILE="${MAGEDIR}/fake/everything/everything-1-r1.mage" |
19 | local i |
20 | |
21 | if [[ ! -d ${MAGEDIR}/fake/everything ]] |
22 | then |
23 | install -dv ${MAGEDIR}/fake/everything || die |
24 | fi |
25 | |
26 | # create an empty file |
27 | :> ${MAGEFILE} || die |
28 | |
29 | add2mage 'PKGNAME="everything-1-${ARCH}-r1"' |
30 | add2mage 'STATE="unstable"' |
31 | |
32 | add2mage 'DESCRIPTION="fake everythin"' |
33 | add2mage 'HOMEPAGE="http://www.magellan-linux.net/"' |
34 | |
35 | add2mage 'PKGTYPE="virtual"' |
36 | add2mage 'MAGE_TARGETS=""' |
37 | |
38 | add2mage 'SPLIT_PACKAGE_BASE=""' |
39 | |
40 | pushd ${MAGEDIR} |
41 | for i in */* |
42 | do |
43 | case ${i} in |
44 | fake/*) continue ;; |
45 | profiles/*) continue ;; |
46 | include/*) continue ;; |
47 | *) |
48 | DEPEND="${DEPEND} |
49 | >= ${i}-1" |
50 | ;; |
51 | esac |
52 | done |
53 | popd |
54 | |
55 | #echo "DEPEND='${DEPEND}'" |
56 | |
57 | add2mage "DEPEND=\"${DEPEND}\"" |
58 | } |
59 | |
60 | |
61 | if [[ -d ${INSTALLDB} ]] |
62 | then |
63 | echo "Backing up database to ${INSTALLDB}-${CURRENT_TIME} ..." |
64 | mv "${INSTALLDB}" "${INSTALLDB}"-"${CURRENT_TIME}" || die |
65 | install -d ${INSTALLDB} || die |
66 | fi |
67 | |
68 | if [[ -d ${MAGEDIR} ]] |
69 | then |
70 | echo "Backing up database to ${MAGEDIR}-${CURRENT_TIME} ..." |
71 | mv "${MAGEDIR}" "${MAGEDIR}"-"${CURRENT_TIME}" || die |
72 | install -d ${MAGEDIR} || die |
73 | |
74 | # get includes and profiles |
75 | rsync --recursive ${RSYNC}/include ${MAGEDIR} || die "rsync includes from '${RSYNC}'" |
76 | rsync --recursive ${RSYNC}/profiles ${MAGEDIR} || die "rsync profiles from '${RSYNC}'" |
77 | fi |
78 | |
79 | # regen mage-tre |
80 | mage regen-mage-tree |
81 | |
82 | # generate fake pkg |
83 | generate_fake_everything |
84 | |
85 | # pretend everything |
86 | mage srcpretend everything |
87 | |
88 | if [[ ${REALLY_BUILD_ME} = 1 ]] |
89 | then |
90 | # install everything |
91 | mage srcinstall everything |
92 | |
93 | # last but not least, uninstall the fake package |
94 | mage uninstall everything |
95 | fi |
96 | |
97 | echo "Everything done!" |
98 | [[ ${REALLY_BUILD_ME} = 1 ]] && echo "All packages can be found in '${PKGDIR}'" |
99 | echo |
Properties
Name | Value |
---|---|
svn:executable | * |