Annotation of /trunk/pkgtools/regen_mage_tree_rsync-alx.sh
Parent Directory | Revision Log
Revision 610 -
(hide annotations)
(download)
(as text)
Sun Nov 11 23:40:52 2007 UTC (16 years, 10 months ago) by niro
File MIME type: application/x-sh
File size: 3654 byte(s)
Sun Nov 11 23:40:52 2007 UTC (16 years, 10 months ago) by niro
File MIME type: application/x-sh
File size: 3654 byte(s)
-added some pkgtools
1 | niro | 610 | #!/bin/bash |
2 | |||
3 | minclude() { | ||
4 | echo "error: minclude found in ${PKGNAME}" | ||
5 | } | ||
6 | |||
7 | export -f minclude | ||
8 | |||
9 | MY_CVS_REPO="/var/www/magellan/alx-dev" | ||
10 | MY_CVS_DEST="${MY_CVS_REPO}/rsync" | ||
11 | MY_CVS_MODULES="mage smage" | ||
12 | MAGE_CVS_MODULE="magellan-src/mage" | ||
13 | MY_CVS_OPTS="" | ||
14 | MY_CVS_ROOT=":pserver:anonymous:@62.141.57.200:/alx-cvs" | ||
15 | MAGE_CVS_ROOT=":pserver:anonymous:@62.141.57.200:/magellan-cvs" | ||
16 | MY_CVS_REMOVE_MAGE_SOURCES=true | ||
17 | MY_TARBALL_VERSION_TAG="$(date +%Y%m%d-%k%M)" | ||
18 | |||
19 | MY_CVS_ARCHES="i486" | ||
20 | MY_CVS_DISTRIBUTIONS="stable testing unstable" | ||
21 | |||
22 | # like mage.rc; needed only for smage2 | ||
23 | export ARCH=i486 | ||
24 | export PKGDIR="${MY_CVS_REPO}/unstable/packages/${ARCH}" | ||
25 | export SMAGESCRIPTSDIR="${MY_CVS_DEST}/smage" | ||
26 | export MAGE_TREE_DEST="${MY_CVS_DEST}/mage" | ||
27 | export REGEN_MAGE_TREE=true | ||
28 | |||
29 | |||
30 | [ ! -d "${MY_CVS_DEST}" ] && install -d ${MY_CVS_DEST} | ||
31 | |||
32 | # get rid of old cruft (fixes some rsync issues) | ||
33 | rm -rf ${MY_CVS_DEST}/* | ||
34 | |||
35 | # get mage | ||
36 | export CVSROOT="${MAGE_CVS_ROOT}" | ||
37 | cvs login | ||
38 | if [ ! -d ${MY_CVS_DEST}/${MAGE_CVS_MODULE}/CVS ] | ||
39 | then | ||
40 | (cd ${MY_CVS_DEST}; cvs -z3 checkout -P ${MY_CVS_OPTS} ${MAGE_CVS_MODULE}) | ||
41 | else | ||
42 | (cd ${MY_CVS_DEST}; cvs -z3 update -d -P ${MY_CVS_OPTS} ${MAGE_CVS_MODULE}) | ||
43 | # needed to fetch new directories --^ | ||
44 | # needed to kill old directories ------^ | ||
45 | fi | ||
46 | |||
47 | |||
48 | # cvs login | ||
49 | export CVSROOT="${MY_CVS_ROOT}" | ||
50 | cvs login | ||
51 | |||
52 | # get all our modules or update them | ||
53 | for module in ${MY_CVS_MODULES} | ||
54 | do | ||
55 | if [ ! -d ${MY_CVS_DEST}/${module}/CVS ] | ||
56 | then | ||
57 | (cd ${MY_CVS_DEST}; cvs -z3 checkout -P ${MY_CVS_OPTS} ${module}) | ||
58 | else | ||
59 | (cd ${MY_CVS_DEST}; cvs -z3 update -d -P ${MY_CVS_OPTS} ${module}) | ||
60 | # needed to fetch new directories --^ | ||
61 | # needed to kill old directories ------^ | ||
62 | fi | ||
63 | done | ||
64 | |||
65 | # delete CVS directories | ||
66 | # i don't get the problem why this not work | ||
67 | #find ${MY_CVS_DEST} -name CVS -type d -exec rm -rf '{}' ';' | ||
68 | # so i use this now: | ||
69 | for file in $(find ${MY_CVS_DEST} -type d -name CVS) | ||
70 | do | ||
71 | rm -rf ${file} | ||
72 | done | ||
73 | |||
74 | #correct permissions | ||
75 | find ${MY_CVS_DEST} -type f -exec chmod 0644 '{}' ';' | ||
76 | find ${MY_CVS_DEST} -type d -exec chmod 0755 '{}' ';' | ||
77 | |||
78 | # now regen mage tree | ||
79 | |||
80 | if [ -f ${MY_CVS_DEST}/smage/.regenignore ] | ||
81 | then | ||
82 | export EXCLUDED="$(< ${MY_CVS_DEST}/smage/.regenignore )" | ||
83 | fi | ||
84 | |||
85 | if [[ -n ${EXCLUDED} ]] | ||
86 | then | ||
87 | for i in ${EXCLUDED} | ||
88 | do | ||
89 | if [ -e "${MY_CVS_DEST}/smage/${i}" ] | ||
90 | then | ||
91 | rm -rf "${MY_CVS_DEST}/smage/${i}" | ||
92 | fi | ||
93 | done | ||
94 | fi | ||
95 | |||
96 | # exec permissions | ||
97 | chmod a+x ${MY_CVS_DEST}/magellan-src/mage/usr/lib/mage/smage2.sh | ||
98 | |||
99 | # shut up some warnings | ||
100 | [ ! -f /etc/mage.rc ] && touch /etc/mage.rc | ||
101 | [ ! -f /usr/lib/mage/version ] && { install -d /usr/lib/mage; touch /usr/lib/mage/version; } | ||
102 | |||
103 | for dist in ${MY_CVS_DISTRIBUTIONS} | ||
104 | do | ||
105 | for arch in ${MY_CVS_ARCHES} | ||
106 | do | ||
107 | export ARCH="${arch}" | ||
108 | #export PKGDIR="$(dirname ${PKGDIR})/${ARCH}" | ||
109 | export PKGDIR="${MY_CVS_REPO}/${dist}/packages/${ARCH}" | ||
110 | |||
111 | for i in $(find ${MY_CVS_DEST}/smage -type f -name "*.smage2" | sort) | ||
112 | do | ||
113 | ${MY_CVS_DEST}/magellan-src/mage/usr/lib/mage/smage2.sh only-regen-tree "${i}" | ||
114 | done | ||
115 | done | ||
116 | done | ||
117 | |||
118 | |||
119 | # create tarballs | ||
120 | pushd ${MY_CVS_DEST} | ||
121 | for module in ${MY_CVS_MODULES} | ||
122 | do | ||
123 | tar cvjf ${module}-"${MY_TARBALL_VERSION_TAG}".tar.bz2 ./${module} | ||
124 | done | ||
125 | popd | ||
126 | |||
127 | # remove mage sources | ||
128 | if [[ ${MY_CVS_REMOVE_MAGE_SOURCES} = true ]] | ||
129 | then | ||
130 | [ -d ${MY_CVS_DEST}/magellan-src ] && rm -rf ${MY_CVS_DEST}/magellan-src | ||
131 | [ -d ${MY_CVS_DEST}/magellan-src-"${MY_TARBALL_VERSION_TAG}".tar.bz2 ] && | ||
132 | rm -rf ${MY_CVS_DEST}/magellan-src-"${MY_TARBALL_VERSION_TAG}".tar.bz2 | ||
133 | fi | ||
134 | |||
135 | |||
136 | # move tarballs to a proper location | ||
137 | install -d ${MY_CVS_DEST}/tarballs | ||
138 | for module in ${MY_CVS_MODULES} | ||
139 | do | ||
140 | [ -f ${MY_CVS_DEST}/${module}-"${MY_TARBALL_VERSION_TAG}".tar.bz2 ] && | ||
141 | mv ${MY_CVS_DEST}/${module}-"${MY_TARBALL_VERSION_TAG}".tar.bz2 ${MY_CVS_DEST}/tarballs | ||
142 | done | ||
143 |
Properties
Name | Value |
---|---|
svn:executable | * |