Skip to content
Snippets Groups Projects
Commit 30869d90 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-autoupdater: enable by default only if GLUON_BRANCH is set, set default branch accordingly

parent a365d626
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-autoupdater
PKG_VERSION:=0.1
PKG_RELEASE:=1.$(GLUON_CONFIG_VERSION)
PKG_RELEASE:=1.$(GLUON_CONFIG_VERSION)$(if $(GLUON_BRANCH),.$(GLUON_BRANCH))
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
......@@ -29,7 +29,7 @@ define Package/gluon-autoupdater/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/lib/gluon/upgrade/autoupdater/invariant
$(GLUON_CONFIGURE) invariant.pl > $(1)/lib/gluon/upgrade/autoupdater/invariant/010-autoupdater
GLUON_BRANCH='$(GLUON_BRANCH)' $(GLUON_CONFIGURE) invariant.pl > $(1)/lib/gluon/upgrade/autoupdater/invariant/010-autoupdater
chmod +x $(1)/lib/gluon/upgrade/autoupdater/invariant/010-autoupdater
endef
......
my $cfg = $CONFIG->{autoupdater};
print <<'END';
my $branch = $ENV{GLUON_BRANCH} || $cfg->{branch};
my $enabled = $ENV{GLUON_BRANCH} ? 1 : 0;
print <<END;
#/bin/sh
uci -q get autoupdater.settings || {
uci -q batch <<EOF
set autoupdater.settings=autoupdater
END
for (qw(enabled branch)) {
print "set autoupdater.settings.$_=$cfg->{$_}\n";
}
print <<'END';
set autoupdater.settings.branch=$branch
set autoupdater.settings.enabled=$enabled
EOF
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment