summaryrefslogtreecommitdiff
path: root/scripts
Unidiff
Diffstat (limited to 'scripts') (more/less context) (ignore whitespace changes)
-rwxr-xr-xscripts/GeneratePackageMake8
-rwxr-xr-xscripts/mkipkg10
-rwxr-xr-xscripts/tothreaded4
3 files changed, 13 insertions, 9 deletions
diff --git a/scripts/GeneratePackageMake b/scripts/GeneratePackageMake
index 099d3e8..9d692a9 100755
--- a/scripts/GeneratePackageMake
+++ b/scripts/GeneratePackageMake
@@ -1,89 +1,89 @@
1# generate file containg control name / package name / files 1# generate file containg control name / package name / files
2find . -name *.control | grep -v -- "-mt.control" | while read i 2find . -name *.control | grep -v -- "-mt.control" | while read i
3do 3do
4 i=${i/.\//} 4 i=${i/.\//}
5 CDIR=${i%/*} 5 CDIR=${i%/*}
6 BNAME=${i##*/} 6 BNAME=${i##*/}
7 BNAME=${BNAME/.control/} 7 BNAME=${BNAME/.control/}
8 echo "cdir: ${CDIR}" 8 echo "cdir: ${CDIR}"
9 echo "bname: ${BNAME}" 9 echo "bname: ${BNAME}"
10 grep -e "Package:" -e "Files:" ./${i} 10 grep -e "Package:" -e "Files:" ./${i}
11done > /tmp/ALL 11done > /tmp/ALL
12 12
13# 13#
14# makefile header 14# makefile header
15# 15#
16 16
17cat << MAKEFILEHEADER 17cat << MAKEFILEHEADER
18 18
19# 19#
20# generate -mt.control file from regular control 20# generate -mt.control file from regular control
21# arg 1 : path to control file to convert 21# arg 1 : path to control file to convert
22# 22#
23 23
24define GenerateMTControl 24define GenerateMTControl
25@echo "Generating -mt control file for \$(basename \$<)" 25@echo "Generating -mt control file for \$(basename \$<)"
26@\$(OPIEDIR)/scripts/tothreaded \$< \$(OPIEDIR)/AllThreadedPackages 26@\$(OPIEDIR)/scripts/tothreaded \$< \$(OPIEDIR)/AllThreadedPackages
27endef 27endef
28 28
29# 29#
30# package one control file 30# package one control file
31# arg 1 : directory from OPIEROOT where control file resides 31# arg 1 : directory from OPIEROOT where control file resides
32# arg 2 : control file basename without -mt (no .control) 32# arg 2 : control file basename without -mt (no .control)
33# arg 3 : control file basename with -mt if needed 33# arg 3 : control file basename with -mt if needed
34# arg 4 : package name (value specified by Package: ...) 34# arg 4 : package name (value specified by Package: ...)
35# 35#
36 36
37define DoPackage 37define DoPackage
38@echo \"Building ipk of \$(4)\" 38echo \"Building ipk of \$(4)\"
39@( \$(ForSubst) ) > \$(TOPDIR)/scripts/subst 39( \$(ForSubst) ) > \$(TOPDIR)/scripts/subst
40@( \$(ForFileSubst) ) > \$(TOPDIR)/scripts/Filesubst 40( \$(ForFileSubst) ) > \$(TOPDIR)/scripts/Filesubst
41@( cd \$(OPIEDIR); \\ 41( cd \$(OPIEDIR); \\
42 \$(OPIEDIR)/scripts/mkipkg \\ 42 \$(OPIEDIR)/scripts/mkipkg \\
43 --subst=\$(OPIEDIR)/scripts/subst \\ 43 --subst=\$(OPIEDIR)/scripts/subst \\
44 --filesubst=\$(OPIEDIR)/scripts/filesubst \\ 44 --filesubst=\$(OPIEDIR)/scripts/filesubst \\
45 --control=\$(OPIEDIR)/\$(1)/\$(3).control \\ 45 --control=\$(OPIEDIR)/\$(1)/\$(3).control \\
46 --prerm=\$(OPIEDIR)/\$(1)/\$(2).prerm \\ 46 --prerm=\$(OPIEDIR)/\$(1)/\$(2).prerm \\
47 --preinst=\$(OPIEDIR)/\$(1)/\$(2).preinst \\ 47 --preinst=\$(OPIEDIR)/\$(1)/\$(2).preinst \\
48 --postrm=\$(OPIEDIR)/\$(1)/\$(2).postrm \\ 48 --postrm=\$(OPIEDIR)/\$(1)/\$(2).postrm \\
49 --postinst=\$(OPIEDIR)/\$(1)/\$(2).postinst \\ 49 --postinst=\$(OPIEDIR)/\$(1)/\$(2).postinst \\
50 --strip=\$(STRIP) \$(OPIEDIR); \\ 50 --strip=\$(STRIP) \$(OPIEDIR); \\
51 rm -f \$(OPIEDIR)/Packages/\$(4)_*.ipk; \\ 51 rm -f \$(OPIEDIR)/Packages/\$(4)_*.ipk; \\
52 mv *.ipk \$(OPIEDIR)/Packages; \\ 52 mv *.ipk \$(OPIEDIR)/Packages; \\
53 touch \$(OPIEDIR)/Packages/\$(4) \\ 53 touch \$(OPIEDIR)/Packages/\$(4) \\
54) || true 54) || true
55endef 55endef
56 56
57# 57#
58# prepared for generating the substfile for every build 58# prepared for generating the substfile for every build
59# 59#
60 60
61define ForSubst 61define ForSubst
62echo 's,\\\$\$QPE_VERSION,\$(QPE_VERSION),g'; \\ 62echo 's,\\\$\$QPE_VERSION,\$(QPE_VERSION),g'; \\
63echo 's,\\\$\$OPIE_VERSION,\$(OPIE_VERSION),g'; \\ 63echo 's,\\\$\$OPIE_VERSION,\$(OPIE_VERSION),g'; \\
64echo 's,\\\$\$QTE_VERSION,\$(QTE_VERSION),g'; \\ 64echo 's,\\\$\$QTE_VERSION,\$(QTE_VERSION),g'; \\
65echo 's,\\\$\$QTE_REVISION,\$(QTE_REVISION),g'; \\ 65echo 's,\\\$\$QTE_REVISION,\$(QTE_REVISION),g'; \\
66echo 's,\\\$\$SUB_VERSION,\$(SUB_VERSION),g'; \\ 66echo 's,\\\$\$SUB_VERSION,\$(SUB_VERSION),g'; \\
67echo 's,\\\$\$EXTRAVERSION,\$(EXTRAVERSION),g'; \\ 67echo 's,\\\$\$EXTRAVERSION,\$(EXTRAVERSION),g'; \\
68echo 's,\\\$\$QTE_BASEVERSION,\$(QTE_BASEVERSION),g' 68echo 's,\\\$\$QTE_BASEVERSION,\$(QTE_BASEVERSION),g'
69endef 69endef
70 70
71define ForFileSubst 71define ForFileSubst
72echo 's,\\\$\$OPIEDIR/root/,/,g'; \\ 72echo 's,\\\$\$OPIEDIR/root/,/,g'; \\
73echo 's,\$(OPIEDIR)/root/,/,g'; \\ 73echo 's,\$(OPIEDIR)/root/,/,g'; \\
74echo 's,\\\$\$OPIEDIR,\$(prefix),g'; \\ 74echo 's,\\\$\$OPIEDIR,\$(prefix),g'; \\
75echo 's,\$(OPIEDIR),\$(prefix),g'; \\ 75echo 's,\$(OPIEDIR),\$(prefix),g'; \\
76echo 's,\\\$\$QTDIR,\$(prefix),g'; \\ 76echo 's,\\\$\$QTDIR,\$(prefix),g'; \\
77echo 's,\$(QTDIR),\$(prefix),g'; \\ 77echo 's,\$(QTDIR),\$(prefix),g'; \\
78echo 's,^\(\./\)*root/,/,g'; \\ 78echo 's,^\(\./\)*root/,/,g'; \\
79echo 's,^\(\./\)*etc/,\$(prefix)/etc/,g'; \\ 79echo 's,^\(\./\)*etc/,\$(prefix)/etc/,g'; \\
80echo 's,^\(\./\)*lib/,\$(prefix)/lib/,g'; \\ 80echo 's,^\(\./\)*lib/,\$(prefix)/lib/,g'; \\
81echo 's,^\(\./\)*bin/,\$(prefix)/bin/,g'; \\ 81echo 's,^\(\./\)*bin/,\$(prefix)/bin/,g'; \\
82echo 's,^\(\./\)*pics/,\$(prefix)/pics/,g'; \\ 82echo 's,^\(\./\)*pics/,\$(prefix)/pics/,g'; \\
83echo 's,^\(\./\)*sounds/,\$(prefix)/sounds/,g'; \\ 83echo 's,^\(\./\)*sounds/,\$(prefix)/sounds/,g'; \\
84echo 's,^\(\./\)*i18n/,\$(prefix)/i18n/,g'; \\ 84echo 's,^\(\./\)*i18n/,\$(prefix)/i18n/,g'; \\
85echo 's,^\(\./\)*plugins/,\$(prefix)/plugins/,g'; \\ 85echo 's,^\(\./\)*plugins/,\$(prefix)/plugins/,g'; \\
86echo 's,^\(\./\)*apps/,\$(prefix)/apps/,g'; \\ 86echo 's,^\(\./\)*apps/,\$(prefix)/apps/,g'; \\
87echo 's,^\(\./\)*share/,\$(prefix)/share/,g'; \\ 87echo 's,^\(\./\)*share/,\$(prefix)/share/,g'; \\
88echo 's,^\(\./\)*i18n/,\$(prefix)/i18n/,g'; \\ 88echo 's,^\(\./\)*i18n/,\$(prefix)/i18n/,g'; \\
89echo 's,^\(\./\)*help/,\$(prefix)/help/,g' 89echo 's,^\(\./\)*help/,\$(prefix)/help/,g'
diff --git a/scripts/mkipkg b/scripts/mkipkg
index a336371..2f020f4 100755
--- a/scripts/mkipkg
+++ b/scripts/mkipkg
@@ -199,129 +199,133 @@ createFileList()
199 excludeMaskArray=( $excludeMask ) 199 excludeMaskArray=( $excludeMask )
200 excludeMaskArray=( "${excludeMaskArray[@]}" "CONTROL/*" "usr/share/*" ) 200 excludeMaskArray=( "${excludeMaskArray[@]}" "CONTROL/*" "usr/share/*" )
201 201
202 if [ $includemaskpresent != 1 ]; then 202 if [ $includemaskpresent != 1 ]; then
203 includeMask="." 203 includeMask="."
204 fi 204 fi
205 205
206 if [ -z "$includeMask" ]; then 206 if [ -z "$includeMask" ]; then
207 setVar $2 "" 207 setVar $2 ""
208 _popd 208 _popd
209 return 0 209 return 0
210 fi 210 fi
211 211
212 expandMaskToList "$includeMask" _fileList 212 expandMaskToList "$includeMask" _fileList
213 213
214 excludeMaskArray=( "${excludeMaskArray[@]}" "*/CVS*" "*/SCCS*" ) 214 excludeMaskArray=( "${excludeMaskArray[@]}" "*/CVS*" "*/SCCS*" )
215 215
216 local realFileList= 216 local realFileList=
217 local missing=0 217 local missing=0
218 for file in $_fileList; do 218 for file in $_fileList; do
219 local containedInList=0 219 local containedInList=0
220 for i in "${excludeMaskArray[@]}"; do 220 for i in "${excludeMaskArray[@]}"; do
221 if [[ $file == $i ]]; then 221 if [[ $file == $i ]]; then
222 containedInList=1 222 containedInList=1
223 break; 223 break;
224 fi 224 fi
225 done 225 done
226 226
227 if [ $containedInList = 0 ]; then 227 if [ $containedInList = 0 ]; then
228 if ! [ -e $file -o -L $file ]; then 228 if ! [ -e $file -o -L $file ]; then
229 echo "$self: $file not found" 229 echo "$self: $file not found"
230 missing=1 230 missing=1
231 fi 231 fi
232 realFileList=$file" $realFileList" 232 realFileList=$file" $realFileList"
233 fi 233 fi
234 done 234 done
235 235
236 _popd 236 _popd
237 237
238 if [ $missing = 1 ]; then 238 if [ $missing = 1 ]; then
239 return 1 239 return 1
240 fi 240 fi
241 241
242 setVar $2 "$realFileList" 242 setVar $2 "$realFileList"
243} 243}
244 244
245stripFile() 245stripFile()
246{ 246{
247 if [ -f $1 -a -x $1 ]; then 247 if [ ! -h $1 -a -f $1 -a -x $1 ]; then
248 $strip --strip-all $1 248 $strip -p --strip-all $1
249 fi 249 fi
250} 250}
251 251
252substFile() 252substFile()
253{ 253{
254 local oldfile=$1 254 local oldfile=$1
255 255
256 if [ ! -e $2 ]; then return 1; fi 256 if [ ! -e $2 ]; then return 1; fi
257 257
258 if [ -e $oldfile -o -L $oldfile ]; then 258 if [ -e $oldfile -o -L $oldfile ]; then
259 newfile=`echo $oldfile|sed -f $2|sed -e's,^/,,g'` 259 newfile=`echo $oldfile|sed -f $2|sed -e's,^/,,g'`
260 olddir=`dirname $oldfile` 260 olddir=`dirname $oldfile`
261 base=`basename $oldfile` 261 base=`basename $oldfile`
262 newdir=`dirname $newfile` 262 newdir=`dirname $newfile`
263 263
264# echo >&2 moving $oldfile to $newfile 264# echo >&2 moving $oldfile to $newfile
265 265
266 if [ "$newdir" = "$olddir" ]; then 266 if [ "$newdir" = "$olddir" ]; then
267 return 0 267 return 0
268 fi 268 fi
269 269
270 mkdir -p $newdir 270 mkdir -p $newdir
271 mv $olddir/$base $newfile 271 mv $olddir/$base $newfile
272 rmdir -p $olddir 2>/dev/null 272 rmdir -p $olddir 2>/dev/null
273 fi 273 fi
274} 274}
275 275
276stripFiles() 276stripFiles()
277{ 277{
278 for f in $1; do 278 for f in $1; do
279 stripFile ./$f 279 # do not strip links
280 if [ ! -h ./$f ]
281 then
282 stripFile ./$f
283 fi
280 done 284 done
281} 285}
282 286
283substFiles() 287substFiles()
284{ 288{
285 for f in $1; do 289 for f in $1; do
286 substFile ./$f 290 substFile ./$f
287 done 291 done
288} 292}
289 293
290substAndStripFiles() 294substAndStripFiles()
291{ 295{
292 for f in $1; do 296 for f in $1; do
293 stripFile ./$f 297 stripFile ./$f
294 substFile ./$f $2 298 substFile ./$f $2
295 done 299 done
296} 300}
297 301
298installScript() 302installScript()
299{ 303{
300 if [ -n "$1" -a -f "$1" ]; then 304 if [ -n "$1" -a -f "$1" ]; then
301 destfile=`basename $1` 305 destfile=`basename $1`
302 filetype=`echo $destfile|cut -d. -f2` 306 filetype=`echo $destfile|cut -d. -f2`
303 if [ -n "$filetype" ]; then destfile=$filetype; fi 307 if [ -n "$filetype" ]; then destfile=$filetype; fi
304 if [ -n "$subst" ]; then 308 if [ -n "$subst" ]; then
305 sed -f $subst < $1 > $ctrldir/$destfile 309 sed -f $subst < $1 > $ctrldir/$destfile
306 else 310 else
307 cat $1 > $ctrldir/$destfile 311 cat $1 > $ctrldir/$destfile
308 fi 312 fi
309 chmod +x $ctrldir/$destfile 313 chmod +x $ctrldir/$destfile
310 fi 314 fi
311} 315}
312 316
313tempDir=/tmp/`basename $self`.$$ 317tempDir=/tmp/`basename $self`.$$
314mkdir -p $tempDir 318mkdir -p $tempDir
315if [ $? != 0 ]; then 319if [ $? != 0 ]; then
316 echo "$self: cannot create $tempDir, exiting..." 320 echo "$self: cannot create $tempDir, exiting..."
317 rm -rf $tempDir 321 rm -rf $tempDir
318 exit 1 322 exit 1
319fi 323fi
320 324
321ctrldir=$tempDir/CONTROL 325ctrldir=$tempDir/CONTROL
322 326
323mkdir -p $ctrldir 327mkdir -p $ctrldir
324 328
325if [ ! -e $subst ] || [ -z "$subst" ]; then 329if [ ! -e $subst ] || [ -z "$subst" ]; then
326 cat $control > $ctrldir/control.new 330 cat $control > $ctrldir/control.new
327else 331else
diff --git a/scripts/tothreaded b/scripts/tothreaded
index 31ed31e..f916ad8 100755
--- a/scripts/tothreaded
+++ b/scripts/tothreaded
@@ -1,82 +1,82 @@
1#!/bin/sh 1#!/bin/sh
2 2
3# PURPOSE : 3# PURPOSE :
4# 4#
5# this script converts a non-threaded control file to a threaded one 5# this script converts a non-threaded control file to a threaded one
6# by extending appropriate names with -mt as extension 6# by extending appropriate names with -mt as extension
7# 7#
8# eg abc.control becoms abc-mt.control 8# eg abc.control becoms abc-mt.control
9# 9#
10 10
11# 11#
12# make sure that the depends expression has enough spaces 12# make sure that the depends expression has enough spaces
13# expression can contian : , ( ) || && 13# expression can contian : , ( ) || &&
14# 14#
15tokenize() { 15tokenize() {
16 sed "s/,/ & /g" | sed "s/)/ & /g" | sed "s/(/ & /g" | sed "s/|/ & /g" | sed "s/&/ & /g" 16 sed "s/,/ & /g" | sed "s/)/ & /g" | sed "s/(/ & /g" | sed "s/|/ & /g" | sed "s/&/ & /g"
17} 17}
18 18
19# 19#
20# function converts package name to threaded equivalend IF the 20# function converts package name to threaded equivalend IF the
21# package file HAS a threaded version 21# package file HAS a threaded version
22# 22#
23findthreadedequiv() { 23findthreadedequiv() {
24 local isin i 24 local isin i
25 for i in $* 25 for i in $*
26 do 26 do
27 isin=`grep "^$i\$" "$ALLTHREADEDPKGSFILE"` 27 isin=`grep "^$i\$" "$ALLTHREADEDPKGSFILE"`
28 if [ -z "$isin" ] 28 if [ -z "$isin" ]
29 then 29 then
30 # no threaded package 30 # no threaded package
31 echo -n "$i " 31 echo -n "$i"
32 else 32 else
33 # threaded package 33 # threaded package
34 echo -n "${isin}-mt " 34 echo -n "${isin}-mt"
35 fi 35 fi
36 done 36 done
37 echo 37 echo
38} 38}
39 39
40# 40#
41# signature of binary files 41# signature of binary files
42# currently obsolete 42# currently obsolete
43# 43#
44# ISBINARY="*ELF*LSB*" 44# ISBINARY="*ELF*LSB*"
45 45
46usage() { 46usage() {
47 echo "Usage : tothreaded <controlfile> <ALLPackages file>" 47 echo "Usage : tothreaded <controlfile> <ALLPackages file>"
48 exit 2 48 exit 2
49} 49}
50 50
51. scripts/SpecialMTFiles 51. scripts/SpecialMTFiles
52 52
53# 53#
54# get the name of the controlfile to check for threading 54# get the name of the controlfile to check for threading
55# 55#
56if [ -z "$1" ] 56if [ -z "$1" ]
57then 57then
58 usage 58 usage
59fi 59fi
60controlfile=$1 60controlfile=$1
61shift 61shift
62 62
63case $controlfile in 63case $controlfile in
64 *-mt.control) 64 *-mt.control)
65 #already threaded 65 #already threaded
66 echo $controlfile 66 echo $controlfile
67 exit 0; 67 exit 0;
68 ;; 68 ;;
69esac 69esac
70 70
71# 71#
72# file containing list of all known threaded packages 72# file containing list of all known threaded packages
73# 73#
74if [ -z "$1" ] 74if [ -z "$1" ]
75then 75then
76 usage 76 usage
77fi 77fi
78ALLTHREADEDPKGSFILE=$1 78ALLTHREADEDPKGSFILE=$1
79shift 79shift
80 80
81# 81#
82# strip out the name of the package 82# strip out the name of the package