Browse Source

add 'rpm --makeproxy --prefix=<master>' feature

master
parent
commit
26ef3f29ca
  1. 17
      openpkg/mkproxyrpm.pl
  2. 4
      openpkg/openpkg.spec
  3. 6
      openpkg/rpmx.pl

17
openpkg/mkproxyrpm.pl

@ -31,7 +31,7 @@ use Getopt::Long;
use IO;
my $progname = "mkproxyrpm";
my $progvers = "0.9.2";
my $progvers = "0.9.3";
# parameters (defaults)
my $version = 0;
@ -42,6 +42,7 @@ my $rpm = 'rpm';
my $tmpdir = ($ENV{TMPDIR} || $ENV{TEMPDIR} || "/tmp") . "/$progname";
my $output = '.';
my $input = '-';
my $prefix = '';
# cleanup support
my @cleanup = ();
@ -130,7 +131,8 @@ my $result = GetOptions(
'v|verbose' => \$verbose,
'r|rpm=s' => \$rpm,
't|tmpdir=s' => \$tmpdir,
'o|output=s' => \$output
'o|output=s' => \$output,
'p|prefix=s' => \$prefix
) || die "option parsing failed";
if ($help) {
print "Usage: $progname [options] [FILE]\n" .
@ -140,6 +142,7 @@ if ($help) {
" -r,--rpm=FILE filesystem path to RPM program\n" .
" -t,--tmpdir=PATH filesystem path to temporary directory\n" .
" -o,--output=FILE filesystem path to output RPM file\n";
" -p,--prefix=PATH filesystem path to referenced master hierarchy\n";
exit(0);
}
if ($version) {
@ -320,7 +323,11 @@ foreach my $fl (@FL) {
&verbose("-- | VIRT $1 $lprefix$subdir$file");
}
}
&runcmd("ln -s $rprefix $tmpdir/bld$lprefix/.prefix-".$r->{NAME});
# create master-reference symbolic link
my $xprefix = $rprefix;
$xprefix = $prefix if ($prefix ne '');
&runcmd("ln -s $xprefix $tmpdir/bld$lprefix/.prefix-".$r->{NAME});
# rolling output proxy RPM package
&verbose("++ rolling output proxy RPM package");
@ -357,6 +364,7 @@ B<mkproxyrpm>
[B<--rpm>=I<FILE>]
[B<--tmpdir>=I<DIR>]
[B<--output>=I<DIR>|I<FILE>|C<->]
[B<--prefix>=I<RPREFIX>]
[I<FILE>|C<->]
=head1 DESCRIPTION
@ -401,7 +409,8 @@ I<rprefix> is the prefix of the remote B<OpenPKG> instance. This allows
one to redirect a whole package to a different B<OpenPKG> instance by
just changing the I<lprefix>C</.prefix->B<foo> symbolic link. The idea
is that later this link even could be automatically controlled by a
higher-level facility.
higher-level facility. The I<rprefix> target of the symbolic link can be
overridden at build-time with the B<--prefix>=I<RPREFIX> option.
=head1 OPTIONS

4
openpkg/openpkg.spec

@ -39,8 +39,8 @@
# o any cc(1)
# the package version and release
%define V_openpkg 20021030
%define R_openpkg 20021030
%define V_openpkg 20021118
%define R_openpkg 20021118
# the used software versions
%define V_rpm 4.0.2

6
openpkg/rpmx.pl

@ -614,7 +614,11 @@ sub op_makeproxy {
my $prefix = $CFG->{RC}->{"l_prefix"};
my $rpm = $CFG->{PRG}->{"rpm"};
my $tmpdir = $CFG->{RC}->{"_tmppath"};
exec $perl, "$prefix/lib/openpkg/mkproxyrpm.pl", "--rpm=$rpm", "--tmpdir=$tmpdir", @{$CFG->{ARG}};
my @args = @{$CFG->{ARG}};
if ($CFG->{OPT_ARG}->{"--prefix"} ne '') {
unshift(@args, "--prefix=".$CFG->{OPT_ARG}->{"--prefix"});
}
exec $perl, "$prefix/lib/openpkg/mkproxyrpm.pl", "--rpm=$rpm", "--tmpdir=$tmpdir", @args;
}
## ______________________________________________________________________

Loading…
Cancel
Save