2 # debfiles -- maemian collector script
4 # Copyright (C) 1999 by Joey Hess
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, you can find it on the World Wide
18 # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
19 # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
24 ($#ARGV == 1) or fail("syntax: debfiles <pkg> <type>");
28 -e "unpacked" or fail("debfiles invoked in wrong directory");
30 use lib "$ENV{'MAEMIAN_ROOT'}/lib";
34 delete_dir('debfiles')
35 or fail("cannot rm old debfiles directory");
38 mkdir('debfiles', 0777) or fail("cannot mkdir debfiles: $!");
40 # Don't copy the whole directory, just all files in it.
41 opendir(DEBIAN, 'unpacked/debian')
42 or fail("cannot open unpacked/debian/ directory: $!");
43 while (my $file=readdir(DEBIAN)) {
45 copy_dir("unpacked/debian/$file", 'debfiles/')
46 or fail("cannot copy unpacked/debian/$file: $!");