Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
firmware
FFS Gluon
Commits
2c65f083
Unverified
Commit
2c65f083
authored
2 years ago
by
Matthias Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
gluon-autoupdater: factor out default_branch() function
Make the code clearer and prepare for invalid branch fixup.
parent
db48b6b6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
package/gluon-autoupdater/luasrc/lib/gluon/upgrade/500-autoupdater
+10
-5
10 additions, 5 deletions
...luon-autoupdater/luasrc/lib/gluon/upgrade/500-autoupdater
with
10 additions
and
5 deletions
package/gluon-autoupdater/luasrc/lib/gluon/upgrade/500-autoupdater
+
10
−
5
View file @
2c65f083
...
...
@@ -21,16 +21,21 @@ for name, config in pairs(site.autoupdater.branches()) do
end
end
if
not
uci
:
get
(
'autoupdater'
,
'settings'
)
then
local
enabled
=
unistd
.
access
(
'/lib/gluon/autoupdater/default_enabled'
)
~=
nil
local
branch
=
site
.
autoupdater
.
branch
(
min_branch
)
local
function
default_branch
()
local
f
=
io.open
(
'/lib/gluon/autoupdater/default_branch'
)
if
f
then
branch
=
f
:
read
(
'*line'
)
local
ret
=
f
:
read
(
'*line'
)
f
:
close
()
return
ret
end
return
site
.
autoupdater
.
branch
(
min_branch
)
end
if
not
uci
:
get
(
'autoupdater'
,
'settings'
)
then
local
enabled
=
unistd
.
access
(
'/lib/gluon/autoupdater/default_enabled'
)
~=
nil
local
branch
=
default_branch
()
if
not
branch
then
enabled
=
false
end
...
...
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