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

This commit is contained in:
Matthias Schiffer 2014-02-11 17:10:11 +01:00
parent a365d626c2
commit 30869d9080
2 changed files with 8 additions and 10 deletions

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-autoupdater PKG_NAME:=gluon-autoupdater
PKG_VERSION:=0.1 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) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
@ -29,7 +29,7 @@ define Package/gluon-autoupdater/install
$(CP) ./files/* $(1)/ $(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/lib/gluon/upgrade/autoupdater/invariant $(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 chmod +x $(1)/lib/gluon/upgrade/autoupdater/invariant/010-autoupdater
endef endef

View File

@ -1,18 +1,16 @@
my $cfg = $CONFIG->{autoupdater}; my $cfg = $CONFIG->{autoupdater};
print <<'END'; my $branch = $ENV{GLUON_BRANCH} || $cfg->{branch};
my $enabled = $ENV{GLUON_BRANCH} ? 1 : 0;
print <<END;
#/bin/sh #/bin/sh
uci -q get autoupdater.settings || { uci -q get autoupdater.settings || {
uci -q batch <<EOF uci -q batch <<EOF
set autoupdater.settings=autoupdater set autoupdater.settings=autoupdater
END set autoupdater.settings.branch=$branch
set autoupdater.settings.enabled=$enabled
for (qw(enabled branch)) {
print "set autoupdater.settings.$_=$cfg->{$_}\n";
}
print <<'END';
EOF EOF
} }