Changeset 205
- Timestamp:
- 08/16/15 21:19:27 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/debbuild
r204 r205 364 364 365 365 if ($cmdopts{type} eq 't') { 366 # Need to unpack the tarball to find the spec file. Sort of the inverse of -b above. 367 # Note that rpmbuild doesn't seem to support this operation from a .zip file, so neither will we. 368 # zcat $tarball |tar -t |grep .spec 369 # collect some info about the tarball 370 $specfile = "$topdir/BUILD/". qx { zcat $tarball |tar -t |grep -e '[\.]spec\$' }; 366 # Need to unpack the $tarball to find the spec file. Sort of the inverse of 367 # -b above. Note that rpmbuild doesn't seem to support this operation from a 368 # .zip file properly, but we try our best. 369 $specfile = "$topdir/BUILD/"; 370 if ($tarball =~ /\.zip$/) { 371 # .zip files are not really tarballs 372 $specfile .= qx { /usr/bin/zipinfo -1 $tarball '*.spec' }; 373 } elsif ($tarball =~ /\.tar$/) { 374 # plain .tar files don't need to be uncompressed 375 $specfile .= qx { /bin/tar -tf $tarball --wildcards '*.spec' }; 376 } else { 377 # select the decompressor according to the file extension 378 $specfile .= 379 ( $tarball =~ /\.(?:tgz|tar\.(?:gz|Z))$/ ? 380 qx { /bin/zcat $tarball | /bin/tar -t | grep -e '[\.]spec\$' } : 381 $tarball =~ /\.tar\.bz2$/ ? 382 qx { /bin/bzcat $tarball | /bin/tar -t | grep -e '[\.]spec\$' } : 383 $tarball =~ /\.tar\.xz$/ ? 384 qx { /usr/bin/xzcat $tarball | /bin/tar -t | grep -e '[\.]spec\$' } : 385 die("Can't handle unknown file type '$tarball'.") ); 386 } 371 387 chomp $specfile; 372 my ($fileonly, $dirname) = ($tarball =~ /(([a-zA-Z0-9._-]+)\.(?:tgz|tar\.(?:gz|bz2|xz|Z)))$/);373 388 374 389 $tarball = abs_path($tarball); 375 390 ##fixme: use macro expansions for the executables 376 my $unpackcmd = "cd $topdir/BUILD; ". 377 ( $tarball =~ /\.(?:tgz|tar\.(?:gz|Z))$/ ? "/bin/gzip" : "" ). 378 ( $tarball =~ /\.tar\.bz2$/ ? "/bin/bzip2" : "" ). 379 ( $tarball =~ /\.tar\.xz$/ ? "/usr/bin/xz" : "" ). 380 " -dc $tarball |/bin/tar -xf -"; 391 my $unpackcmd = "cd $topdir/BUILD;\n"; 392 if ($tarball =~ /\.zip$/) { 393 # .zip files are not really tarballs 394 $unpackcmd .= "/usr/bin/unzip -boa $tarball"; 395 } elsif ($tarball =~ /\.tar$/) { 396 # plain .tar files don't need to be uncompressed 397 $unpackcmd .= "/bin/tar -xf $tarball"; 398 } else { 399 # select the decompressor according to the file extension 400 $unpackcmd .= 401 ( $tarball =~ /\.(?:tgz|tar\.(?:gz|Z))$/ ? "/bin/gzip" : 402 $tarball =~ /\.tar\.bz2$/ ? "/bin/bzip2" : 403 $tarball =~ /\.tar\.xz$/ ? "/usr/bin/xz" : 404 die("Can't handle unknown file type '$tarball'.") ). 405 " -dc $tarball | /bin/tar -xf -"; 406 } 381 407 382 408 system "$unpackcmd"; 383 system "cp $tarball $topdir/SOURCES/$fileonly";384 system "cp $specfile $topdir/SPECS/";409 system "cp -f $tarball $topdir/SOURCES/"; 410 system "cp -f $specfile $topdir/SPECS/"; 385 411 parse_spec(); 386 412 die "Can't build $pkgdata{main}{name}: build requirements not met.\n" … … 2045 2071 if ($sourcedrop =~ /\.zip$/) { 2046 2072 # .zip files are not really tarballs 2047 $cmdstring .= "/usr/bin/unzip ".2073 $cmdstring .= "/usr/bin/unzip -o". 2048 2074 ( $quietunpack ? ' -qq ' : ' ' ). 2049 2075 "'$topdir/SOURCES/$sourcedrop'";
Note:
See TracChangeset
for help on using the changeset viewer.