#!/usr/bin/perl -w use strict; use Getopt::Long; use File::Find; # Some values my $list; my $update; my @seeds_directories="/usr/share/lliurex-preseed"; sub print_list { # Files to list under @seeds_directories -f && print "$File::Find::name\n"; } sub update_debconf { # Update debconf database with debconf-set-selections system("debconf-set-selections $File::Find::name"); } my $result = GetOptions ("list" => \$list, "update" => \$update); # List if is necessary if ($list){ print "[DEBUG] List all files of preseed\n"; find(\&print_list,@seeds_directories); } if ($update){ print "[DEBUG] Update all preseed with files\n"; find(\&update_debconf,@seeds_directories); }