Changeset 2396


Ignore:
Timestamp:
Mar 22, 2019, 12:54:31 AM (5 weeks ago)
Author:
bruno
Message:

Replace most of the die by confess and also uses now option --rm for docker run to avois leaving ghost ctn except in debug mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r2389 r2396  
    762762
    763763if (defined $opts{'l'}) {
    764     open(pbLOG,"> $opts{'l'}") || die "Unable to log to $opts{'l'}: $!";
     764    open(pbLOG,"> $opts{'l'}") || confess "Unable to log to $opts{'l'}: $!";
    765765    $pbLOG = \*pbLOG;
    766766    $pbdebug = 0  if ($pbdebug == -1);
     
    804804if (defined $opts{'s'}) {
    805805    $pbscript{'default'} = $opts{'s'};
    806     die "option -s requires a script having a full path name" if ($pbscript{'default'} !~ /^\//);
     806    confess "option -s requires a script having a full path name" if ($pbscript{'default'} !~ /^\//);
    807807}
    808808if (defined $opts{'a'}) {
    809809    $ENV{'PBACCOUNT'} = $opts{'a'};
    810     die "option -a requires a -s script option" if (not defined $pbscript{'default'});
     810    confess "option -a requires a -s script option" if (not defined $pbscript{'default'});
    811811}
    812812if (defined $opts{'P'}) {
     
    828828# Get Action
    829829$action = shift @ARGV;
    830 die pb_syntax(-1,1) if (not defined $action);
     830confess pb_syntax(-1,1) if (not defined $action);
    831831
    832832my ($filteredfiles, $supfiles, $defpkgdir, $extpkgdir);
     
    960960    pb_parallel_launchv(undef,"ve",undef,3,$pbimage);
    961961} elsif ($action =~ /^script2vm$/) {
    962     die "action script2vm requires a -s script option" if (not defined $pbscript{'default'});
     962    confess "action script2vm requires a -s script option" if (not defined $pbscript{'default'});
    963963    pb_script2v(\%pbscript,"vm");
    964964} elsif ($action =~ /^script2ve$/) {
    965     die "action script2ve requires a -s script option" if (not defined $pbscript{'default'});
     965    confess "action script2ve requires a -s script option" if (not defined $pbscript{'default'});
    966966    pb_script2v(\%pbscript,"ve");
    967967} elsif ($action =~ /^script2rm$/) {
    968     die "action script2rm requires a -s script option" if (not defined $pbscript{'default'});
     968    confess "action script2rm requires a -s script option" if (not defined $pbscript{'default'});
    969969    pb_script2v(\%pbscript,"rm");
    970970} elsif ($action =~ /^newver$/) {
     
    10501050    pb_setup2v("vm");
    10511051} elsif ($action =~ /^sbx2setuprm$/) {
    1052     die "This feature is limited to the pb project" if ($ENV{'PBPROJ'} ne $appname);
     1052    confess "This feature is limited to the pb project" if ($ENV{'PBPROJ'} ne $appname);
    10531053    pb_cms2build("SandBox");
    10541054    pb_setup2v("rm","SandBox");
    10551055} elsif ($action =~ /^sbx2setupve$/) {
    1056     die "This feature is limited to the pb project" if ($ENV{'PBPROJ'} ne $appname);
     1056    confess "This feature is limited to the pb project" if ($ENV{'PBPROJ'} ne $appname);
    10571057    pb_cms2build("SandBox");
    10581058    pb_setup2v("ve","SandBox");
    10591059} elsif ($action =~ /^sbx2setupvm$/) {
    1060     die "This feature is limited to the pb project" if ($ENV{'PBPROJ'} ne $appname);
     1060    confess "This feature is limited to the pb project" if ($ENV{'PBPROJ'} ne $appname);
    10611061    pb_cms2build("SandBox");
    10621062    pb_setup2v("vm","SandBox");
    10631063} elsif ($action =~ /^build2setuprm$/) {
    1064     die "This feature is limited to the pb project" if ($ENV{'PBPROJ'} ne $appname);
     1064    confess "This feature is limited to the pb project" if ($ENV{'PBPROJ'} ne $appname);
    10651065    pb_setup2v("rm","SandBox");
    10661066} elsif ($action =~ /^build2setupve$/) {
    1067     die "This feature is limited to the pb project" if ($ENV{'PBPROJ'} ne $appname);
     1067    confess "This feature is limited to the pb project" if ($ENV{'PBPROJ'} ne $appname);
    10681068    pb_setup2v("ve","SandBox");
    10691069} elsif ($action =~ /^build2setupvm$/) {
    1070     die "This feature is limited to the pb project" if ($ENV{'PBPROJ'} ne $appname);
     1070    confess "This feature is limited to the pb project" if ($ENV{'PBPROJ'} ne $appname);
    10711071    pb_setup2v("vm","SandBox");
    10721072} elsif ($action =~ /^updaterm$/) {
     
    11761176    my $pb;             # Structure to store conf info
    11771177
    1178     die "pb_cms2build requires a parameter: SandBox or CMS" if (not defined $param);
     1178    confess "pb_cms2build requires a parameter: SandBox or CMS" if (not defined $param);
    11791179
    11801180    # If Website, then pkg is only the website
     
    12441244
    12451245        if (($pbtag =~ /:/) && ($scheme =~ /svn/)) {
    1246             die "RPM doesn't support release tag with ':'. Try to svn up before running pb";
     1246            confess "RPM doesn't support release tag with ':'. Try to svn up before running pb";
    12471247        }
    12481248
    12491249        pb_log(0,"\n");
    12501250        pb_log(0,"Management of $pbpkg $pbver-$pbtag\n");
    1251         die "Unable to get env var PBDESTDIR" if (not defined $ENV{'PBDESTDIR'});
     1251        confess "Unable to get env var PBDESTDIR" if (not defined $ENV{'PBDESTDIR'});
    12521252
    12531253        my $dest = "$ENV{'PBDESTDIR'}/$pbpkg-$pbver$pbextdir";
     
    12651265        $dir = $extpkgdir->{$pbpkg} if (not defined $dir);
    12661266        $dir = $webdir->{$ENV{'PBPROJ'}} if (defined $web);
    1267         die "Variable \$dir not defined. Check the package name first.\nIf this is the one expected, please report to dev team with log of a verbose run and this info ".Dumper($defpkgdir,$extpkgdir,$webdir) if (not defined $dir);
     1267        confess "Variable \$dir not defined. Check the package name first.\nIf this is the one expected, please report to dev team with log of a verbose run and this info ".Dumper($defpkgdir,$extpkgdir,$webdir) if (not defined $dir);
    12681268        pb_log(2,"def:".Dumper($defpkgdir)."ext: ".Dumper($extpkgdir)."dir: $dir\n");
    12691269
     
    13021302        if ((defined $chglog) && (! -f "$dest/NEWS")) {
    13031303            pb_log(2,"Generating NEWS file from $chglog\n");
    1304             copy($chglog,"$dest/NEWS") || die "Unable to create $dest/NEWS";
     1304            copy($chglog,"$dest/NEWS") || confess "Unable to create $dest/NEWS";
    13051305        }
    13061306        pb_cms_log($scheme,"$ENV{'PBDIR'}/$dir",$dest,$chglog,$authors,$testver);
     
    14281428                        if ($pbos->{'type'} eq "deb") {
    14291429                            ($patchcmd,$patchopt) = pb_distro_get_param($pbos,pb_conf_get_if("ospatchcmd","ospatchopt"));
    1430                             open(SCRIPT,"> $dest/pbconf/$v/pbpatch/pbapplypatch") || die "Unable to create $dest/pbconf/$v/pbpatch/pbapplypatch";
     1430                            open(SCRIPT,"> $dest/pbconf/$v/pbpatch/pbapplypatch") || confess "Unable to create $dest/pbconf/$v/pbpatch/pbapplypatch";
    14311431                            print SCRIPT "#!/bin/bash\n";
    14321432                            print SCRIPT "set -x\n" if ($pbdebug gt 1);
     
    14781478            # In the parent, we need to get the result from the children
    14791479            $pm->wait_all_children if (defined $pbparallel);
    1480             die "Aborting, one or more of the children failed." if ((not $all_ok) && ($Global::pb_stop_on_error));
     1480            confess "Aborting, one or more of the children failed." if ((not $all_ok) && ($Global::pb_stop_on_error));
    14811481            my $made = "";
    14821482            my %h = ();
     
    15511551            pb_mkdir_p("$dest/pbconf");
    15521552            # And prepare the pbscript to execute remotely
    1553             open(SCRIPT,"> $ENV{'PBTMP'}/pbscript") || die "Unable to create $ENV{'PBTMP'}/pbscript";
     1553            open(SCRIPT,"> $ENV{'PBTMP'}/pbscript") || confess "Unable to create $ENV{'PBTMP'}/pbscript";
    15541554            print SCRIPT "#!/bin/bash\n";
    15551555            print SCRIPT "#set -x\n";
     
    15981598
    15991599        # Prepare the dest directory for archive
    1600         chdir "$ENV{'PBDESTDIR'}" || die "Unable to change dir to $ENV{'PBDESTDIR'}";
     1600        chdir "$ENV{'PBDESTDIR'}" || confess "Unable to change dir to $ENV{'PBDESTDIR'}";
    16011601        if (defined $preserve) {
    16021602            # In that case we want to preserve the original tar file for checksum purposes
     
    16221622    # Keep track of per package version
    16231623    pb_log(2,"DEBUG pkgs: ".Dumper(%pkgs)."\n");
    1624     open(PKG,"> $ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.yml") || die "Unable to create $ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.yml";
     1624    open(PKG,"> $ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.yml") || confess "Unable to create $ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.yml";
    16251625    print PKG "---\n";
    16261626    print PKG "pbpkg:\n";
     
    17091709            $ftype = "\/APKBUILD\$";
    17101710        } else {
    1711             die "Unknown OS type format $pbos->{'type'}";
     1711            confess "Unknown OS type format $pbos->{'type'}";
    17121712        }
    17131713
     
    17451745
    17461746    pb_mkdir_p("$ENV{'PBBUILDDIR'}") if (! -d "$ENV{'PBBUILDDIR'}");
    1747     chdir "$ENV{'PBBUILDDIR'}" || die "Unable to chdir to $ENV{'PBBUILDDIR'}";
     1747    chdir "$ENV{'PBBUILDDIR'}" || confess "Unable to chdir to $ENV{'PBBUILDDIR'}";
    17481748    my $made = ""; # pkgs made during build
    17491749    my $pm;
     
    17861786            # Remove in case a previous link/file was there
    17871787            unlink "$ENV{'PBBUILDDIR'}/SOURCES/".basename($src);
    1788             symlink "$src","$ENV{'PBBUILDDIR'}/SOURCES/".basename($src) || die "Unable to symlink $src in $ENV{'PBBUILDDIR'}/SOURCES";
     1788            symlink "$src","$ENV{'PBBUILDDIR'}/SOURCES/".basename($src) || confess "Unable to symlink $src in $ENV{'PBBUILDDIR'}/SOURCES";
    17891789            # We need to first extract the spec file
    17901790            my @buildfile = pb_extract_build_files($src2,"$pbpkg-$pbver$pbextdir/pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/","$ENV{'PBBUILDDIR'}/SPECS","build");
     
    18161816            }
    18171817            # Get the name of the generated packages
    1818             open(LOG,"$ENV{'PBTMP'}/system.$$.log") || die "Unable to open $ENV{'PBTMP'}/system.$$.log";
     1818            open(LOG,"$ENV{'PBTMP'}/system.$$.log") || confess "Unable to open $ENV{'PBTMP'}/system.$$.log";
    18191819            while (<LOG>) {
    18201820                chomp($_);
     
    18291829            pb_system("tar xfz $src2","Extracting pbconf");
    18301830
    1831             chdir "$pbpkg-$pbver$pbextdir" || die "Unable to chdir to $pbpkg-$pbver$pbextdir";
     1831            chdir "$pbpkg-$pbver$pbextdir" || confess "Unable to chdir to $pbpkg-$pbver$pbextdir";
    18321832            pb_rm_rf("debian");
    18331833            my $confdir = "pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}";
    1834             die "Configuration directory $confdir is not a directory\nIs os description listed in your {ve,vm,rm}list values?" if (not -d $confdir);
    1835             symlink "$confdir","debian" || die "Unable to symlink 'debian' to $confdir";
     1834            confess "Configuration directory $confdir is not a directory\nIs os description listed in your {ve,vm,rm}list values?" if (not -d $confdir);
     1835            symlink "$confdir","debian" || confess "Unable to symlink 'debian' to $confdir";
    18361836            chmod 0755,"debian/rules";
    18371837
     
    18511851                # as per http://pkg-perl.alioth.debian.org/howto/quilt.html
    18521852                # Generate Debian patch series for quilt
    1853                 open(SERIE,"> debian/patches/series") || die "Unable to write in debian/patches/series";
     1853                open(SERIE,"> debian/patches/series") || confess "Unable to write in debian/patches/series";
    18541854                $ENV{'QUILT_PATCHES'}="debian/patches";
    18551855            } else {
    18561856                # If we use dpatch to manage patches, we then setup the 00list file as well
    1857                 open(SERIE,"> debian/patches/00list") || die "Unable to write in debian/patches/00list";
     1857                open(SERIE,"> debian/patches/00list") || confess "Unable to write in debian/patches/00list";
    18581858            }
    18591859            foreach my $f (sort @f) {
     
    18841884
    18851885            # Get the name of the generated packages
    1886             open(LOG,"$ENV{'PBTMP'}/system.$$.log") || die "Unable to open $ENV{'PBTMP'}/system.$$.log";
     1886            open(LOG,"$ENV{'PBTMP'}/system.$$.log") || confess "Unable to open $ENV{'PBTMP'}/system.$$.log";
    18871887            while (<LOG>) {
    18881888                chomp();
     
    18911891                my $tmp = $1;
    18921892                #doesn't work in my case
    1893                 #die "Missing file $tmp" if (not -f "../$tmp");
     1893                #confess "Missing file $tmp" if (not -f "../$tmp");
    18941894                $made = "$made $tmp";
    18951895            }
     
    18971897            pb_log(2,"Now made is: $made\n");
    18981898
    1899             open(CTRL,"debian/control") || die "Unable to open debian/control: $!";
     1899            open(CTRL,"debian/control") || confess "Unable to open debian/control: $!";
    19001900            while (<CTRL>) {
    19011901                pb_log(3,"In loop: $_\n");
     
    19061906                #foreach my $glob (("$1\_*.changes", "$1\_*.dsc", "$1\_*.tar.gz")) {
    19071907                    #my @file = glob($glob);
    1908                     #die "Missing file for $glob" unless (@file > 0);
    1909                     #die "Too many files for $glob" if (@file > 1);
    1910                     #die "Missing file $file[0]" if (not -f $file[0]);
     1908                    #confess "Missing file for $glob" unless (@file > 0);
     1909                    #confess "Too many files for $glob" if (@file > 1);
     1910                    #confess "Missing file $file[0]" if (not -f $file[0]);
    19111911                    #$made .= " $file[0]";
    19121912                #}
     
    19161916            pb_log(2,"Finally made is: $made\n");
    19171917
    1918             chdir ".." || die "Unable to chdir to parent dir";
     1918            chdir ".." || confess "Unable to chdir to parent dir";
    19191919            pb_rm_rf("$pbpkg-$pbver$pbextdir");
    19201920        } elsif ($pbos->{'type'} eq "ebuild") {
     
    19841984            my @apkfile = pb_extract_build_files($src2,"$pbpkg-$pbver$pbextdir/pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/","$ENV{'PBBUILDDIR'}/tmp","build");
    19851985
    1986             chdir "$ENV{'PBBUILDDIR'}/tmp" || die "Unable to chdir to $ENV{'PBBUILDDIR'}/tmp";
     1986            chdir "$ENV{'PBBUILDDIR'}/tmp" || confess "Unable to chdir to $ENV{'PBBUILDDIR'}/tmp";
    19871987
    19881988            # Build
    19891989            my $keyfile = pb_ssh_get(1);
    19901990            pb_mkdir_p("$ENV{'HOME'}/.abuild");
    1991             open(CONF,"> $ENV{'HOME'}/.abuild/abuild.conf") || cluck "Unable to create the abuild conf file" && return;
     1991            open(CONF,"> $ENV{'HOME'}/.abuild/abuild.conf") || cluck "Unable to create the abuild conf file" && next;
    19921992            print CONF "PACKAGER_PRIVKEY=\"$keyfile\"\n" if (defined $keyfile);
    19931993            close(CONF);
     
    19981998            }
    19991999            # Get the name of the generated packages
    2000             open(LOG,"$ENV{'PBTMP'}/system.$$.log") || die "Unable to open $ENV{'PBTMP'}/system.$$.log";
     2000            open(LOG,"$ENV{'PBTMP'}/system.$$.log") || confess "Unable to open $ENV{'PBTMP'}/system.$$.log";
    20012001            while (<LOG>) {
    20022002                chomp($_);
     
    20132013            pb_system("tar xfz $src","Extracting sources");
    20142014            pb_system("tar xfz $src2","Extracting pbconf");
    2015             chdir "$pbpkg-$pbver$pbextdir" || die "Unable to chdir to $pbpkg-$pbver$pbextdir";
    2016             symlink "pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}","install" || die "Unable to symlink to pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}";
     2015            chdir "$pbpkg-$pbver$pbextdir" || confess "Unable to chdir to $pbpkg-$pbver$pbextdir";
     2016            symlink "pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}","install" || confess "Unable to symlink to pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}";
    20172017            if (-x "install/pbslack") {
    20182018                pb_system("./install/pbslack","Building software");
    20192019                pb_system("sudo /sbin/makepkg -p -l y -c y $pbpkg","Packaging $pbpkg","verbose");
    20202020            }
    2021             chdir ".." || die "Unable to chdir to parent dir";
     2021            chdir ".." || confess "Unable to chdir to parent dir";
    20222022            pb_rm_rf("$pbpkg-$pbver$pbextdir");
    20232023        } elsif ($pbos->{'type'} eq "pkg") {
     
    20372037            pb_extract_build_files($src2,"$pbpkg-$pbver$pbextdir/pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/pbsrc/","$ENV{'PBBUILDDIR'}","src");
    20382038
    2039             chdir "$pbpkg-$pbver$pbextdir" || die "Unable to chdir to $pbpkg-$pbver$pbextdir";
     2039            chdir "$pbpkg-$pbver$pbextdir" || confess "Unable to chdir to $pbpkg-$pbver$pbextdir";
    20402040            if (-f "pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/pbbuild") {
    20412041                chmod 0755,"pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/pbbuild";
    20422042                # pkginfo file is mandatory
    2043                 die "Unable to find pkginfo file in pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}" if (! -f "pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/pkginfo");
     2043                confess "Unable to find pkginfo file in pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}" if (! -f "pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/pkginfo");
    20442044                # Build
    20452045                pb_system("pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/pbbuild $pkgdestdir/pbdelivery","Building software and installing under $pkgdestdir/pbdelivery");
     
    20492049                } else {
    20502050                    # No prototype provided, calculating it
    2051                     open(PROTO,"> $pkgdestdir/prototype") || die "Unable to create prototype file";
     2051                    open(PROTO,"> $pkgdestdir/prototype") || confess "Unable to create prototype file";
    20522052                    print PROTO "i pkginfo\n";
    20532053                    print PROTO "i depend\n" if (-f "pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/depend");
     
    20632063                pb_log(0,"No pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/pbbuild file found for $pbpkg-$pbver\n");
    20642064            }
    2065             chdir ".." || die "Unable to chdir to parent dir";
     2065            chdir ".." || confess "Unable to chdir to parent dir";
    20662066            pb_rm_rf("$pbpkg-$pbver$pbextdir","$ENV{'PBBUILDDIR'}/$pbos->{'type'}","$pkgdestdir");
    20672067        } elsif ($pbos->{'type'} eq "hpux") {
     
    20702070            pb_system("tar xfz $src2","Extracting pbconf");
    20712071
    2072             chdir "$pbpkg-$pbver$pbextdir" || die "Unable to chdir to $pbpkg-$pbver$pbextdir";
     2072            chdir "$pbpkg-$pbver$pbextdir" || confess "Unable to chdir to $pbpkg-$pbver$pbextdir";
    20732073            pb_system("buildpackage ","Building package","verbose");
    20742074            # Get the name of the generated packages
    2075             open(LOG,"$ENV{'PBTMP'}/system.$$.log") || die "Unable to open $ENV{'PBTMP'}/system.$$.log";
     2075            open(LOG,"$ENV{'PBTMP'}/system.$$.log") || confess "Unable to open $ENV{'PBTMP'}/system.$$.log";
    20762076            while (<LOG>) {
    20772077                chomp();
     
    20842084            $made="$made $pbpkg-$pbver-$pbtag.sd";
    20852085
    2086             chdir ".." || die "Unable to chdir to parent dir";
     2086            chdir ".." || confess "Unable to chdir to parent dir";
    20872087            pb_rm_rf("$pbpkg-$pbver$pbextdir");
    20882088        } else {
    2089             die "Unknown OS type format $pbos->{'type'}";
     2089            confess "Unknown OS type format $pbos->{'type'}";
    20902090        }
    20912091        if (defined $pbparallel) {
     
    21012101            $made .= " ".pb_get_content($f);
    21022102        }
    2103         die "Aborting, one or more of the children failed." if ((not $all_ok) && ($Global::pb_stop_on_error));
     2103        confess "Aborting, one or more of the children failed." if ((not $all_ok) && ($Global::pb_stop_on_error));
    21042104        pb_rm_rf($tmpd);
    21052105    }
     
    21502150    # Keep track of what is generated so that we can get them back from VMs/RMs
    21512151    my $pbstore = "$ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}-$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}";
    2152     open(KEEP,"> $pbstore") || die "Unable to create $pbstore $!";
     2152    open(KEEP,"> $pbstore") || confess "Unable to create $pbstore $!";
    21532153    print KEEP "$made\n";
    21542154    close(KEEP);
     
    22472247
    22482248        pb_mkdir_p("$ENV{'PBBUILDDIR'}") if (! -d "$ENV{'PBBUILDDIR'}");
    2249         chdir "$ENV{'PBBUILDDIR'}" || die "Unable to chdir to $ENV{'PBBUILDDIR'}";
     2249        chdir "$ENV{'PBBUILDDIR'}" || confess "Unable to chdir to $ENV{'PBBUILDDIR'}";
    22502250        foreach my $pbpkg (@pkgs) {
    22512251            my $vertag = $pkg->{$pbpkg};
     
    22962296    } elsif ($cmt eq "Packages") {
    22972297        # Get package list from file made during build2pkg
    2298         open(KEEP,"$ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}-$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}") || die "Unable to read $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}-$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}";
     2298        open(KEEP,"$ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}-$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}") || confess "Unable to read $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}-$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}";
    22992299        $src = <KEEP>;
    23002300        chomp($src);
     
    23882388            $tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}";
    23892389        } else {
    2390             die "Please teach the dev team where to deliver ($pbos->{'type'} type of packages\n";
     2390            confess "Please teach the dev team where to deliver ($pbos->{'type'} type of packages\n";
    23912391        }
    23922392
     
    24042404        # That script should be part of the delivery
    24052405        $src = "$src $pbscript{$v}";
    2406         open(PBS,"> $pbscript{$v}") || die "Unable to create $pbscript{$v}";
     2406        open(PBS,"> $pbscript{$v}") || confess "Unable to create $pbscript{$v}";
    24072407        if ($pbos->{'type'} eq "rpm") {
    24082408            my $pbsha = pb_distro_get_param($pbos,pb_conf_get("ossha"));
     
    26912691            # the context is in an empty temp dir
    26922692            my $tmpd = "$context/Dockerfile";
    2693             open(DOCKER, "> $tmpd") || die "Unable to create the docker file $tmpd";
     2693            open(DOCKER, "> $tmpd") || confess "Unable to create the docker file $tmpd";
    26942694            print DOCKER "FROM $tag{$pbstep}\n";
    26952695            print DOCKER "MAINTAINER project-builder.org aka pb\n";
     
    27062706            } else {
    27072707                # As we are in run phase use docker run. cmd will be completed below
    2708                 $shcmd = "$cmd1 run --cidfile=\"$cidfile\" --user $dkaccount --name $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}-$cmt";
     2708                my $rmatend = "--rm" if ($pbdebug lt 1);
     2709                $shcmd = "$cmd1 run $rmatend --cidfile=\"$cidfile\" --user $dkaccount --name $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}-$cmt";
    27092710            }
    27102711            #$shcmd = "$cmd1 build $dockeropt->{$ENV{'PBPROJ'}} -t $tag{$pbstep+1} $context";
     
    27132714        if (($cmt =~ /VE/) && ($vetype ne "docker")) {
    27142715            # We need to get the home dir of the target account to deliver in the right place
    2715             open(PASS,"$tpdir/etc/passwd") || die "Unable to open $tpdir/etc/passwd: $!";
     2716            open(PASS,"$tpdir/etc/passwd") || confess "Unable to open $tpdir/etc/passwd: $!";
    27162717            while (<PASS>) {
    27172718                my ($c1,$c2,$c3,$c4,$c5,$c6,$c7) = split(/:/);
     
    27252726            if ($pbstep >= 2) {
    27262727                # We need to get the home dir of the target account to deliver in the right place
    2727                 $homedir = `$cmd1 run --cidfile="$cidfile" $tag{$pbstep} grep -E '^$dkaccount:' /etc/passwd | cut -d: -f6`;
     2728                $homedir = `$cmd1 run --rm --cidfile="$cidfile" $tag{$pbstep} grep -E '^$dkaccount:' /etc/passwd | cut -d: -f6`;
    27282729                chomp($homedir);
    2729                 open(CID,"$cidfile") || cluck "Unable to open $cidfile" && return;
     2730                open(CID,"$cidfile") || cluck "Unable to open $cidfile";
    27302731                my $cid = <CID>;
    27312732                close(CID);
    2732                 pb_system("$cmd1 rm $cid","","quiet");
    27332733                unlink("$cidfile");
    27342734            } else {
     
    27982798        my $pbextdir = pb_get_extdir();
    27992799        if (not defined $pkg) {
    2800             cluck "Unable to get package list";
    2801             return
     2800            cluck "Unable to get package list from $ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.yml";
     2801            return;
    28022802        }
    28032803
     
    29562956            pb_exit(-1);
    29572957        } else {
    2958             open(KEEP,"$ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$") || die "Unable to read $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$";
     2958            open(KEEP,"$ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$") || confess "Unable to read $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$";
    29592959            my $src = <KEEP>;
    29602960            chomp($src);
     
    29742974            }   
    29752975
    2976             open(KEEP,"> $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}-$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}") || die "Unable to write $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}-$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}";
     2976            open(KEEP,"> $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}-$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}") || confess "Unable to write $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}-$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}";
    29772977            foreach my $p (split(/ +/,$src)) {
    29782978                my $j = basename($p);
     
    29852985            if (($cmt =~ /^VE/) && ($vetype eq "docker") && ($pbstep >= 3)) {
    29862986                pb_rm_rf("$cp2target");
    2987                 pb_system("$cmd1 rm $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}-$cmt","","quiet");
     2987                if ($pbdebug ge 1) {
     2988                    pb_log(2,"WARNING: Container  $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}-$cmt NOT removed\n");
     2989                }
    29882990            } else {
    29892991                pb_system("$shcmdbase \"rm -rf $tdir $bdir\"","$cmt cleanup");
     
    30173019                    pb_log(1,"ADVISE: Install Net::Telnet to benefit from monitoring control and snapshot feature.\nWARNING: No snapshot created");
    30183020                } else {
    3019                     my $t = new Net::Telnet (Timeout => 120, Host => "localhost", Port => $vmmonport->{$ENV{'PBPROJ'}}) || die "Unable to dialog on the monitor";
     3021                    my $t = new Net::Telnet (Timeout => 120, Host => "localhost", Port => $vmmonport->{$ENV{'PBPROJ'}}) || confess "Unable to dialog on the monitor";
    30203022                    # move to monitor mode
    30213023                    my @lines = $t->cmd("c");
     
    31433145}
    31443146$pm->wait_all_children if (defined $pbparallel);
    3145 die "Aborting, one or more of the children failed." if ((not $all_ok) && ($Global::pb_stop_on_error));
     3147confess "Aborting, one or more of the children failed." if ((not $all_ok) && ($Global::pb_stop_on_error));
    31463148}
    31473149
     
    31653167
    31663168# Check that v exists
    3167 die "No VM/VE/RM defined, unable to launch" if (not defined $v);
     3169confess "No VM/VE/RM defined, unable to launch" if (not defined $v);
    31683170
    31693171# If creation or snapshot creation mode, no snapshot usable
     
    32673269    } elsif ($vmtype eq "vmware") {
    32683270    } else {
    3269         die "VM of type $vmtype not supported. Report to the dev team";
     3271        confess "VM of type $vmtype not supported. Report to the dev team";
    32703272    }
    32713273    # Restore the ENV VAR Value
     
    32793281    if (! $vexist) {
    32803282        if ($pbstep == 0) {
    3281             die("Found an existing Virtual machine $vmm. Won't overwrite") if (-r $vmm);
     3283            confess("Found an existing Virtual machine $vmm. Won't overwrite") if (-r $vmm);
    32823284            if (($vmtype eq "qemu") || ($vmtype eq "xen") || ($vmtype eq "kvm")) {
    32833285                my $command = pb_check_req("qemu-img",0);
     
    34633465    #
    34643466    # Prepare the script to be executed on the VM/VE/RM
    3465     open(SCRIPT,"> $pbscript{$v}") || die "Unable to create $pbscript{$v}";
     3467    open(SCRIPT,"> $pbscript{$v}") || confess "Unable to create $pbscript{$v}";
    34663468    print SCRIPT "#!/bin/bash\n";
    34673469
     
    35763578}
    35773579$pm->wait_all_children if (defined $pbparallel);
    3578 die "Aborting, one or more of the children failed." if ((not $all_ok) && ($Global::pb_stop_on_error));
     3580confess "Aborting, one or more of the children failed." if ((not $all_ok) && ($Global::pb_stop_on_error));
    35793581
    35803582# Launch the VM/VE/RM
     
    35893591
    35903592    my $sleep=10;
    3591     die "Unable to get env var PBDESTDIR" if (not defined $ENV{'PBDESTDIR'});
    3592     die "Unable to get env var PBBUILDDIR" if (not defined $ENV{'PBBUILDDIR'});
     3593    confess "Unable to get env var PBDESTDIR" if (not defined $ENV{'PBDESTDIR'});
     3594    confess "Unable to get env var PBBUILDDIR" if (not defined $ENV{'PBBUILDDIR'});
    35933595    pb_log(0,"We will now wait $sleep s before removing both directories\n$ENV{'PBDESTDIR'} and $ENV{'PBBUILDDIR'}.\nPlease break me if this is wrong\n");
    35943596    sleep $sleep;
     
    35993601sub pb_newver {
    36003602
    3601     die "-V Version parameter needed" if ((not defined $newver) || ($newver eq ""));
     3603    confess "-V Version parameter needed" if ((not defined $newver) || ($newver eq ""));
    36023604
    36033605    # Need this call for PBDIR
     
    36123614
    36133615    if ($scheme !~ /^svn/) {
    3614         die "Only SVN is supported at the moment";
     3616        confess "Only SVN is supported at the moment";
    36153617    }
    36163618
    36173619    my $res = pb_vcs_isdiff($scheme,$ENV{'PBROOTDIR'});
    3618     die "ERROR: No differences accepted in CMS for $ENV{'PBROOTDIR'} before creating a new version" if ($res != 0);
     3620    confess "ERROR: No differences accepted in CMS for $ENV{'PBROOTDIR'} before creating a new version" if ($res != 0);
    36193621
    36203622    $res = pb_vcs_isdiff($scheme2,$ENV{'PBDIR'});
    3621     die "ERROR: No differences accepted in CMS for $ENV{'PBDIR'} before creating a new version" if ($res != 0);
     3623    confess "ERROR: No differences accepted in CMS for $ENV{'PBDIR'} before creating a new version" if ($res != 0);
    36223624
    36233625    # Tree identical between PBCONFDIR and PBROOTDIR. The delta is what
     
    36523654
    36533655    # Update the .yml file
    3654     open(FILE,"$ENV{'PBCONFDIR'}/$newver/$ENV{'PBPROJ'}.yml") || die "Unable to open $ENV{'PBCONFDIR'}/$newver/$ENV{'PBPROJ'}.yml";
    3655     open(OUT,"> $ENV{'PBCONFDIR'}/$newver/$ENV{'PBPROJ'}.yml.new") || die "Unable to write to $ENV{'PBCONFDIR'}/$newver/$ENV{'PBPROJ'}.yml.new";
     3656    open(FILE,"$ENV{'PBCONFDIR'}/$newver/$ENV{'PBPROJ'}.yml") || confess "Unable to open $ENV{'PBCONFDIR'}/$newver/$ENV{'PBPROJ'}.yml";
     3657    open(OUT,"> $ENV{'PBCONFDIR'}/$newver/$ENV{'PBPROJ'}.yml.new") || confess "Unable to write to $ENV{'PBCONFDIR'}/$newver/$ENV{'PBPROJ'}.yml.new";
    36563658    while(<FILE>) {
    36573659        if (/^projver\s+$ENV{'PBPROJ'}\s*=\s*$oldvertxt$/) {
     
    36793681        my $f2 = $f;
    36803682        $f2 =~ s|$ENV{'PBROOTDIR'}|$ENV{'PBCONFDIR'}/$newver/|;
    3681         open(PBCL,$f) || die "Unable to open $f";
     3683        open(PBCL,$f) || confess "Unable to open $f";
    36823684        my $foundnew = 0;
    36833685        while (<PBCL>) {
     
    36853687        }
    36863688        close(PBCL);
    3687         open(OUT,"> $f2") || die "Unable to write to $f2: $!";
    3688         open(PBCL,$f) || die "Unable to open $f";
     3689        open(OUT,"> $f2") || confess "Unable to write to $f2: $!";
     3690        open(PBCL,$f) || confess "Unable to open $f";
    36893691        # We skip as long as we do not reach the new version in the log (case of devel)
    36903692        my $skip = 1;
     
    38003802
    38013803    pb_log(2,"Preparing setup script for $v in $pbscript{$v}\n");
    3802     open(SCRIPT,"> $pbscript{$v}") || die "Unable to create $pbscript{$v}";
     3804    open(SCRIPT,"> $pbscript{$v}") || confess "Unable to create $pbscript{$v}";
    38033805   
    38043806    print SCRIPT << 'EOF';
     
    38513853        my $useless = 0;
    38523854    } else {
    3853         die "Unknown virtual type $vtype";
     3855        confess "Unknown virtual type $vtype";
    38543856    }
    38553857
     
    40964098            my ($pkg) = pb_conf_read("$ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.yml","pbpkg");
    40974099            $pbextdir = pb_get_extdir();
    4098             die "Unable to get package list" if (not defined $pkg);
     4100            confess "Unable to get package list" if (not defined $pkg);
    40994101
    41004102            # We consider 2 specific packages
     
    41484150    } else {
    41494151        # Unknown install type
    4150         die("Unknown install type $itype->{$ENV{'PBPROJ'}} for param pbinstalltype");
     4152        confess("Unknown install type $itype->{$ENV{'PBPROJ'}} for param pbinstalltype");
    41514153    }
    41524154    print SCRIPT << 'EOF';
     
    41814183            my $f = "$d/$m";
    41824184            if (-f "$f") {
    4183                 open(PBD,"$f") || die "Unable to open $f: $!";
     4185                open(PBD,"$f") || confess "Unable to open $f: $!";
    41844186                while (<PBD>) {
    41854187                    next if (/^package/);
     
    42094211}
    42104212$pm->wait_all_children if (defined $pbparallel);
    4211 die "Aborting, one or more of the children failed." if ((not $all_ok) && ($Global::pb_stop_on_error));
     4213confess "Aborting, one or more of the children failed." if ((not $all_ok) && ($Global::pb_stop_on_error));
    42124214
    42134215# These build scripts need to be run as root and force stop of VM at end
     
    42494251
    42504252    # Prepare the script to be executed on the VM/VE
    4251     open(SCRIPT,"> $pbscript") || die "Unable to create $pbscript";
     4253    open(SCRIPT,"> $pbscript") || confess "Unable to create $pbscript";
    42524254    print SCRIPT << 'EOF';
    42534255    #!/bin/bash
     
    42834285    # Prepare the script to be executed on the VM/VE/RM
    42844286    # in $ENV{'PBDESTDIR'}/updatev
    4285     open(SCRIPT,"> $pbscript") || die "Unable to create $pbscript";
     4287    open(SCRIPT,"> $pbscript") || confess "Unable to create $pbscript";
    42864288   
    42874289    print SCRIPT << 'EOF';
     
    43954397            $chglog = undef if (! -f $chglog);
    43964398
    4397             open(OUT,"> $ENV{'PBTMP'}/$pbpkg.ann") || die "Unable to create $ENV{'PBTMP'}/$pbpkg.ann: $!";
     4399            open(OUT,"> $ENV{'PBTMP'}/$pbpkg.ann") || confess "Unable to create $ENV{'PBTMP'}/$pbpkg.ann: $!";
    43984400            my $pb;
    43994401            $pb->{'realpkg'} = $pbrealpkg;
     
    44454447
    44464448    # Prepare the command to run and execute it
    4447     open(PBS,"> $ENV{'PBTMP'}/pbscript") || die "Unable to create $ENV{'PBTMP'}/pbscript";
     4449    open(PBS,"> $ENV{'PBTMP'}/pbscript") || confess "Unable to create $ENV{'PBTMP'}/pbscript";
    44484450    print PBS "#!/bin/bash\n";
    44494451    print PBS "set -x\n" if ($pbdebug gt 1);
     
    44624464
    44634465        # Prepare a template of announce
    4464         open(ANN,"> $ENV{'PBTMP'}/announce.html") || die "Unable to create $ENV{'PBTMP'}/announce.html: $!";
     4466        open(ANN,"> $ENV{'PBTMP'}/announce.html") || confess "Unable to create $ENV{'PBTMP'}/announce.html: $!";
    44654467        print ANN << "EOF";
    44664468$sl</p>
     
    44744476    }
    44754477
    4476     open(LOG,"$ENV{'PBTMP'}/system.$$.log") || die "Unable to read $ENV{'PBTMP'}/system.$$.log: $!";
     4478    open(LOG,"$ENV{'PBTMP'}/system.$$.log") || confess "Unable to read $ENV{'PBTMP'}/system.$$.log: $!";
    44774479    if ($antype eq "Announce") {
    44784480        my $col = 2;
     
    46184620    # Get each package changelog content
    46194621    foreach my $f (sort(@files)) {
    4620         open(IN,"$f") || die "Unable to read $f:$!";
     4622        open(IN,"$f") || confess "Unable to read $f:$!";
    46214623        while (<IN>) {
    46224624            print ANN $_;
     
    46384640    # To read whole file
    46394641    local $/;
    4640     open(ANN,"$ENV{'PBTMP'}/announce.html") || die "Unable to read $ENV{'PBTMP'}/announce.html: $!";
     4642    open(ANN,"$ENV{'PBTMP'}/announce.html") || confess "Unable to read $ENV{'PBTMP'}/announce.html: $!";
    46414643    my $announce = <ANN>;
    46424644    close(ANN);
     
    46444646    pb_log(2,"INSERT INTO announces VALUES (NULL, $pbdate, $announce)");
    46454647    my $sth = $dbh->prepare(qq{INSERT INTO announces VALUES (NULL,?,?)})
    4646                     || die "Unable to insert into db";
     4648                    || confess "Unable to insert into db";
    46474649    $sth->execute($pbdate, $announce);
    46484650    $sth->finish();
     
    46534655
    46544656    # Mail it to project's ML
    4655     open(ML,"| w3m -dump -T text/html > $ENV{'PBTMP'}/announce.txt") || die "Unable to create $ENV{'PBTMP'}/announce.txt: $!";
     4657    open(ML,"| w3m -dump -T text/html > $ENV{'PBTMP'}/announce.txt") || confess "Unable to create $ENV{'PBTMP'}/announce.txt: $!";
    46564658    print ML << 'EOF';
    46574659<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/x html1/DTD/xhtml1-strict.dtd">
     
    46634665  <p>
    46644666EOF
    4665     open(ANN,"$ENV{'PBTMP'}/announce.html") || die "Unable to read $ENV{'PBTMP'}/announce.html: $!";
     4667    open(ANN,"$ENV{'PBTMP'}/announce.html") || confess "Unable to read $ENV{'PBTMP'}/announce.html: $!";
    46664668    while(<ANN>) {
    46674669        print ML $_;
     
    46754677    # To read whole file
    46764678    local $/;
    4677     open(ANN,"$ENV{'PBTMP'}/announce.txt") || die "Unable to read $ENV{'PBTMP'}/announce.txt: $!";
     4679    open(ANN,"$ENV{'PBTMP'}/announce.txt") || confess "Unable to read $ENV{'PBTMP'}/announce.txt: $!";
    46784680    my $msg = <ANN>;
    46794681    close(ANN);
     
    47014703        if (! sendmail(%mail)) {
    47024704            if ((defined $Mail::Sendmail::error) and (defined $Mail::Sendmail::log)) {
    4703                 die "Unable to send mail ($Mail::Sendmail::error): $Mail::Sendmail::log";
     4705                confess "Unable to send mail ($Mail::Sendmail::error): $Mail::Sendmail::log";
    47044706            }
    47054707        }
     
    47464748    # Generate the HTML content
    47474749    foreach my $pref (keys %news) {
    4748         open(NEWS,"> $dest/pb_web_$pref"."news.html") || die "Unable to create $dest/pb_web_$pref"."news.html: $!";
     4750        open(NEWS,"> $dest/pb_web_$pref"."news.html") || confess "Unable to create $dest/pb_web_$pref"."news.html: $!";
    47494751        print NEWS "$news{$pref}";
    47504752        close(NEWS);
     
    47654767    my $dbh = DBI->connect("dbi:SQLite:dbname=$db","","",
    47664768                        { RaiseError => 1, AutoCommit => 1 })
    4767                         || die "Unable to connect to $db";
     4769                        || confess "Unable to connect to $db";
    47684770
    47694771    if ($precmd ne "") {
    47704772        my $sth = $dbh->prepare(qq{$precmd})
    4771                     || die "Unable to create table into $db";
     4773                    || confess "Unable to create table into $db";
    47724774        $sth->execute();
    47734775    }
     
    48694871        $vmcmd =~ s/qemu-.*/qemu/;
    48704872    }
    4871     open(PS, "ps auxhww|") || die "Unable to call ps";
     4873    open(PS, "ps auxhww|") || confess "Unable to call ps";
    48724874    while (<PS>) {
    48734875        next if (! /$vmcmd/);
     
    49004902    $res = pb_system("tar xfpj $src $dir","Extracting $mandatory files from $src",$flag);
    49014903} else {
    4902     die "Unknown compression algorithm for $src";
     4904    confess "Unknown compression algorithm for $src";
    49034905}
    49044906# If not mandatory return now
     
    49304932        push @files,pb_move_extracted_files("$dir/$f","$ddir/$f");
    49314933    } else {
    4932         move("$dir/$f","$ddir") || die "Unable to move $dir/$f to $ddir";
     4934        move("$dir/$f","$ddir") || confess "Unable to move $dir/$f to $ddir";
    49334935        pb_log(2,"mv $dir/$f $ddir\n");
    49344936        push @files,"$ddir/$f";
     
    49544956
    49554957pb_log(2,"DEBUG: entering pb_list_bfiles in $dir: ".Dumper($bfiles)."\n");
    4956 opendir($bdir,"$dir") || die "Unable to open dir $dir: $!";
     4958opendir($bdir,"$dir") || confess "Unable to open dir $dir: $!";
    49574959foreach my $f (readdir($bdir)) {
    49584960    pb_log(3,"DEBUG: pb_list_bfiles found $f\n");
     
    50475049my $nport;
    50485050
    5049 die "No port passed in parameter. Report to dev team\n" if (not defined $port);
     5051confess "No port passed in parameter. Report to dev team\n" if (not defined $port);
    50505052# key is project on VM, but machine tuple for RM
    50515053if ($cmt =~ /^RM/i) {
    5052     die "No port passed in parameter. You may miss a RM config file. Report to dev team\n" if (not defined $port->{"$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}"});
     5054    confess "No port passed in parameter. You may miss a RM config file. Report to dev team\n" if (not defined $port->{"$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}"});
    50535055    $nport = $port->{"$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}"};
    50545056} else {
    5055     die "No port passed in parameter. You may miss a VE config file or a vmport entry for $ENV{'PBPROJ'}. Report to dev team\n" if ((not defined $port->{'PBPROJ'}) and ($cmt =~ /^VE/i));
     5057    confess "No port passed in parameter. You may miss a VE config file or a vmport entry for $ENV{'PBPROJ'}. Report to dev team\n" if ((not defined $port->{'PBPROJ'}) and ($cmt =~ /^VE/i));
    50565058    $nport = $port->{$ENV{'PBPROJ'}};
    50575059}
     
    53265328# in particular we can remove duplicate in .ssh/authorized_keys of our key if needed
    53275329# Store the pub key part in a variable
    5328 open(FILE,"$keyfile.pub") || die "Unable to open $keyfile.pub";
     5330open(FILE,"$keyfile.pub") || confess "Unable to open $keyfile.pub";
    53295331my ($zero0,$zero1,$zero2) = split(/ /,<FILE>);
    53305332close(FILE);
     
    53325334my $perls = "$ENV{'PBTMP'}/perls.$$";
    53335335       
    5334 open(FILE,"> $perls") || die "Unable to open $perls";
     5336open(FILE,"> $perls") || confess "Unable to open $perls";
    53355337print FILE << 'EOF';
    53365338my $file1="$ENV{'HOME'}/.ssh/authorized_keys";
Note: See TracChangeset for help on using the changeset viewer.