- Timestamp:
- 11/07/05 16:32:17 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/debbuild
r12 r13 47 47 ); 48 48 my $topdir = "/usr/src/debian"; 49 my $buildroot = " /var/tmp/%{name}-%{version}-%{release}.root".int(rand(99998)+1);49 my $buildroot = "%{_tmppath}/%{name}-%{version}-%{release}.root".int(rand(99998)+1); 50 50 51 51 # "Constants" … … 108 108 109 109 die "Not enough arguments\n" if #$argv == 0; 110 111 # Snag some environment data 112 my $tmpdir; 113 if (defined $ENV{TMP} && $ENV{TMP} =~ /^(\/var)?\/tmp$/) { 114 $tmpdir = $ENV{TMP}; 115 } else { 116 $tmpdir = "/var/tmp"; 117 } 110 118 111 119 ##main … … 439 447 440 448 # create script filename 441 my $prepscriptfile = " /var/tmp/deb-tmp.prep.".int(rand(99998)+1);449 my $prepscriptfile = "$tmpdir/deb-tmp.prep.".int(rand(99998)+1); 442 450 sysopen(PREPSCRIPT, $prepscriptfile, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW) 443 451 or die $!; … … 464 472 465 473 # create script filename 466 my $buildscriptfile = " /var/tmp/deb-tmp.build.".int(rand(99998)+1);474 my $buildscriptfile = "$tmpdir/deb-tmp.build.".int(rand(99998)+1); 467 475 sysopen(BUILDSCRIPT, $buildscriptfile, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW) 468 476 or die $!; … … 490 498 491 499 # create script filename 492 my $installscriptfile = " /var/tmp/deb-tmp.inst.".int(rand(99998)+1);500 my $installscriptfile = "$tmpdir/deb-tmp.inst.".int(rand(99998)+1); 493 501 sysopen(INSTSCRIPT, $installscriptfile, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW) 494 502 or die $!; … … 520 528 521 529 # create script filename 522 my $debscriptfile = " /var/tmp/deb-tmp.pkg.".int(rand(99998)+1);530 my $debscriptfile = "$tmpdir/deb-tmp.pkg.".int(rand(99998)+1); 523 531 sysopen(DEBSCRIPT, $debscriptfile, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW) 524 532 or die $!; … … 658 666 if ($section =~ /g/) { 659 667 $macrostring =~ s/\%\{_topdir\}/$topdir/g; 660 $macrostring =~ s '%{_tmppath}'/var/tmp'g;668 $macrostring =~ s|%{_tmppath}|$tmpdir|g; 661 669 $macrostring =~ s'%{_docdir}'/usr/share/doc'g; 662 670 } # done with globals section
Note:
See TracChangeset
for help on using the changeset viewer.