2 # unpack-srcpkg-l2 -- lintian unpack script (source packages level 2)
4 # syntax: unpack-srcpkg-l2 <base-dir>
6 # Copyright (C) 1998 Christian Schwarz and Richard Braakman
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, you can find it on the World Wide
20 # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
21 # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
25 use vars qw($verbose);
28 use lib "$ENV{'LINTIAN_ROOT'}/lib";
31 ($#ARGV == 0) or fail("syntax: unpack-srcpkg-l2 <base-dir>");
34 print "N: Unpacking source package in directory $base_dir ...\n" if $verbose;
37 # We can't use spawn yet because older versions of dpkg-source print things
38 # out even with -q. This can be fixed to use spawn once that newer version of
39 # dpkg is in oldstable.
41 if (not defined $pid) {
42 fail("cannot fork: $!");
44 open(STDOUT, '>', '/dev/null');
45 exec('dpkg-source', '-q', '-x', 'dsc', 'unpacked');
49 fail("cannot run dpkg-source: $!");
54 spawn('chmod', '-R', 'u+rwX,o+rX,o-w', 'unpacked') == 0 or fail();
58 # -------------------------------
62 print STDERR "internal error: $_[0]\n";
64 print STDERR "internal error: $!\n";
66 print STDERR "internal error.\n";
72 # indent-tabs-mode: nil
73 # cperl-indent-level: 4
75 # vim: syntax=perl sw=4 sts=4 ts=4 et shiftround