Added lots more modules from lintian. Maemian appears to work.
[maemian] / unpack / unpack-srcpkg-l2
1 #!/usr/bin/perl
2 # unpack-srcpkg-l2 -- maemian unpack script (source packages level 2)
3 #
4 # syntax: unpack-srcpkg-l2 <base-dir>
5
6 # Copyright (C) 1998 Christian Schwarz and Richard Braakman
7 #
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.
12 #
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.
17 #
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,
22 # MA 02110-1301, USA.
23
24 use strict;
25 use vars qw($verbose);
26
27 use lib "$ENV{'MAEMIAN_ROOT'}/lib";
28 use Maemian::Command qw(spawn);
29 use Util;
30
31 ($#ARGV == 0) or fail("syntax: unpack-srcpkg-l2 <base-dir>");
32 my $base_dir = shift;
33
34 print "N: Unpacking source package in directory $base_dir ...\n" if $verbose;
35 chdir($base_dir);
36
37 # Ignore STDOUT of the child process because older versions of dpkg-source
38 # print things out even with -q.
39 spawn({ fail => 'error', out => '/dev/null', err => 'unpacked-errors' },
40       ['dpkg-source', '-q', '-x', 'dsc', 'unpacked']);
41
42 # fix permissions
43 spawn({ fail => 'error' },
44       ['chmod', '-R', 'u+rwX,o+rX,o-w', 'unpacked']);
45
46 # Local Variables:
47 # indent-tabs-mode: nil
48 # cperl-indent-level: 4
49 # End:
50 # vim: syntax=perl sw=4 sts=4 ts=4 et shiftround