- Timestamp:
- 08/03/15 17:07:09 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/debbuild
r196 r198 363 363 if ($cmdopts{type} eq 't') { 364 364 # Need to unpack the tarball to find the spec file. Sort of the inverse of -b above. 365 # Note that rpmbuild doesn't seem to support this operation from a .zip file, so neither will we. 365 366 # zcat $tarball |tar -t |grep .spec 366 367 # collect some info about the tarball … … 913 914 # Looks to be "expand -a into $aftersource and expand -b into $beforesource inside the while()" 914 915 # instead of treating them as flags like the other arguments. 916 # Known differences 915 917 # - -q appears to be somewhat positional 918 # - rpmbuild requires -n on all %setup macros, but carries the first down to %install etc, 919 # debbuild sets the global on the first call, and keeps using it for further %setup calls 916 920 917 921 $prepscript .= "cd '$topdir/BUILD'\n"; … … 922 926 if ($deftarball) { 923 927 $prepscript .= "cd '$tarballdir'\n" if $changedir; 924 $prepscript .= 928 if ($pkgdata{main}{source} =~ /\.zip$/) { 929 # .zip files are not really tarballs 930 $prepscript .= "/usr/bin/unzip". 931 ( $quietunpack ? ' -qq ' : ' ' ). 932 "'$topdir/SOURCES/$pkgdata{main}{source}'"; 933 } else { 934 $prepscript .= 925 935 ( $pkgdata{main}{source} =~ /\.tar\.gz$/ ? "/bin/gzip" : "" ). 926 936 ( $pkgdata{main}{source} =~ /\.tar\.bz2$/ ? "/bin/bzip2" : "" ). 927 937 ( $pkgdata{main}{source} =~ /\.tar\.xz$/ ? "/usr/bin/xz" : "" ). 928 938 " -dc '$topdir/SOURCES/$pkgdata{main}{source}' | /bin/tar -x". 929 ( $quietunpack ? '' : 'vv' )."f -\n". 930 qq(STATUS=\$?\nif [ \$STATUS -ne 0 ]; then\n exit \$STATUS\nfi\n); 939 ( $quietunpack ? '' : 'vv' )."f - "; 940 } 941 $prepscript .= qq(\nSTATUS=\$?\nif [ \$STATUS -ne 0 ]; then\n exit \$STATUS\nfi\n); 931 942 } 932 943 … … 934 945 if ($altsource == 1) { # -a 935 946 $prepscript .= "cd '$tarballdir'\n"; 936 $prepscript .= 947 if ($pkgdata{sources}{$snum} =~ /\.zip$/) { 948 # .zip files are not really tarballs 949 $prepscript .= "/usr/bin/unzip". 950 ( $quietunpack ? ' -qq ' : ' ' ). 951 "'$topdir/SOURCES/$pkgdata{sources}{$snum}'"; 952 } else { 953 $prepscript .= 937 954 ( $pkgdata{sources}{$snum} =~ /\.tar\.gz$/ ? "/bin/gzip" : "" ). 938 955 ( $pkgdata{sources}{$snum} =~ /\.tar\.bz2$/ ? "/bin/bzip2" : "" ). 939 956 ( $pkgdata{sources}{$snum} =~ /\.tar\.xz$/ ? "/usr/bin/xz" : "" ). 940 957 " -dc '$topdir/SOURCES/$pkgdata{sources}{$snum}' | /bin/tar -x". 941 ( $quietunpack ? '' : 'vv' )."f -\n". 942 qq(STATUS=\$?\nif [ \$STATUS -ne 0 ]; then\n exit \$STATUS\nfi\n); 958 ( $quietunpack ? '' : 'vv' )."f -"; 959 } 960 $prepscript .= qq(\nSTATUS=\$?\nif [ \$STATUS -ne 0 ]; then\n exit \$STATUS\nfi\n); 943 961 } # $altsource == 1 944 962 945 963 if ($altsource == 2) { # -b 946 $prepscript .= 964 if ($pkgdata{sources}{$snum} =~ /\.zip$/) { 965 # .zip files are not really tarballs 966 $prepscript .= "/usr/bin/unzip". 967 ( $quietunpack ? ' -qq ' : ' ' ). 968 "'$topdir/SOURCES/$pkgdata{main}{source}'"; 969 } else { 970 $prepscript .= 947 971 ( $pkgdata{sources}{$snum} =~ /\.tar\.gz$/ ? "/bin/gzip" : "" ). 948 972 ( $pkgdata{sources}{$snum} =~ /\.tar\.bz2$/ ? "/bin/bzip2" : "" ). 949 973 ( $pkgdata{sources}{$snum} =~ /\.tar\.xz$/ ? "/usr/bin/xz" : "" ). 950 974 " -dc '$topdir/SOURCES/$pkgdata{sources}{$snum}' | /bin/tar -x". 951 ( $quietunpack ? '' : 'vv' )."f -\n". 952 qq(STATUS=\$?\nif [ \$STATUS -ne 0 ]; then\n exit \$STATUS\nfi\n); 975 ( $quietunpack ? '' : 'vv' )."f -"; 976 } 977 $prepscript .= qq(\nSTATUS=\$?\nif [ \$STATUS -ne 0 ]; then\n exit \$STATUS\nfi\n); 953 978 $prepscript .= "cd '$tarballdir'\n"; 954 979 } # $altsource == 2 … … 1146 1171 $pkgdata{main}{source} =~ s|^.+/([^/]+)$|$1|; 1147 1172 $pkgdata{sources}{0} = $pkgdata{main}{source}; 1148 # .tar, .tar.gz, .tar.bz2, .tgz, .xz 1149 die "Unknown Source: header format $sval\n" if $sval !~ /\.(?:tar(?:\.(?:gz|bz2|xz))?|tgz )$/;1173 # .tar, .tar.gz, .tar.bz2, .tgz, .xz, .zip 1174 die "Unknown Source: header format $sval\n" if $sval !~ /\.(?:tar(?:\.(?:gz|bz2|xz))?|tgz|zip)$/; 1150 1175 } elsif (my ($srcnum, $src) = (/^source([0-9]+):\s*(.+)/i)) { 1151 1176 $src =~ s/\s*$//;
Note:
See TracChangeset
for help on using the changeset viewer.