gluon-core: always handle core scripts first

This commit is contained in:
Matthias Schiffer 2013-10-01 20:22:54 +02:00
parent fa1774a4e6
commit 2d93cad89d

View File

@ -27,8 +27,36 @@ do_dir() {
fi fi
} }
do_component() {
local component="$1"
local version="$(version_of "$component")"
if [ -z "$version" ]; then continue; fi
version="$(version_of gluon-core)" cd "$component"
local oldversion="$(oldversion_of "$component")"
if [ -z "$oldversion" ]; then
do_dir initial
else
local v
for v in *; do
if [ "$v" = initial -o "$v" = invariant -o "$v" = version ]; then continue; fi
# The return value of opkg compare-versions is negated
if ! opkg compare-versions "$v" '>>' "$oldversion"; then
do_dir "$v"
fi
done
fi
do_dir invariant
echo "$version" > "$VERSION_DIR"/"$component"
}
version="$(version_of core)"
oldversion="$(cat "$VERSION_FILE" 2>/dev/null)" oldversion="$(cat "$VERSION_FILE" 2>/dev/null)"
if [ -z "$oldversion" ]; then oldversion="$(cat "$VERSION_FILE_FREIFUNK" 2>/dev/null)"; fi if [ -z "$oldversion" ]; then oldversion="$(cat "$VERSION_FILE_FREIFUNK" 2>/dev/null)"; fi
@ -38,31 +66,12 @@ if [ -z "$oldversion" ]; then oldversion="$(cat "$VERSION_FILE_KFF" 2>/dev/null)
( (
cd "$UPGRADE_DIR" cd "$UPGRADE_DIR"
do_compoment core
for component in *; do ( for component in *; do (
local version="$(version_of "$component")" if [ "$component" != 'core' ]; then
if [ -z "$version" ]; then continue; fi do_component "$component"
cd "$component"
local oldversion="$(oldversion_of "$component")"
if [ -z "$oldversion" ]; then
do_dir initial
else
local v
for v in *; do
if [ "$v" = initial -o "$v" = invariant -o "$v" = version ]; then continue; fi
# The return value of opkg compare-versions is negated
if ! opkg compare-versions "$v" '>>' "$oldversion"; then
do_dir "$v"
fi
done
fi fi
do_dir invariant
echo "$version" > "$VERSION_DIR"/"$component"
) done ) done
) )