OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Thomas Lotterer
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-tools Date: 04-Feb-2005 15:11:25
Branch: HEAD Handle: 2005020414112500
Modified files:
openpkg-tools/cmd bf-mk.pl src2make.pl
Log:
allow specification of rpm(8) and rpm2cpio(8) for MASTER through
config file and set appropriate default
Summary:
Revision Changes Path
1.13 +2 -0 openpkg-tools/cmd/bf-mk.pl
1.9 +16 -15 openpkg-tools/cmd/src2make.pl
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-tools/cmd/bf-mk.pl
============================================================================
$ cvs diff -u -r1.12 -r1.13 bf-mk.pl
--- openpkg-tools/cmd/bf-mk.pl 4 Feb 2005 09:40:08 -0000 1.12
+++ openpkg-tools/cmd/bf-mk.pl 4 Feb 2005 14:11:25 -0000 1.13
@@ -725,6 +725,8 @@
shtool "%{openpkg} shtool";
src2make "%{openpkg} src2make";
rpm "%{openpkg} rpm";
+ rpm2cpio "%{openpkg} rpm2cpio";
+ cpio "cpio";
bfmk "%{openpkg} bf-mk";
bfui "%{openpkg} bf-ui";
bfdb "%{openpkg} bf-db";
@@ .
patch -p0 <<'@@ .'
Index: openpkg-tools/cmd/src2make.pl
============================================================================
$ cvs diff -u -r1.8 -r1.9 src2make.pl
--- openpkg-tools/cmd/src2make.pl 2 Feb 2005 21:03:14 -0000 1.8
+++ openpkg-tools/cmd/src2make.pl 4 Feb 2005 14:11:25 -0000 1.9
@@ -138,27 +138,28 @@
" -C|--config=FILE specifiy config file ($config)\n";
exit(0);
}
+
+# handle config
+my $cfg = &readconfig($config);
+my $dbfile = $cfg->{"master"}->{"dbfile"} || die "mandatory
setting master.dbfile undefined";
+my $lockretries = $cfg->{"master"}->{"lockretries"} || 250;
+my $rpm = $cfg->{"master"}->{"rpm"} || "$prefix/bin/openpkg
rpm";
+my $rpm2cpio = $cfg->{"master"}->{"rpm2cpio"} || "$prefix/bin/openpkg
rpm2cpio";
+my $cpio = $cfg->{"master"}->{"cpio"} || "cpio";
+
+$rpm = &fullpath($rpm) unless ($rpm =~ m|/|);
+$rpm2cpio = &fullpath($rpm2cpio) unless ($rpm2cpio =~ m|/|);
+$cpio = &fullpath($cpio) unless ($cpio =~ m|/|);
+
$outdir = $srcdir if ($outdir eq '');
if ($prefix eq '' or $srcdir eq '') {
die "at least --prefix and --srcdir have to be specified";
}
-if (not (-x "$prefix/bin/openpkg" and -x "$prefix/libexec/openpkg/rpm" and
-x "$prefix/libexec/openpkg/rpm2cpio")) {
- die "programs 'rpm' and 'rpm2cpio' not found under OpenPKG hierarchy
'$prefix'";
-}
-my $cpio;
-if (($cpio = &fullpath("cpio")) eq '') {
- die "program 'cpio' not found in PATH";
-}
if (not -d $tmpdir) {
mkdir($tmpdir, 0700) || die "cannot create temporary directory
'$tmpdir'";
&cleanup_remember("rm -rf $tmpdir");
}
-# handle config
-my $cfg = &readconfig($config);
-my $dbfile = $cfg->{"master"}->{"dbfile"} || die "mandatory
setting master.dbfile undefined";
-my $lockretries = $cfg->{"master"}->{"lockretries"} || 250;
-
# open and initialize database
my $dbh = &dbinit($dbfile);
@@ -214,7 +215,7 @@
$q .= "S-$t:<%{$t}>\n";
}
$q .= "[M-BuildPreReq:<%{REQUIRENAME}
%|REQUIREFLAGS?{%{REQUIREFLAGS:depflags} %{REQUIREVERSION}}:{}|>\n]";
- my $o = `$prefix/bin/openpkg rpm -qp --qf "$q" $srcdir/$srcrpm
2>/dev/null`;
+ my $o = `$rpm -qp --qf "$q" $srcdir/$srcrpm 2>/dev/null`;
$o =~ s|M-BuildPreReq:<rpmlib\(.*?\).*?>\n||gs;
my $r = &parseresponse($o);
my $pkg_name = $r->{Name};
@@ -285,7 +286,7 @@
&verbose(sprintf "cache dirty (md5 mismatch): discard whole cache
content, read original source and cache it");
system("rm -rf $tmpdir/$srcrpm_name >/dev/null 2>&1 || true");
mkdir("$tmpdir/$srcrpm_name", 0755) || die "cannot create temporary
directory '$tmpdir/$srcrpm_name'";
- &runcmd("$prefix/bin/openpkg rpm2cpio $srcdir/$srcrpm | (cd
$tmpdir/$srcrpm_name && $cpio -idvmu $srcrpm_name.spec $srcrpm_name.sh
>/dev/null 2>&1)");
+ &runcmd("$rpm2cpio $srcdir/$srcrpm | (cd $tmpdir/$srcrpm_name &&
$cpio -idvmu $srcrpm_name.spec $srcrpm_name.sh >/dev/null 2>&1)");
if (not -f "$tmpdir/$srcrpm_name/$srcrpm_name.spec") {
print STDERR "$progname: failed to extract '$srcrpm_name.spec'
from '$srcdir/$srcrpm' - skipping\n";
next SRCRPM;
@@ -297,7 +298,7 @@
$o = &cacheread("$tmpdir/$srcrpm_name/o");
if ($o eq "") {
&verbose(sprintf "cache dirty (o not cached): execute original query
and cache it");
- $o = `cd $tmpdir/$srcrpm_name && $prefix/bin/openpkg rpm -q --qf
"$q" --define '_sourcedir .' --define '_specdir .' --specfile $srcrpm_name.spec
2>/dev/null`;
+ $o = `cd $tmpdir/$srcrpm_name && $rpm -q --qf "$q" --define
'_sourcedir .' --define '_specdir .' --specfile $srcrpm_name.spec 2>/dev/null`;
$o =~ s|M-PreReq:<rpmlib\(.*?\).*?>\n||gs;
&cachewrite("$tmpdir/$srcrpm_name/o", $o);
}
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]