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