Magellan Linux

Annotation of /trunk/pkgtools/regen_mage_tree_rsync-alx-0.6.0-branch.sh

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:executable *