On Fri, Jan 07, 2005 at 04:54:18PM -0800, David M. Fetter wrote:

> Speaking of -D not working with -A, though.

-D works with -A but an explicit list of packages doesn't.

-A works as if you had given a list of all packages from the
repository (or given a '*' wildcard for that matter). Since
this already selects all packages it doesn't make sense to
specify more packages on the command line.

-A did have some issue with -D in the past when you could only
specify options that applied to all packages. But what if you
wanted to give that option to one package and not the other ?
So now (and for quite some time) you can specify package-specific
options with -Dpackage::option=value.

> I have been having another
> problem where the -E doesn't seem to be working with -A.

'-E pkg' does two things when 'pkg' is encountered during normal
processing (either because you specified it on the command line
or selected it with -A or -a):
-  If 'pkg' is already installed then it is ignored (and a build
   may fail if an update to this package is required).
-  if it is not installed then the build tool will abort because
   it knows the build will definitely fail without the package.

This is to prevent an update of packages that you do not want to
build, either because it is too time consuming or because you have a
special version installed that should not be overwritten or because
you know that the version in the repository is broken.

> We have a
> specific package that we always want to install last...nothing else
> depends on it.  This package is a custom tripwire package.  The idea is
> that we install all other binary rpms but exclude the tripwire package,
> then the next piece installs only the tripwire package which includes a
> post install that builds the initial database.  This is all part of a
> jumpstart/kickstart process.  So, I guess the question here is, should
> the -E option work in conjunction with the -A options?  It seems to me
> that it should, but it doesn't seem to.

It doesn't work well together with -A.

But I think it is a good idea to use the -E option also as a filter
to -A and -a, so that -EA or -Ea makes sense. For this the
search_pattern() function needs to be augmented.

Here is a patch that implements all changes:

-> don't allow a package list if -A or -a is specified.
-> don't conflict with options of already installed packages
   (still a bit questionable) but require an update instead.
-> Make -E filter the packages selected by -A/-a (and any
   wildcard pattern you specify in the package list, -A is
   the same as '*').

--------------------------------------------------------------------

--- build.pl.orig       2005-01-08 08:52:34.000000000 +0100
+++ build.pl    2005-01-08 09:32:44.000000000 +0100
@@ -114,7 +114,8 @@
 }
 
 die "openpkg:build:USAGE: $0 [-R rpm] [-r repository] [-f index.rdf] 
[-uUzZiqsSXMLWKebBg] [-P priv-cmd] [-N non-priv-cmd] [-p platform] [-Dwith ...] 
[-Ename ...] [-Hname ...] ( [-aA] | patternlist )\n"
-    unless $#ARGV >= 0 || ($#ARGV == -1 && ($opt_a || $opt_A));
+    unless ($#ARGV >= 0 && !($opt_a || $opt_A)) ||
+           ($#ARGV == -1 && ($opt_a || $opt_A));
 
 ##########################################################################
 
@@ -1596,8 +1597,7 @@
         $conflict = 1;
     }
 
-    $relmap = $env->{built}->{$pro->{prefix}} ||
-              $env->{installed}->{$pro->{prefix}};
+    $relmap = $env->{built}->{$pro->{prefix}};
     @t = get_targets($relmap, sub { 1; });
     foreach $t (@t) {
         $with = $t->{OPTIONS};
@@ -1904,18 +1904,17 @@
     if (defined $pattern) {
         @todo = map {
             my($p) = $_;
-            my($s);
+            my($s,$w);
             $s = $1 if $p =~ s/(,[^\s,]+)$//;
             if ($p =~ s/\*+$//) {
                 $p = '^'.quotemeta($p).'';
+                $w = 1;
             } else {
                 $p = '^'.quotemeta($p).'$';
             }
-            map {
-                "$_$s"
-            } grep {
-                /$p/
-            } keys %{$env->{repository}}
+            map { "$_$s" }
+            grep { /$p/ && !($w && exists $env->{exclude}->{$_}) }
+                keys %{$env->{repository}}
         } split(/\s+/,$pattern);
     } else {
         #
@@ -1925,7 +1924,9 @@
         @todo = grep {
                     my($n) = $_;
                     (ref $env->{installed}->{$n}) &&
-                    grep { $_ ne '-' } keys %{$env->{installed}->{$n}}
+                    !exists $env->{exclude}->{$n} &&
+                    grep { $_ ne '-' }
+                        keys %{$env->{installed}->{$n}}
                 } keys %{$env->{repository}};
     }
 
@@ -2720,8 +2721,9 @@
 =item B<-E> I<name>
 
 Ignore a package with the specified I<name>. This can be used to avoid
-upgrading to a broken package in the repository. There can be multiple
-B<-E> options.
+upgrading to a broken package in the repository. If you use a
+wildcard pattern or the B<-a> or B<-A> options then I<name> will not
+be selected. There can be multiple B<-E> options.
 
 =item B<-H> I<name>
 
@@ -2730,13 +2732,13 @@
 
 =item B<-a>
 
-Select all installed packages. Do not specify a pattern list together
+Select all installed packages. You cannot specify a pattern list together
 with the B<-a> option.
 
 =item B<-A>
 
-Select all packages in the repository. Do not specify a pattern list together
-with the B<-A> option.
+Select all packages in the repository. You cannot specify a pattern list
+together with the B<-A> option.
 
 =back
 
--------------------------------------------------------------------


Greetings,
-- 
                                Michael van Elst
Internet: [EMAIL PROTECTED]
                                "A potential Snark may lurk in every tree."
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
User Communication List                      [email protected]

Reply via email to