Browse Source

support NoSource for private packages

master
Michael van Elst 23 years ago committed by Ralf S. Engelschall
parent
commit
c11525a691
  1. 42
      openpkg-tool/openpkg-build.pl
  2. 18
      openpkg-tool/openpkg-index.pl
  3. 4
      openpkg-tool/openpkg-tool.spec

42
openpkg-tool/openpkg-build.pl

@ -542,7 +542,7 @@ sub get_index ($$$) {
my($name,$version);
my($href,$release,$desc);
my(@prereq,@bprereq);
my(@provides,@conflicts);
my(@provides,@conflicts,@source,@nosource);
my(%options);
my($platform,$prefix);
my($rec);
@ -566,6 +566,8 @@ sub get_index ($$$) {
@bprereq = ();
@provides = ();
@conflicts = ();
@source = ();
@nosource = ();
}
if (!(defined $href) && /<Repository.*?href="([^"]*)"/) {
@ -610,6 +612,14 @@ sub get_index ($$$) {
$section = 'conflicts' if $useit;
} elsif ($tag eq '/Conflicts') {
$section = undef;
} elsif ($tag eq 'NoSource') {
$section = 'nosource' if $useit;
} elsif ($tag eq '/NoSource') {
$section = undef;
} elsif ($tag eq 'Source') {
$section = 'nosource' if $useit;
} elsif ($tag eq '/Source') {
$section = undef;
} elsif ($tag eq 'Name') {
$name = $body;
} elsif ($tag eq 'Version') {
@ -629,6 +639,10 @@ sub get_index ($$$) {
push(@provides, $body);
} elsif ($section eq 'conflicts') {
push(@conflicts, $body);
} elsif ($section eq 'source') {
push(@source, $body);
} elsif ($section eq 'nosource') {
push(@nosource, $body);
}
} elsif ($tag eq '/rdf:Description') {
@ -661,6 +675,8 @@ sub get_index ($$$) {
depends => [ @bprereq ],
keeps => [ @prereq ],
conflicts => [ @conflicts ],
nosource => [ @source ],
nosource => [ @nosource ],
desc => $desc,
platform => $platform,
prefix => $prefix
@ -720,16 +736,18 @@ sub get_index ($$$) {
}
$rec = {
href => (relurl($url, undef, $href))[0],
name => $name,
version => $version,
release => $release,
platform => xel($_->{'Platform'}),
prefix => xel($_->{'Prefixes'}),
depends => with_list($_->{'BuildPreReq'}, $with),
keeps => with_list($_->{'PreReq'}, $with),
href => (relurl($url, undef, $href))[0],
name => $name,
version => $version,
release => $release,
platform => xel($_->{'Platform'}),
prefix => xel($_->{'Prefixes'}),
depends => with_list($_->{'BuildPreReq'}, $with),
keeps => with_list($_->{'PreReq'}, $with),
conflicts => with_list($_->{'Conflicts'}, $with),
desc => xel($_->{'Description'})
source => with_list($_->{'Source'}, $with),
nosource => with_list($_->{'NoSource'}, $with),
desc => xel($_->{'Description'})
};
$rec->{OPTIONS} =
@ -1163,6 +1181,10 @@ sub make_dep ($$$$$$) {
print "# adding ".vsn($target)." to list\n";
push(@$list, $target);
foreach (@{$target->{nosource}}) {
print "# ATTENTION: unpackaged source '$target->{source}->[$_]'\n";
}
return if $conflict;
if (!$env->{quick} &&

18
openpkg-tool/openpkg-index.pl

@ -71,7 +71,7 @@ sub e ($) {
sub commasep ($$) {
my($k,$v) = @_;
if ($k =~ /^(PreReq|BuildPreReq|Provides|Conflicts)$/) {
if ($k =~ /^(PreReq|BuildPreReq|Provides|Conflicts|NoSource)$/) {
return split(/\s*,\s*/, $v);
}
@ -295,8 +295,13 @@ sub package2data ($$) {
warn "ERROR: no package name set for option $1 = $2\n";
}
} elsif ($v =~ /^\s*([^\#]\S*)\s*:\s*(.*?)\s*$/) {
} elsif ($v =~ /^\#NoSource\s*(.*?)\s*$/) {
#
# store conditional NoSource attribute
#
push @{$attr{'NoSource'}->{$cond}}, commasep('NoSource',$1);
} elsif ($v =~ /^\s*([^\#]\S*)\s*:\s*(.*?)\s*$/) {
#
# store attribute=value for current condition
#
@ -327,7 +332,7 @@ sub spec2data ($) {
$s =~ s/^\s*#.*?\n//mg;
# map commands
$s =~ s/^%(ifdef|ifndef|if|option|define|else|endif|\{)/#$1/mg;
$s =~ s/^%(ifdef|ifndef|if|NoSource|option|define|else|endif|\{)/#$1/mg;
# split sections
foreach (split(/^(?=%\w+\s*\n)/m, $s)) {
@ -487,7 +492,11 @@ sub xml_record ($$$) {
# guess location from Information in Specfile
$href = "$about.src.rpm";
if (exists $a->{'NoSource'}) {
$href = "$about.nosrc.rpm";
} else {
$href = "$about.src.rpm";
}
($maj,$min,$rel) = n($a,'Release') =~ /^(\d+)\.(\d+)\.(\d+)/;
if (defined $min) {
@ -568,6 +577,7 @@ EOFEOF
xml_bag(6, $a, 'Provides'),
xml_bag(6, $a, 'Conflicts'),
xml_bag(6, $a, 'Source'),
xml_bag(6, $a, 'NoSource'),
xml_bag(6, $a, 'Filenames'),
xml_text(6, $a, 'Description');

4
openpkg-tool/openpkg-tool.spec

@ -32,8 +32,8 @@ Packager: The OpenPKG Project
Distribution: OpenPKG [EVAL]
Group: Bootstrapping
License: GPL
Version: 20030103
Release: 20030103
Version: 20030108
Release: 20030108
# list of sources
Source0: openpkg.sh

Loading…
Cancel
Save