summaryrefslogtreecommitdiff
path: root/scripts/tothreaded
authorwimpie <wimpie>2005-01-09 03:02:21 (UTC)
committer wimpie <wimpie>2005-01-09 03:02:21 (UTC)
commit67d1d0b292553af550219d770cbd5c00987d8b8b (patch) (side-by-side diff)
tree517759c7fbda44a40ff733e3b5d5667d90558caa /scripts/tothreaded
parent987bc9a2c5b39ddd4dc2a665cea65688bfd2179e (diff)
downloadopie-67d1d0b292553af550219d770cbd5c00987d8b8b.zip
opie-67d1d0b292553af550219d770cbd5c00987d8b8b.tar.gz
opie-67d1d0b292553af550219d770cbd5c00987d8b8b.tar.bz2
CONTROL files : reset version to 'standard' format
(partly rolls back my drastic all-applicatoins-same-version change) now format is x.y(.z)$EXTRAVERSION where x.y (and aptionally .z) are x : major version y : minor version z : application patch and extra version is seconds-since-epoch this value can be used to automatically upgrade versions with minor changes (without manual update of the control file)
Diffstat (limited to 'scripts/tothreaded') (more/less context) (ignore whitespace changes)
-rwxr-xr-xscripts/tothreaded4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/tothreaded b/scripts/tothreaded
index 31ed31e..f916ad8 100755
--- a/scripts/tothreaded
+++ b/scripts/tothreaded
@@ -1,136 +1,136 @@
#!/bin/sh
# PURPOSE :
#
# this script converts a non-threaded control file to a threaded one
# by extending appropriate names with -mt as extension
#
# eg abc.control becoms abc-mt.control
#
#
# make sure that the depends expression has enough spaces
# expression can contian : , ( ) || &&
#
tokenize() {
sed "s/,/ & /g" | sed "s/)/ & /g" | sed "s/(/ & /g" | sed "s/|/ & /g" | sed "s/&/ & /g"
}
#
# function converts package name to threaded equivalend IF the
# package file HAS a threaded version
#
findthreadedequiv() {
local isin i
for i in $*
do
isin=`grep "^$i\$" "$ALLTHREADEDPKGSFILE"`
if [ -z "$isin" ]
then
# no threaded package
- echo -n "$i "
+ echo -n "$i"
else
# threaded package
- echo -n "${isin}-mt "
+ echo -n "${isin}-mt"
fi
done
echo
}
#
# signature of binary files
# currently obsolete
#
# ISBINARY="*ELF*LSB*"
usage() {
echo "Usage : tothreaded <controlfile> <ALLPackages file>"
exit 2
}
. scripts/SpecialMTFiles
#
# get the name of the controlfile to check for threading
#
if [ -z "$1" ]
then
usage
fi
controlfile=$1
shift
case $controlfile in
*-mt.control)
#already threaded
echo $controlfile
exit 0;
;;
esac
#
# file containing list of all known threaded packages
#
if [ -z "$1" ]
then
usage
fi
ALLTHREADEDPKGSFILE=$1
shift
#
# strip out the name of the package
#
packagename=${controlfile##*/} # path
packagename=${packagename%.control} # extension
#
# generate new control file
#
newcontrolfile=${controlfile/\.control/-mt\.control}
#
# read all lines in original control file
#
while read line
do
case $line in
# convert some files to threaded equivalent
"Files:"*)
files=${line#Files:}
# thread-converted files
T_files=`ConvertSpecialFiles "$files"`
echo "Files: $T_files"
;;
"Package: "*)
T_package=`findthreadedequiv ${line#Package: }`
echo "Package: ${T_package}"
;;
"Depends: "*)
depends=`echo "${line#Depends: }" | tokenize`
T_depends=`findthreadedequiv ${depends}`
echo "Depends: $T_depends"
;;
"Provides: "*)
T_provides=`findthreadedequiv ${line#Provides: }`
echo "Provides: $T_provides"
;;
"Recommends: "*)
T_recommends=`findthreadedequiv ${line#Recommends: }`
echo "Recommends: $T_recommends"
;;
"Conflicts: "*)
conflicts=`echo "${line#Conflicts: }" | tokenize`
T_conflicts=`findthreadedequiv ${conflicts}`
echo "Conflicts: $T_conflicts"
;;
*":"*)
echo "$line"
;;
*) # al other lines
echo " $line"
;;
esac
done < $controlfile > $newcontrolfile
echo $newcontrolfile