source: lliurex-preseed/trunk/fuentes/lliurex-preseed-common.install/usr/sbin/lliurex-preseed

Last change on this file was 151, checked in by mabarracus, 4 years ago

moved code from trusty

  • Property svn:executable set to *
File size: 697 bytes
Line 
1#!/usr/bin/perl -w
2
3use strict;
4use Getopt::Long;
5use File::Find;
6
7# Some values
8my $list;
9my $update;
10my @seeds_directories="/usr/share/lliurex-preseed";
11
12
13sub print_list
14{
15        # Files to list under @seeds_directories
16        -f && print "$File::Find::name\n";
17}
18
19sub update_debconf
20{
21        # Update debconf database with debconf-set-selections
22        system("debconf-set-selections $File::Find::name");
23}
24
25
26my $result = GetOptions ("list" => \$list, 
27                         "update" => \$update);
28
29# List if is necessary
30if ($list){
31        print "[DEBUG] List all files of preseed\n";
32        find(\&print_list,@seeds_directories);
33}
34
35if ($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.