OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Michael van Elst
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-re Date: 13-Nov-2002 18:06:43
Branch: HEAD Handle: 2002111317064200
Modified files:
openpkg-re openpkg-build
Log:
-a option to select all installed packages (replaces magic pattern)
-A option to select all repository packages (same as -U \*)
-z option to unconditionally rebuild packages
Summary:
Revision Changes Path
1.19 +31 -20 openpkg-re/openpkg-build
____________________________________________________________________________
Index: openpkg-re/openpkg-build
============================================================
$ cvs diff -u -r1.18 -r1.19 openpkg-build
--- openpkg-re/openpkg-build 13 Nov 2002 14:51:21 -0000 1.18
+++ openpkg-re/openpkg-build 13 Nov 2002 17:06:42 -0000 1.19
@@ -34,11 +34,11 @@
##########################################################################
use Getopt::Std;
-use vars qw/$opt_R $opt_r $opt_f $opt_u $opt_U/;
+use vars qw/$opt_R $opt_r $opt_f $opt_u $opt_U $opt_a $opt_A $opt_z/;
if (open(FH, "< $ENV{'HOME'}/.openpkg-build.rc")) {
while (<FH>) {
- if (my($opt,$val) = /^\-([RfruU])\s*(.*?)\s*$/) {
+ if (my($opt,$val) = /^\-([RfruUaAz])\s*(.*?)\s*$/) {
$val = 1 unless defined $val;
eval "\$opt_$opt = '$val';";
} else {
@@ -49,9 +49,9 @@
close(FH);
}
-getopts('R:r:f:uU');
-die "usage: $0 [-R rpm] [-r repository] [-f index.rdf] [-uU] package [with..]\n"
- unless $ARGV[0] =~ /^\S+$/;
+getopts('R:r:f:uUaAz');
+die "usage: $0 [-R rpm] [-r repository] [-f index.rdf] [-uUaAz] package [with..]\n"
+ unless $ARGV[0] =~ /^\S+$/ || $opt_a || $opt_A;
##########################################################################
@@ -660,9 +660,9 @@
return unless $i || $r || $b;
if ($dep =~ /^>=\s*(\S+)$/) {
- $cond = sub { vcmp($_[0],$2) >= 0; };
+ $cond = sub { vcmp($_[0],$1) >= 0; };
} elsif ($dep =~ /^=\s*(\S+)$/) {
- $cond = sub { vcmp($_[0],$2) == 0; };
+ $cond = sub { vcmp($_[0],$1) == 0; };
} elsif ($dep =~ /^\s*$/) {
$cond = sub { 1; };
} else {
@@ -695,7 +695,9 @@
return;
}
- if ($env->{installed}->{$target->{name}}) {
+ if ($env->{zero}) {
+ $target->{REBUILD} = 1;
+ } elsif ($env->{installed}->{$target->{name}}) {
if (target_exists($target, $env->{installed})) {
if (target_suitable($target, $env->{with})) {
unless ($env->{upgrade} && target_newer($target,
$env->{installed})) {
@@ -739,8 +741,7 @@
}
make_dep($t,$depth+1,$env,$list,$blist);
} else {
- \*STDOUT->flush;
- die "FATAL: $target->{name} requires $_\n";
+ die "FATAL: $target->{name} searches for a frood called '$_'\n";
}
}
@@ -785,19 +786,19 @@
my($name,$r,$i,@vers);
my(@todo);
- if ($pattern eq 'REFRESH') {
- @todo = grep {
- my($n) = $_;
- (ref $env->{installed}->{$n}) &&
- grep { $_ ne '-' } keys %{$env->{installed}->{$n}}
- } keys %{$env->{repository}};
- } else {
+ if (defined $pattern) {
if ($pattern =~ s/\*+$//) {
$pattern = '^'.quotemeta($pattern).'';
} else {
$pattern = '^'.quotemeta($pattern).'$';
}
@todo = grep(/$pattern/, keys %{$env->{repository}});
+ } else {
+ @todo = grep {
+ my($n) = $_;
+ (ref $env->{installed}->{$n}) &&
+ grep { $_ ne '-' } keys %{$env->{installed}->{$n}}
+ } keys %{$env->{repository}};
}
@@ -944,7 +945,16 @@
my($config,$url,$repository,$installed,$list,$bonly);
my($pattern,%with);
-$pattern = shift @ARGV;
+if ($opt_a) {
+ $pattern = undef;
+} else {
+ $pattern = shift @ARGV;
+}
+
+if ($opt_A) {
+ $pattern = '*';
+}
+
%with = map {
/([^\s=]+)(?:\=(\S+))?/
? ($1 => (defined $2 ? $2 : 'yes'))
@@ -969,11 +979,12 @@
built => {},
revdep => undef,
with => \%with,
- upgrade => ($opt_U+0)
+ upgrade => ($opt_a || $opt_U),
+ zero => $opt_z
});
die "FATAL: cannot find package\n" unless defined $list;
-print_list1($list,$config,$url,$opt_u || $opt_U,\%with);
+print_list1($list,$config,$url,$opt_a || $opt_u || $opt_U,\%with);
print_list2($bonly,$config);
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]