OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 19-Mar-2003 11:46:14
Branch: OPENPKG_1_STABLE Handle: 2003031910461301
Modified files: (Branch: OPENPKG_1_STABLE)
openpkg-src/openpkg-tool
openpkg-build.pl openpkg-index.pl
openpkg-tool.spec openpkg.1 openpkg.pod
Log:
MFC: update to latest version
Summary:
Revision Changes Path
1.39.2.4 +52 -24 openpkg-src/openpkg-tool/openpkg-build.pl
1.11.2.3 +6 -1 openpkg-src/openpkg-tool/openpkg-index.pl
1.27.2.7 +2 -2 openpkg-src/openpkg-tool/openpkg-tool.spec
1.4.2.1 +43 -12 openpkg-src/openpkg-tool/openpkg.1
1.10.2.3 +8 -1 openpkg-src/openpkg-tool/openpkg.pod
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg-tool/openpkg-build.pl
============================================================================
$ cvs diff -u -r1.39.2.3 -r1.39.2.4 openpkg-build.pl
--- openpkg-src/openpkg-tool/openpkg-build.pl 16 Feb 2003 09:20:17 -0000
1.39.2.3
+++ openpkg-src/openpkg-tool/openpkg-build.pl 19 Mar 2003 10:46:13 -0000
1.39.2.4
@@ -33,8 +33,8 @@
$opt_R $opt_r $opt_f $opt_u $opt_U $opt_a $opt_A
$opt_z $opt_Z $opt_P $opt_N $opt_E $opt_i $opt_D
$opt_p $opt_q $opt_s $opt_S $opt_X $opt_M $opt_L
- $opt_W $opt_K/;
-my $getopts = 'R:r:f:uUaAzZP:N:E:iD:p:qsSXMLWK';
+ $opt_W $opt_K $opt_e/;
+my $getopts = 'R:r:f:uUaAzZP:N:E:iD:p:qsSXMLWKe';
getopts($getopts);
##########################################################################
@@ -112,7 +112,7 @@
close(FH);
}
-die "openpkg:build:USAGE: $0 [-R rpm] [-r repository] [-f index.rdf]
[-uUzZiqsSXMLWK] [-P priv-cmd] [-N non-priv-cmd] [-p platform] [-Dwith ...] [-Ename
...] ( [-aA] | patternlist )\n"
+die "openpkg:build:USAGE: $0 [-R rpm] [-r repository] [-f index.rdf]
[-uUzZiqsSXMLWKe] [-P priv-cmd] [-N non-priv-cmd] [-p platform] [-Dwith ...] [-Ename
...] ( [-aA] | patternlist )\n"
unless $#ARGV >= 0 || ($#ARGV == -1 && ($opt_a || $opt_A));
##########################################################################
@@ -157,7 +157,7 @@
my($RPM,$CURL,$PROG);
$RPM = $opt_R || $env{''}->{'R'} || '@l_prefix@/bin/rpm';
-$RPM = (`which $RPM` =~ m{^(/.*)})[0];
+$RPM = (`which $RPM` =~ m{^(/.*)})[0] if ($RPM !~ m|^/|);
die "FATAL: cannot locate rpm in path\n" unless $RPM =~ m{^/};
# augment command line parameters
@@ -178,7 +178,7 @@
if (!defined $w) {
return $s;
} elsif ($w =~ /^-(.*)/) {
- return "$1 '$s'";
+ return "$1 \"$s\"";
} else {
return "$w $s";
}
@@ -618,15 +618,12 @@
} else {
if (defined $fn) {
$subfn = $fn;
- $subfn =~ s/\/[^\/]*$//;
- $subfn .= '/' unless $subfn =~ /\/$/;
- $subfn .= $suburl;
+ $subfn =~ s/(\/)?\/*[^\/]*$/$1$suburl/;
$suburl = $subfn;
} else {
$subfn = $url;
- $subfn =~ s/\/[^\/]*$//;
- $subfn .= '/' unless $subfn =~ /\/$/;
- $suburl = "$subfn$suburl";
+ $subfn =~ s/(\/)?\/*[^\/]*$/$1$suburl/;
+ $suburl = $subfn;
$subfn = undef;
}
}
@@ -1248,16 +1245,41 @@
}
#
-# test wether target could be upgraded
+# determine wether target should be rebuild
#
-sub target_newer ($$) {
- my($target, $map) = @_;
+sub target_better ($$$) {
+ my($env, $target, $map) = @_;
my($vs) = vs($target);
my($vmap) = $map->{$target->{name}};
- return 1 unless $vmap;
+ #
+ # rebuild if target isn't installed
+ #
+ return 'new' unless $vmap;
+
+ #
+ # always update GOALs
+ #
+ if ($target->{GOAL} && !grep { vcmp($vs, $_) <= 0; } keys %$vmap) {
+ return 'goal';
+ }
+ #
+ # if -e then
+ # always update if installed version is different from repository
+ #
+ if ($env->{exact} && !grep { vcmp($vs, $_) == 0; } keys %$vmap) {
+ return 'exact';
+ }
+ #
+ # if -U then
+ # always update if installed version is older than repository
+ #
+ if ($env->{upgrade} && !grep { vcmp($vs, $_) <= 0; } keys %$vmap) {
+ return 'upgrade';
+ }
- return !grep { vcmp($vs, $_) <= 0; } keys %$vmap;
+ # keep installed target
+ return;
}
#
@@ -1366,8 +1388,7 @@
$t = chose_source($env, $name, undef, $r, get_versions($r, $cond));
if ($t) {
- if (!$tdef ||
- ($env->{upgrade} && target_newer($t, $env->{installed}))) {
+ if (!$tdef || target_better($env, $t, $env->{installed})) {
return ($t, 0);
}
}
@@ -1385,7 +1406,7 @@
sub make_dep ($$$$$$$) {
my($who,$target,$depth,$env,$list,$blist,$clist) = @_;
my($d,$k,%d,%k,$t,$old);
- my(@deps,$conflict);
+ my(@deps,$conflict,$why);
if (target_exists($target, $env->{built})) {
print "# $target->{name} is already in list\n";
@@ -1421,9 +1442,9 @@
} elsif ($env->{zero}) {
target_setstatus($target,'ZERO',1);
print "# rebuilding $target->{name} (zero)\n";
- } elsif (target_newer($target, $env->{installed})) {
- target_setstatus($target,'UPGRADE',3);
- print "# rebuilding $target->{name} (upgrade)\n";
+ } elsif ($why = target_better($env, $target, $env->{installed})) {
+ target_setstatus($target,'UPDATE',3);
+ print "# rebuilding $target->{name} ($why)\n";
} elsif (!target_suitable($t, $env->{with})) {
target_setstatus($target,'MISMATCH',2);
print "# rebuilding $target->{name} (parameter mismatch)\n";
@@ -1448,6 +1469,7 @@
# mark this as a target before reverse dependencies trigger
# it again
push(@{$env->{built}->{$target->{name}}->{vs($target)}}, $target);
+ $target->{LIMBO} = 1;
$d = target_depends($target, $env->{repository});
$k = target_keeps($target, $env->{repository});
@@ -1471,6 +1493,9 @@
if ($t) {
if ($old) {
print "# $target->{name} uses ".vsn($t)." for $_\n";
+ if ($t->{LIMBO}) {
+ print "# ATTENTION: ".vsn($t)." is in LIMBO\n";
+ }
next;
}
@@ -1502,6 +1527,7 @@
$target->{WHO} = $who;
$target->{WHY} = $target->{STATUS};
push(@$list, $target);
+ $target->{LIMBO} = 0;
foreach (@{$target->{nosource}}) {
my($p) = $target->{source}->[$_];
@@ -1623,6 +1649,7 @@
if ($t) {
warn_about_options($t, $env->{with}, $env->{config});
+ $t->{GOAL} = 1;
push(@goals, $t);
} else {
if ($env->{status}) {
@@ -1643,8 +1670,8 @@
%keep = map { $_ => 1 } @keeps;
@bonly = reverse grep {
- !$keep{$_} && !$env->{installed}->{$_->{name}}->{vs($_)};
- } @targets;
+ !$keep{$_} && !$env->{installed}->{$_->{name}}
+ } @targets;
return ([EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]);
}
@@ -2044,6 +2071,7 @@
exclude => \%exclude,
upgrade => ($opt_a || $opt_U),
zero => ($opt_z || $opt_Z),
+ exact => $opt_e,
quick => $opt_q,
status => ($opt_s || $opt_S),
fatal => [],
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg-tool/openpkg-index.pl
============================================================================
$ cvs diff -u -r1.11.2.2 -r1.11.2.3 openpkg-index.pl
--- openpkg-src/openpkg-tool/openpkg-index.pl 16 Feb 2003 09:20:17 -0000
1.11.2.2
+++ openpkg-src/openpkg-tool/openpkg-index.pl 19 Mar 2003 10:46:14 -0000
1.11.2.3
@@ -939,7 +939,12 @@
}
if ($opt_C) {
- require DB_File;
+ eval {
+ require DB_File;
+ };
+ if ($@) {
+ die "Sorry. The -C option requires an installed DB_File perl module.\n";
+ }
tie %cache, 'DB_File', $opt_C, O_CREAT|O_RDWR, 0666, $DB_File::DB_HASH
or die "FATAL: cannot tie cache '$opt_C' ($!)\n";
}
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg-tool/openpkg-tool.spec
============================================================================
$ cvs diff -u -r1.27.2.6 -r1.27.2.7 openpkg-tool.spec
--- openpkg-src/openpkg-tool/openpkg-tool.spec 16 Feb 2003 09:20:17 -0000
1.27.2.6
+++ openpkg-src/openpkg-tool/openpkg-tool.spec 19 Mar 2003 10:46:14 -0000
1.27.2.7
@@ -32,8 +32,8 @@
Distribution: OpenPKG [PLUS]
Group: Bootstrapping
License: GPL
-Version: 1.20030216
-Release: 1.20030216
+Version: 1.20030319
+Release: 1.20030319
# list of sources
Source0: openpkg.sh
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg-tool/openpkg.1
============================================================================
$ cvs diff -u -r1.4 -r1.4.2.1 openpkg.1
--- openpkg-src/openpkg-tool/openpkg.1 14 Jan 2003 20:39:00 -0000 1.4
+++ openpkg-src/openpkg-tool/openpkg.1 19 Mar 2003 10:46:14 -0000 1.4.2.1
@@ -129,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title "OPENPKG 1"
-.TH OPENPKG 1 "2003-01-13" "openpkg-tool" "OpenPKG Maintainance"
+.TH OPENPKG 1 "2003-02-28" "openpkg-tool" "OpenPKG Maintainance"
.SH "NAME"
\&\fBopenpkg\fR \- \fBOpenPKG\fR maintainance utility
.SH "VERSION"
@@ -161,7 +161,11 @@
[\fB\-s\fR]
[\fB\-S\fR]
[\fB\-M\fR]
+[\fB\-L\fR]
+[\fB\-W\fR]
[\fB\-X\fR]
+[\fB\-K\fR]
+[\fB\-e\fR]
[\fB\-P\fR \fIpriv-cmd\fR]
[\fB\-N\fR \fInon-priv-cmd\fR]
[\fB\-p\fR \fIplatform\fR]
@@ -190,17 +194,15 @@
"\f(CW\*(C`OpenPKG\-CURRENT/Source/\*(C'\fR".
.IP "\fB\-p\fR \fIplatform\fR" 4
.IX Item "-p platform"
-\&\fBopenpkg index\fR adds a platform attribute for binary RPMs. The
-attribute is built as
\fI%{arch}\fR\f(CW\*(C`\-\*(C'\fR\fIplatform\fR\f(CW\*(C`\-\*(C'\fR\fI%{os}\fR where
-\&\fI%{arch}\fR and \fI%{os}\fR are taken from the \s-1RPM\s0 header and
\fIplatform\fR is
-the value of the \fB\-p\fR option. The default value is
"\f(CW\*(C`unknown\*(C'\fR". This
-must be used to distinguish between platforms that support the same
-Architecture and \s-1OS\s0 name like various Linux distributions.
+\&\fBopenpkg index\fR adds a platform attribute for binary RPMs. This
+must be unique to correctly identify a specific architecture, \s-1OS\s0
+and build environment.
.IP "\fB\-C\fR \fIcache.db\fR" 4
.IX Item "-C cache.db"
Cache all \fI.spec\fR files into this Berkeley-DB file when indexing source
RPMs. The cache is refreshed automatically when the source RPMs are more
-recent than the cache entry.
+recent than the cache entry. The \fB\-C\fR option requires an installed
+DB_File perl module.
.IP "\fB\-o\fR \fIindex.rdf\fR" 4
.IX Item "-o index.rdf"
Name of the output \s-1XML/RDF\s0 file, default is to write to \fIstdout\fR.
@@ -226,6 +228,12 @@
on the upgraded package (\*(L"reverse dependencies\*(R"). The dependency
information is read from an index generated by \fBopenpkg index\fR.
.PP
+Packages are selected by providing a list of name patterns. Each
+pattern is either a package name or a prefix followed by a '*'
+character. Additionally you can append a discrimation prefix separated
+by a comma that matches against the full name-version-revision
+string.
+.PP
The following command line options exist:
.IP "\fB\-R\fR \fIrpm\fR" 4
.IX Item "-R rpm"
@@ -320,22 +328,45 @@
.IP "\fB\-M\fR" 4
.IX Item "-M"
Similar to \fB\-s\fR but print a short dependency map.
+.IP "\fB\-L\fR" 4
+.IX Item "-L"
+Print a list of packages in the repository that depend on the target.
+.IP "\fB\-W\fR" 4
+.IX Item "-W"
+Include all conditional dependencies as if all possible configuration
+options had been switched on. This has little use except for generating
+an all-inclusive list with the \fB\-L\fR option.
+\&\fI\s-1ATTENTION:\s0 Even mutually exclusive options are evaluated to be 'on',
+building packages with \f(BI\-W\fI therefore might fail or cause unusuable
+results!\fR
.IP "\fB\-X\fR" 4
.IX Item "-X"
Ignore an installed \s-1XML\s0 parser module but use the internal
simple text parser instead.
+.IP "\fB\-K\fR" 4
+.IX Item "-K"
+Keep packages that were installed temporarily during the build process.
+.IP "\fB\-e\fR" 4
+.IX Item "-e"
+Rebuild exact version from repository even when you have installed
+a newer version from another repository.
.IP "\fB\-P\fR \fIpriv-cmd\fR" 4
.IX Item "-P priv-cmd"
Command prefix to use for install commands that require elevated
-privileges. The most common tool for this is \fIsudo\fR\|(8).
+privileges. The most common tool for this is \fIsudo\fR\|(8). If \fIpriv-cmd\fR
+starts with a dash it will be run without the dash and the command
+line it should execute is passed as a single quoted string.
.IP "\fB\-N\fR \fInon-priv-cmd\fR" 4
.IX Item "-N non-priv-cmd"
Command prefix to use for install commands that do not require elevated
-privileges. The most common tool for this is \fIsudo\fR\|(8).
+privileges. The most common tool for this is \fIsudo\fR\|(8). If \fIpriv-cmd\fR
+starts with a dash it will be run without the dash and the command
+line it should execute is passed as a single quoted string.
.IP "\fB\-p\fR \fIplatform\fR" 4
.IX Item "-p platform"
The platform string that is matched against the index for binary
-packages. Default is to use the \fI%{_target_platform}\fR variable.
+packages. Default is an empty string so that no binary packages
+are matched.
.IP "\fB\-D\fR\fIvar\fR=\fIval\fR" 4
.IX Item "-Dvar=val"
Specify configuration options for all selected packages. This can be
@@ -356,7 +387,7 @@
.IP "\fB\-A\fR" 4
.IX Item "-A"
Select all packages in the repository. Do not specify a pattern list together
-with the \fB\-a\fR option.
+with the \fB\-A\fR option.
.SH "CONFIGURATION"
.IX Header "CONFIGURATION"
\&\fBopenpkg build\fR reads the configuration file \fI$HOME/.openpkg/build\fR.
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg-tool/openpkg.pod
============================================================================
$ cvs diff -u -r1.10.2.2 -r1.10.2.3 openpkg.pod
--- openpkg-src/openpkg-tool/openpkg.pod 5 Feb 2003 16:21:30 -0000
1.10.2.2
+++ openpkg-src/openpkg-tool/openpkg.pod 19 Mar 2003 10:46:14 -0000
1.10.2.3
@@ -64,6 +64,7 @@
[B<-W>]
[B<-X>]
[B<-K>]
+[B<-e>]
[B<-P> I<priv-cmd>]
[B<-N> I<non-priv-cmd>]
[B<-p> I<platform>]
@@ -106,7 +107,8 @@
Cache all F<.spec> files into this Berkeley-DB file when indexing source
RPMs. The cache is refreshed automatically when the source RPMs are more
-recent than the cache entry.
+recent than the cache entry. The B<-C> option requires an installed
+DB_File perl module.
=item B<-o> I<index.rdf>
@@ -282,6 +284,11 @@
=item B<-K>
Keep packages that were installed temporarily during the build process.
+
+=item B<-e>
+
+Rebuild exact version from repository even when you have installed
+a newer version from another repository.
=item B<-P> I<priv-cmd>
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]