Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
ffbs-gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ffbs
ffbs-gluon
Commits
4521362c
Commit
4521362c
authored
11 years ago
by
Matthias Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
gluon-core: clean up upgrade main script
parent
15aafe47
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
package/gluon-core/files/etc/uci-defaults/zzz-gluon-upgrade
+9
-26
9 additions, 26 deletions
package/gluon-core/files/etc/uci-defaults/zzz-gluon-upgrade
with
9 additions
and
26 deletions
package/gluon-core/files/etc/uci-defaults/zzz-gluon-upgrade
+
9
−
26
View file @
4521362c
...
...
@@ -13,27 +13,20 @@ version_of() {
}
oldversion_of
()
{
oldversion
=
"
$(
cat
"
$VERSION_DIR
"
/
"
$1
"
2>/dev/null
)
"
# Legacy support
if
[
-z
"
$oldversion
"
]
;
then
oldversion
=
"
$(
cat
/etc/.freifunk_version_keep 2>/dev/null
)
"
;
fi
if
[
-z
"
$oldversion
"
]
;
then
oldversion
=
"
$(
cat
/etc/.lff_version_keep 2>/dev/null
)
"
;
fi
if
[
-z
"
$oldversion
"
]
;
then
oldversion
=
"
$(
cat
/etc/.kff_version_keep 2>/dev/null
)
"
;
fi
echo
"
$oldversion
"
cat
"
$VERSION_DIR
"
/
"
$1
"
2>/dev/null
}
do_dir
()
{
if
[
-d
"
$1
"
]
;
the
n
local
s
for
s
in
"
$1
"
/
*
;
do
"
$s
"
;
done
f
i
[
-d
"
$1
"
]
||
retur
n
local
s
f
or
s
in
"
$1
"
/
*
;
do
"
$s
"
;
done
}
do_component
()
{
local
component
=
"
$1
"
local
version
=
"
$(
version_of
"
$component
"
)
"
if
[
-z
"
$version
"
]
;
then
continue
;
fi
[
"
$version
"
]
||
continue
(
cd
"
$component
"
...
...
@@ -45,7 +38,7 @@ do_component() {
local
v
for
v
in
*
;
do
if
[
"
$v
"
=
initial
-
o
"
$v
"
=
invariant
-o
"
$v
"
=
version
]
;
then
continue
;
fi
[
"
$v
"
!
=
initial
-
a
"
$v
"
!
=
invariant
]
||
continue
# The return value of opkg compare-versions is negated
if
!
opkg compare-versions
"
$v
"
'>>'
"
$oldversion
"
;
then
...
...
@@ -61,21 +54,11 @@ do_component() {
}
version
=
"
$(
version_of core
)
"
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_LFF
"
2>/dev/null
)
"
;
fi
if
[
-z
"
$oldversion
"
]
;
then
oldversion
=
"
$(
cat
"
$VERSION_FILE_KFF
"
2>/dev/null
)
"
;
fi
cd
"
$UPGRADE_DIR
"
do_component core
for
component
in
*
;
do
if
[
"
$component
"
!=
'core'
]
;
then
do_component
"
$component
"
fi
[
"
$component
"
!=
'core'
]
||
continue
do_component
"
$component
"
done
rm
-f
"
$VERSION_FILE_FREIFUNK
"
"
$VERSION_FILE_LFF
"
"
$VERSION_FILE_KFF
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment