Last change
on this file since 151 was
151,
checked in by mabarracus, 5 years ago
|
moved code from trusty
|
-
Property svn:executable set to
*
|
File size:
697 bytes
|
Line | |
---|
1 | #!/usr/bin/perl -w |
---|
2 | |
---|
3 | use strict; |
---|
4 | use Getopt::Long; |
---|
5 | use File::Find; |
---|
6 | |
---|
7 | # Some values |
---|
8 | my $list; |
---|
9 | my $update; |
---|
10 | my @seeds_directories="/usr/share/lliurex-preseed"; |
---|
11 | |
---|
12 | |
---|
13 | sub print_list |
---|
14 | { |
---|
15 | # Files to list under @seeds_directories |
---|
16 | -f && print "$File::Find::name\n"; |
---|
17 | } |
---|
18 | |
---|
19 | sub update_debconf |
---|
20 | { |
---|
21 | # Update debconf database with debconf-set-selections |
---|
22 | system("debconf-set-selections $File::Find::name"); |
---|
23 | } |
---|
24 | |
---|
25 | |
---|
26 | my $result = GetOptions ("list" => \$list, |
---|
27 | "update" => \$update); |
---|
28 | |
---|
29 | # List if is necessary |
---|
30 | if ($list){ |
---|
31 | print "[DEBUG] List all files of preseed\n"; |
---|
32 | find(\&print_list,@seeds_directories); |
---|
33 | } |
---|
34 | |
---|
35 | if ($update){ |
---|
36 | print "[DEBUG] Update all preseed with files\n"; |
---|
37 | find(\&update_debconf,@seeds_directories); |
---|
38 | } |
---|
39 | |
---|
40 | |
---|
Note: See
TracBrowser
for help on using the repository browser.