gluon/package/gluon-autoupdater/invariant.pl
Nils Schneider f637e923f5 gluon-autoupdater: new branch specification
It is now possible to specific multiple branches like this:

config branch stable
  option url ...
  list pubkey ...
  ...

config branch testing
  ...

and select one in autoupdater.settings:

config autoupdater settings
  option branch "stable"
2013-10-02 13:33:47 +02:00

45 lines
689 B
Perl

my $cfg = $CONFIG->{autoupdater};
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';
EOF
}
uci -q batch <<EOF
END
foreach my $name (sort keys $cfg->{branches}) {
my $branch = $cfg->{branches}->{$name};
print <<END;
delete autoupdater.$name
set autoupdater.$name=branch
END
for (qw(url probability good_signatures)) {
print "set autoupdater.$name.$_=$branch->{$_}\n";
}
for (@{$branch->{pubkeys}}) {
print "add_list autoupdater.$name.pubkey=$_\n";
}
}
print <<END;
commit autoupdater
EOF
END