aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2005-10-14 01:49:56 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2005-10-14 01:49:56 +0000
commit284a68d81eb472152e1711064c6ee08d68f6003d (patch)
treef112b887a3f5594e36315a6f09bfa6137422d6af
parentd806152ced28fefba6e5b43da28c18381086c901 (diff)
downloadrpmtools-284a68d81eb472152e1711064c6ee08d68f6003d.tar
rpmtools-284a68d81eb472152e1711064c6ee08d68f6003d.tar.gz
rpmtools-284a68d81eb472152e1711064c6ee08d68f6003d.tar.bz2
rpmtools-284a68d81eb472152e1711064c6ee08d68f6003d.tar.xz
rpmtools-284a68d81eb472152e1711064c6ee08d68f6003d.zip
- add del/save/set/check
-rwxr-xr-xeditdistrib66
1 files changed, 66 insertions, 0 deletions
diff --git a/editdistrib b/editdistrib
index f857a17..00c13ec 100755
--- a/editdistrib
+++ b/editdistrib
@@ -140,6 +140,72 @@ my $commands = {
$param->{selected}{$_} = 1;
}
},
+
+ set => sub {
+ my $param = shift(@_);
+ local @ARGV = @_;
+ GetOptions(
+ 'm=s' => \my $media,
+ 'a' => \my $allmedia,
+ );
+ my ($var, $val) = @ARGV;
+ foreach my $d (@{$param->{distrib}}) {
+ if ($media || $allmedia) {
+ foreach my $m ($distribs[$d]->listmedia) {
+ if ($media && $m ne $media) {
+ next;
+ }
+ $distribs[$d]->setvalue($m, $var, $val);
+ }
+ } else {
+ $distribs[$d]->setvalue(undef, $var, $val);
+ }
+ }
+ },
+
+ del => sub {
+ my $param = shift(@_);
+ local @ARGV = @_;
+ GetOptions(
+ 'm=s' => \my $media,
+ 'a' => \my $allmedia,
+ );
+ my ($var) = @ARGV;
+ foreach my $d (@{$param->{distrib}}) {
+ if ($media || $allmedia) {
+ foreach my $m ($distribs[$d]->listmedia) {
+ if ($media && $m ne $media) {
+ next;
+ }
+ $distribs[$d]->delvalue($m, $var);
+ }
+ } else {
+ $distribs[$d]->delvalue(undef, $var);
+ }
+ }
+ },
+
+ check => sub {
+ my $param = shift(@_);
+ local @ARGV = @_;
+ GetOptions(
+ );
+
+ foreach my $d (@{$param->{distrib}}) {
+ printf "%3d %s\n", $d, $distribs[$d]->getpath(undef, "root");
+ $distribs[$d]->check();
+ }
+ },
+
+ save => sub {
+ my $param = shift(@_);
+ local @ARGV = @_;
+ GetOptions(
+ );
+ foreach my $d (@{$param->{distrib}}) {
+ $distribs[$d]->write_mediacfg();
+ }
+ },
};