aboutsummaryrefslogtreecommitdiffstats
path: root/gendistrib
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-03-14 12:47:05 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-03-14 12:47:05 +0000
commitb03f9a8c3c694ab3615e074957d9e4d6aa1d8394 (patch)
treefd17f51957de4bb93d656b92f03c30fc7d095f17 /gendistrib
parent9378fa6de7442fe2f706340ee1e7f3f775416127 (diff)
downloadrpmtools-b03f9a8c3c694ab3615e074957d9e4d6aa1d8394.tar
rpmtools-b03f9a8c3c694ab3615e074957d9e4d6aa1d8394.tar.gz
rpmtools-b03f9a8c3c694ab3615e074957d9e4d6aa1d8394.tar.bz2
rpmtools-b03f9a8c3c694ab3615e074957d9e4d6aa1d8394.tar.xz
rpmtools-b03f9a8c3c694ab3615e074957d9e4d6aa1d8394.zip
Build hdlists in temporary locations
Diffstat (limited to 'gendistrib')
-rwxr-xr-xgendistrib9
1 files changed, 7 insertions, 2 deletions
diff --git a/gendistrib b/gendistrib
index cd88219..cd4404c 100755
--- a/gendistrib
+++ b/gendistrib
@@ -28,7 +28,8 @@ use Getopt::Long;
use Distribconf::Build;
my $urpm = new URPM;
-my $headers_dir = (-d $ENV{TMPDIR} ? $ENV{TMPDIR} : -d "$ENV{HOME}/tmp" ? "$ENV{HOME}/tmp" : "/tmp") . "/.build_hdlist";
+my $tempdir = -d $ENV{TMPDIR} ? $ENV{TMPDIR} : -d "$ENV{HOME}/tmp" ? "$ENV{HOME}/tmp" : "/tmp";
+my $headers_dir = $tempdir . "/.build_hdlist";
sub usage {
print STDERR <<EOF;
@@ -182,6 +183,8 @@ foreach (0..$#hdlists) {
print STDERR "clean data for second pass\n" unless $nooutput;
$urpm->unresolved_provides_clean;
+#- temporary file where to build hdlists
+my $temp_hdlist = $tempdir . '/hdlist' . $$;
foreach (0..$#hdlists) {
my $e = $hdlists[$_];
@@ -195,11 +198,13 @@ foreach (0..$#hdlists) {
$urpm->compute_deps;
print STDERR qq(building hdlist for medium "$e->{descr}"\n) unless $nooutput;
+ unlink $temp_hdlist;
$urpm->build_hdlist(start => $start,
end => $end,
dir => $headers_dir,
- hdlist => $e->{hdlist},
+ hdlist => $temp_hdlist,
ratio => 9);
+ system('/bin/mv', $temp_hdlist, $e->{hdlist});
print STDERR qq(building synthesis for medium "$e->{descr}"\n) unless $nooutput;
$urpm->build_synthesis(start => $start,