Annotation of /trunk/pkgtools/regen_mage_tree_rsync-NEXT-unstable-only.sh
Parent Directory | Revision Log
Revision 2017 -
(hide 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: 4488 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: 4488 byte(s)
-added more scripts
1 | niro | 2017 | #!/bin/bash |
2 | |||
3 | minclude() | ||
4 | { | ||
5 | echo "error: minclude found in ${PKGNAME}" | ||
6 | } | ||
7 | |||
8 | export -f minclude | ||
9 | |||
10 | MY_SVN_REPO="/var/www/htdocs/magellan/magellan-dev/NEXT" | ||
11 | MY_SVN_DEST="${MY_SVN_REPO}/rsync" | ||
12 | MY_SVN_MODULES="mage/branches/magellan-next smage/branches/magellan-next magellan-source/trunk/mage" | ||
13 | MY_SVN_OPTS="" | ||
14 | MY_SVN_ROOT="svn://cvs.magellan-linux.de" | ||
15 | MY_SVN_REMOVE_MAGE_SOURCES=true | ||
16 | MY_TARBALL_VERSION_TAG="$(date +%Y%m%d-%k%M | sed 's:\ :0:')" | ||
17 | |||
18 | #MY_SVN_ARCHES="i686 x86_64" | ||
19 | MY_SVN_ARCHES="x86_64" | ||
20 | # unstable supports all distributions | ||
21 | MY_SVN_DISTRIBUTION="unstable" | ||
22 | |||
23 | # like mage.rc; needed only for smage2 | ||
24 | export ARCH=i686 | ||
25 | export PKGDIR="${MY_SVN_REPO}/unstable/packages/${ARCH}" | ||
26 | export SMAGESCRIPTSDIR="${MY_SVN_DEST}/smage" | ||
27 | export MAGE_TREE_DEST="${MY_SVN_DEST}/mage" | ||
28 | export MLIBDIR="${MY_SVN_DEST}/mage-src/usr/lib/mage" | ||
29 | # support both | ||
30 | export REGEN_MAGE_TREE=true | ||
31 | export MAGE_FEATURES=( "regentree" ) | ||
32 | |||
33 | # setup a fake mage rc | ||
34 | MY_MAGE_RC=$(mktemp) | ||
35 | echo "ARCH=${ARCH}" > ${MY_MAGE_RC} | ||
36 | echo "PKGDIR=${PKGDIR}" >> ${MY_MAGE_RC} | ||
37 | echo "SMAGESCRIPTSDIR=${SMAGESCRIPTSDIR}" >> ${MY_MAGE_RC} | ||
38 | echo "MAGE_TREE_DEST=${MAGE_TREE_DEST}" >> ${MY_MAGE_RC} | ||
39 | echo "MLIBDIR=${MLIBDIR}" >> ${MY_MAGE_RC} | ||
40 | # support both | ||
41 | echo "REGEN_MAGE_TREE=${REGEN_MAGE_TREE}" >> ${MY_MAGE_RC} | ||
42 | echo "MAGE_FEATURES=\"${MAGE_FEATURES}\"" >> ${MY_MAGE_RC} | ||
43 | export MAGERC=${MY_MAGE_RC} | ||
44 | |||
45 | # svn root | ||
46 | export SVNROOT="${MY_SVN_ROOT}" | ||
47 | |||
48 | [ ! -d "${MY_SVN_DEST}" ] && install -d ${MY_SVN_DEST} | ||
49 | |||
50 | # get rid of old cruft (fixes some rsync issues) | ||
51 | rm -rf ${MY_SVN_DEST}/* | ||
52 | |||
53 | # get all our modules or update them | ||
54 | for module in ${MY_SVN_MODULES} | ||
55 | do | ||
56 | case ${module} in | ||
57 | mage/*) codir=mage;; | ||
58 | smage/*) codir=smage;; | ||
59 | magellan-source/*) codir=mage-src;; | ||
60 | esac | ||
61 | |||
62 | if [ ! -d ${MY_SVN_DEST}/${module}/.svn ] | ||
63 | then | ||
64 | ( cd ${MY_SVN_DEST}; svn checkout ${MY_SVN_OPTS} ${SVNROOT}/${module} ${codir} ) | ||
65 | else | ||
66 | ( cd ${MY_SVN_DEST}; svn update ${MY_SVN_OPTS} ${SVNROOT}/${module} ${codir} ) | ||
67 | fi | ||
68 | done | ||
69 | |||
70 | # delete CVS directories | ||
71 | for file in $(find ${MY_SVN_DEST} -type d -name .svn) | ||
72 | do | ||
73 | rm -rf ${file} | ||
74 | done | ||
75 | |||
76 | # correct permissions | ||
77 | find ${MY_SVN_DEST} -type f -exec chmod 0644 '{}' ';' | ||
78 | find ${MY_SVN_DEST} -type d -exec chmod 0755 '{}' ';' | ||
79 | |||
80 | # now regen mage tree | ||
81 | |||
82 | if [ -f ${MY_SVN_DEST}/smage/.regenignore ] | ||
83 | then | ||
84 | export EXCLUDED="$(< ${MY_SVN_DEST}/smage/.regenignore )" | ||
85 | fi | ||
86 | |||
87 | if [[ -n ${EXCLUDED} ]] | ||
88 | then | ||
89 | for i in ${EXCLUDED} | ||
90 | do | ||
91 | if [ -e "${MY_SVN_DEST}/smage/${i}" ] | ||
92 | then | ||
93 | rm -rf "${MY_SVN_DEST}/smage/${i}" | ||
94 | fi | ||
95 | done | ||
96 | fi | ||
97 | |||
98 | # exec permissions | ||
99 | chmod a+x ${MY_SVN_DEST}/mage-src/usr/lib/mage/smage2.sh | ||
100 | |||
101 | # shut up some warnings | ||
102 | [ ! -f /etc/mage.rc ] && touch /etc/mage.rc | ||
103 | [ ! -f /usr/lib/mage/version ] && { install -d /usr/lib/mage; touch /usr/lib/mage/version; } | ||
104 | |||
105 | # fix includes | ||
106 | [[ ! -e ${MY_SVN_DEST}/smage/include ]] && ln -snf core/include ${MY_SVN_DEST}/smage/include | ||
107 | |||
108 | for smage in $(find ${MY_SVN_DEST}/smage -type f -name "*.smage2" | sort) | ||
109 | do | ||
110 | for arch in ${MY_SVN_ARCHES} | ||
111 | do | ||
112 | export ARCH="${arch}" | ||
113 | export PKGDIR="${MY_SVN_REPO}/${MY_SVN_DISTRIBUTION}/packages/${ARCH}" | ||
114 | sed -i -e "s:\(ARCH=\).*:\1${ARCH}:" -e "s:\(PKGDIR=\).*:\1${PKGDIR}:" ${MY_MAGE_RC} | ||
115 | |||
116 | # first regen always to have a mage file | ||
117 | ${MY_SVN_DEST}/mage-src/usr/lib/mage/smage2.sh only-regen-tree "${smage}" | ||
118 | done | ||
119 | done | ||
120 | |||
121 | # create tarballs | ||
122 | pushd ${MY_SVN_DEST} | ||
123 | for module in ${MY_SVN_MODULES} | ||
124 | do | ||
125 | case ${module} in | ||
126 | magellan-source/*) continue;; | ||
127 | esac | ||
128 | tar cvjf ${module/\/*/}-"${MY_TARBALL_VERSION_TAG}".tar.bz2 ./${module/\/*/} | ||
129 | done | ||
130 | popd | ||
131 | |||
132 | # remove mage sources | ||
133 | if [[ ${MY_SVN_REMOVE_MAGE_SOURCES} = true ]] | ||
134 | then | ||
135 | [ -d ${MY_SVN_DEST}/mage-src ] && rm -rf ${MY_SVN_DEST}/mage-src | ||
136 | [ -d ${MY_SVN_DEST}/mage-src-"${MY_TARBALL_VERSION_TAG}".tar.bz2 ] && | ||
137 | rm -rf ${MY_SVN_DEST}/mage-src-"${MY_TARBALL_VERSION_TAG}".tar.bz2 | ||
138 | fi | ||
139 | |||
140 | |||
141 | # move tarballs to a proper location | ||
142 | install -d ${MY_SVN_DEST}/tarballs | ||
143 | for module in ${MY_SVN_MODULES} | ||
144 | do | ||
145 | if [ -f ${MY_SVN_DEST}/${module/\/*/}-"${MY_TARBALL_VERSION_TAG}".tar.bz2 ] | ||
146 | then | ||
147 | mv ${MY_SVN_DEST}/${module/\/*/}-"${MY_TARBALL_VERSION_TAG}".tar.bz2 ${MY_SVN_DEST}/tarballs | ||
148 | |||
149 | # symlink them | ||
150 | ln -snf ${module/\/*/}-"${MY_TARBALL_VERSION_TAG}".tar.bz2 ${MY_SVN_DEST}/tarballs/${module/\/*/}-latest.tar.bz2 | ||
151 | |||
152 | # and generate md5 sum for each | ||
153 | pushd ${MY_SVN_DEST}/tarballs | ||
154 | md5sum ${module/\/*/}-"${MY_TARBALL_VERSION_TAG}".tar.bz2 > ${module/\/*/}-"${MY_TARBALL_VERSION_TAG}".md5 | ||
155 | md5sum ${module/\/*/}-latest.tar.bz2 > ${module/\/*/}-latest.md5 | ||
156 | popd | ||
157 | fi | ||
158 | done | ||
159 | |||
160 | # delete fake mage.rc | ||
161 | if [[ -f ${MY_MAGE_RC} ]] | ||
162 | then | ||
163 | rm -f ${MY_MAGE_RC} | ||
164 | fi | ||
165 |
Properties
Name | Value |
---|---|
svn:executable | * |