gluon-autoupdater: enable by default only if GLUON_BRANCH is set, set default branch accordingly
This commit is contained in:
parent
a365d626c2
commit
30869d9080
@ -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
|
||||
|
||||
|
@ -1,18 +1,16 @@
|
||||
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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user