Changeset 1671 in ProjectBuilder for devel/pbmkbm


Ignore:
Timestamp:
Nov 10, 2012, 6:06:55 AM (11 years ago)
Author:
Bruno Cornec
Message:

r4928@localhost: bruno | 2012-06-07 19:07:57 +0200

  • pbmkbm now support terminfo and stop on error (off by default)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pbmkbm/bin/pbmkbm

    r1661 r1671  
    1212use strict 'vars';
    1313use Getopt::Long qw(:config auto_abbrev no_ignore_case);
     14use Carp qw/confess cluck/;
    1415use Data::Dumper;
    1516use English;
     
    200201my $appname = "pbmkbm";
    201202$ENV{'PBPROJ'} = $appname;
     203
     204$Global::pb_stop_on_error = 0;  # False by default
    202205
    203206# Initialize the syntax string
     
    218221    "boot|b=s" => \$opts{'b'},
    219222    "version|V=s" => \$opts{'V'},
     223    "stop-on-error!" => \$Global::pb_stop_on_error,
    220224) || pb_syntax(-1,0);
    221225
     
    267271# Check for command requirements
    268272#
    269 my ($req,$opt) = pb_conf_get_if("oscmd","oscmdopt");
    270 pb_check_requirements($req,$opt,$appname);
     273my ($req,$opt,$pbstoponerr) = pb_conf_get_if("oscmd","oscmdopt","pbstoponerr");
     274$Global::pb_stop_on_error = 1 if ((defined $pbstoponerr) && (defined $pbstoponerr->{$ENV{'PBPROJ'}}) && ($pbstoponerr->{$ENV{'PBPROJ'}} =~ /true/oi));
     275#pb_check_requirements($req,$opt,$appname);
    271276
    272277# After that we will need root access
     
    419424foreach my $d (split(/,/,$bdirs)) {
    420425    if (-d $d) {
    421         $targettree{$d} = "dir";
     426        $targettree{$d} = "recurdir";
    422427    } elsif (-l $d) {
    423         $targettree{$d} = "link";
     428        $targettree{$d} = "link:$d";
    424429    } else {
    425430        pb_log(1,"INFO: Directory $d doesn't exist\n");
     
    429434    $targettree{$f} = "file";
    430435}
    431 pb_log(2,"INFO: Target Tree is now: ".Dumper(%targettree)."\n");
    432436# Once the environment is made, add what is needed for this boot media to it.
    433437# Keyboard
    434438pb_mkbm_find_keyboard(\%targettree);
    435439# Terminfo
     440pb_mkbm_find_terminfo(\%targettree);
    436441# List of commands
    437442# List of dependencies
     
    444449# BootLoader and its configuration
    445450# Additional data files coming from a potential caller (MondoRescue/Mindi e.g. with fstab, LVM, mountlist, ...)
     451pb_log(1,"INFO: Target Tree is now: ".Dumper(%targettree)."\n");
    446452pb_log(1,"End of boot media creation\n");
    447453}
     
    500506die "Unable to read the keymapre $keymapre" if (not defined $keymapre);
    501507
    502 # if a direct keymap file is given as keyfile, use only the first existing one it and return
     508# if a direct keymap file is given as keyfile, use only the first existing one and return
    503509my $foundkmap = 0;
    504510foreach my $f (split(/,/,$keyfile)) {
     
    530536
    531537pb_log(1,"End of keyboard analysis\n");
     538}
     539
     540sub pb_mkbm_find_terminfo {
     541
     542my $tgtree = shift;
     543
     544pb_log(1,"Analyzing your terminfo's configuration\n");
     545my $termdir = pb_distro_get_param($pbos,pb_conf_get("ospathcmd-termdir"));
     546die "Unable to read the keymapdir $termdir" if ((not defined $termdir) || (! -d $termdir));
     547$tgtree->{$termdir} = "recurdir";
     548
     549pb_log(1,"End of terminfo analysis\n");
    532550}
    533551
Note: See TracChangeset for help on using the changeset viewer.