Changeset 2396 in ProjectBuilder
- Timestamp:
- Mar 22, 2019, 12:54:31 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r2389 r2396 762 762 763 763 if (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'}: $!"; 765 765 $pbLOG = \*pbLOG; 766 766 $pbdebug = 0 if ($pbdebug == -1); … … 804 804 if (defined $opts{'s'}) { 805 805 $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'} !~ /^\//); 807 807 } 808 808 if (defined $opts{'a'}) { 809 809 $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'}); 811 811 } 812 812 if (defined $opts{'P'}) { … … 828 828 # Get Action 829 829 $action = shift @ARGV; 830 diepb_syntax(-1,1) if (not defined $action);830 confess pb_syntax(-1,1) if (not defined $action); 831 831 832 832 my ($filteredfiles, $supfiles, $defpkgdir, $extpkgdir); … … 960 960 pb_parallel_launchv(undef,"ve",undef,3,$pbimage); 961 961 } 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'}); 963 963 pb_script2v(\%pbscript,"vm"); 964 964 } 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'}); 966 966 pb_script2v(\%pbscript,"ve"); 967 967 } 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'}); 969 969 pb_script2v(\%pbscript,"rm"); 970 970 } elsif ($action =~ /^newver$/) { … … 1050 1050 pb_setup2v("vm"); 1051 1051 } 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); 1053 1053 pb_cms2build("SandBox"); 1054 1054 pb_setup2v("rm","SandBox"); 1055 1055 } 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); 1057 1057 pb_cms2build("SandBox"); 1058 1058 pb_setup2v("ve","SandBox"); 1059 1059 } 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); 1061 1061 pb_cms2build("SandBox"); 1062 1062 pb_setup2v("vm","SandBox"); 1063 1063 } 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); 1065 1065 pb_setup2v("rm","SandBox"); 1066 1066 } 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); 1068 1068 pb_setup2v("ve","SandBox"); 1069 1069 } 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); 1071 1071 pb_setup2v("vm","SandBox"); 1072 1072 } elsif ($action =~ /^updaterm$/) { … … 1176 1176 my $pb; # Structure to store conf info 1177 1177 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); 1179 1179 1180 1180 # If Website, then pkg is only the website … … 1244 1244 1245 1245 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"; 1247 1247 } 1248 1248 1249 1249 pb_log(0,"\n"); 1250 1250 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'}); 1252 1252 1253 1253 my $dest = "$ENV{'PBDESTDIR'}/$pbpkg-$pbver$pbextdir"; … … 1265 1265 $dir = $extpkgdir->{$pbpkg} if (not defined $dir); 1266 1266 $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); 1268 1268 pb_log(2,"def:".Dumper($defpkgdir)."ext: ".Dumper($extpkgdir)."dir: $dir\n"); 1269 1269 … … 1302 1302 if ((defined $chglog) && (! -f "$dest/NEWS")) { 1303 1303 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"; 1305 1305 } 1306 1306 pb_cms_log($scheme,"$ENV{'PBDIR'}/$dir",$dest,$chglog,$authors,$testver); … … 1428 1428 if ($pbos->{'type'} eq "deb") { 1429 1429 ($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"; 1431 1431 print SCRIPT "#!/bin/bash\n"; 1432 1432 print SCRIPT "set -x\n" if ($pbdebug gt 1); … … 1478 1478 # In the parent, we need to get the result from the children 1479 1479 $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)); 1481 1481 my $made = ""; 1482 1482 my %h = (); … … 1551 1551 pb_mkdir_p("$dest/pbconf"); 1552 1552 # 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"; 1554 1554 print SCRIPT "#!/bin/bash\n"; 1555 1555 print SCRIPT "#set -x\n"; … … 1598 1598 1599 1599 # 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'}"; 1601 1601 if (defined $preserve) { 1602 1602 # In that case we want to preserve the original tar file for checksum purposes … … 1622 1622 # Keep track of per package version 1623 1623 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"; 1625 1625 print PKG "---\n"; 1626 1626 print PKG "pbpkg:\n"; … … 1709 1709 $ftype = "\/APKBUILD\$"; 1710 1710 } else { 1711 die"Unknown OS type format $pbos->{'type'}";1711 confess "Unknown OS type format $pbos->{'type'}"; 1712 1712 } 1713 1713 … … 1745 1745 1746 1746 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'}"; 1748 1748 my $made = ""; # pkgs made during build 1749 1749 my $pm; … … 1786 1786 # Remove in case a previous link/file was there 1787 1787 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"; 1789 1789 # We need to first extract the spec file 1790 1790 my @buildfile = pb_extract_build_files($src2,"$pbpkg-$pbver$pbextdir/pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/","$ENV{'PBBUILDDIR'}/SPECS","build"); … … 1816 1816 } 1817 1817 # 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"; 1819 1819 while (<LOG>) { 1820 1820 chomp($_); … … 1829 1829 pb_system("tar xfz $src2","Extracting pbconf"); 1830 1830 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"; 1832 1832 pb_rm_rf("debian"); 1833 1833 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"; 1836 1836 chmod 0755,"debian/rules"; 1837 1837 … … 1851 1851 # as per http://pkg-perl.alioth.debian.org/howto/quilt.html 1852 1852 # 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"; 1854 1854 $ENV{'QUILT_PATCHES'}="debian/patches"; 1855 1855 } else { 1856 1856 # 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"; 1858 1858 } 1859 1859 foreach my $f (sort @f) { … … 1884 1884 1885 1885 # 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"; 1887 1887 while (<LOG>) { 1888 1888 chomp(); … … 1891 1891 my $tmp = $1; 1892 1892 #doesn't work in my case 1893 # die"Missing file $tmp" if (not -f "../$tmp");1893 #confess "Missing file $tmp" if (not -f "../$tmp"); 1894 1894 $made = "$made $tmp"; 1895 1895 } … … 1897 1897 pb_log(2,"Now made is: $made\n"); 1898 1898 1899 open(CTRL,"debian/control") || die"Unable to open debian/control: $!";1899 open(CTRL,"debian/control") || confess "Unable to open debian/control: $!"; 1900 1900 while (<CTRL>) { 1901 1901 pb_log(3,"In loop: $_\n"); … … 1906 1906 #foreach my $glob (("$1\_*.changes", "$1\_*.dsc", "$1\_*.tar.gz")) { 1907 1907 #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]); 1911 1911 #$made .= " $file[0]"; 1912 1912 #} … … 1916 1916 pb_log(2,"Finally made is: $made\n"); 1917 1917 1918 chdir ".." || die"Unable to chdir to parent dir";1918 chdir ".." || confess "Unable to chdir to parent dir"; 1919 1919 pb_rm_rf("$pbpkg-$pbver$pbextdir"); 1920 1920 } elsif ($pbos->{'type'} eq "ebuild") { … … 1984 1984 my @apkfile = pb_extract_build_files($src2,"$pbpkg-$pbver$pbextdir/pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/","$ENV{'PBBUILDDIR'}/tmp","build"); 1985 1985 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"; 1987 1987 1988 1988 # Build 1989 1989 my $keyfile = pb_ssh_get(1); 1990 1990 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; 1992 1992 print CONF "PACKAGER_PRIVKEY=\"$keyfile\"\n" if (defined $keyfile); 1993 1993 close(CONF); … … 1998 1998 } 1999 1999 # 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"; 2001 2001 while (<LOG>) { 2002 2002 chomp($_); … … 2013 2013 pb_system("tar xfz $src","Extracting sources"); 2014 2014 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'}"; 2017 2017 if (-x "install/pbslack") { 2018 2018 pb_system("./install/pbslack","Building software"); 2019 2019 pb_system("sudo /sbin/makepkg -p -l y -c y $pbpkg","Packaging $pbpkg","verbose"); 2020 2020 } 2021 chdir ".." || die"Unable to chdir to parent dir";2021 chdir ".." || confess "Unable to chdir to parent dir"; 2022 2022 pb_rm_rf("$pbpkg-$pbver$pbextdir"); 2023 2023 } elsif ($pbos->{'type'} eq "pkg") { … … 2037 2037 pb_extract_build_files($src2,"$pbpkg-$pbver$pbextdir/pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/pbsrc/","$ENV{'PBBUILDDIR'}","src"); 2038 2038 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"; 2040 2040 if (-f "pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/pbbuild") { 2041 2041 chmod 0755,"pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/pbbuild"; 2042 2042 # 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"); 2044 2044 # Build 2045 2045 pb_system("pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/pbbuild $pkgdestdir/pbdelivery","Building software and installing under $pkgdestdir/pbdelivery"); … … 2049 2049 } else { 2050 2050 # 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"; 2052 2052 print PROTO "i pkginfo\n"; 2053 2053 print PROTO "i depend\n" if (-f "pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/depend"); … … 2063 2063 pb_log(0,"No pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/pbbuild file found for $pbpkg-$pbver\n"); 2064 2064 } 2065 chdir ".." || die"Unable to chdir to parent dir";2065 chdir ".." || confess "Unable to chdir to parent dir"; 2066 2066 pb_rm_rf("$pbpkg-$pbver$pbextdir","$ENV{'PBBUILDDIR'}/$pbos->{'type'}","$pkgdestdir"); 2067 2067 } elsif ($pbos->{'type'} eq "hpux") { … … 2070 2070 pb_system("tar xfz $src2","Extracting pbconf"); 2071 2071 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"; 2073 2073 pb_system("buildpackage ","Building package","verbose"); 2074 2074 # 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"; 2076 2076 while (<LOG>) { 2077 2077 chomp(); … … 2084 2084 $made="$made $pbpkg-$pbver-$pbtag.sd"; 2085 2085 2086 chdir ".." || die"Unable to chdir to parent dir";2086 chdir ".." || confess "Unable to chdir to parent dir"; 2087 2087 pb_rm_rf("$pbpkg-$pbver$pbextdir"); 2088 2088 } else { 2089 die"Unknown OS type format $pbos->{'type'}";2089 confess "Unknown OS type format $pbos->{'type'}"; 2090 2090 } 2091 2091 if (defined $pbparallel) { … … 2101 2101 $made .= " ".pb_get_content($f); 2102 2102 } 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)); 2104 2104 pb_rm_rf($tmpd); 2105 2105 } … … 2150 2150 # Keep track of what is generated so that we can get them back from VMs/RMs 2151 2151 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 $!"; 2153 2153 print KEEP "$made\n"; 2154 2154 close(KEEP); … … 2247 2247 2248 2248 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'}"; 2250 2250 foreach my $pbpkg (@pkgs) { 2251 2251 my $vertag = $pkg->{$pbpkg}; … … 2296 2296 } elsif ($cmt eq "Packages") { 2297 2297 # 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'}"; 2299 2299 $src = <KEEP>; 2300 2300 chomp($src); … … 2388 2388 $tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}"; 2389 2389 } 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"; 2391 2391 } 2392 2392 … … 2404 2404 # That script should be part of the delivery 2405 2405 $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}"; 2407 2407 if ($pbos->{'type'} eq "rpm") { 2408 2408 my $pbsha = pb_distro_get_param($pbos,pb_conf_get("ossha")); … … 2691 2691 # the context is in an empty temp dir 2692 2692 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"; 2694 2694 print DOCKER "FROM $tag{$pbstep}\n"; 2695 2695 print DOCKER "MAINTAINER project-builder.org aka pb\n"; … … 2706 2706 } else { 2707 2707 # 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"; 2709 2710 } 2710 2711 #$shcmd = "$cmd1 build $dockeropt->{$ENV{'PBPROJ'}} -t $tag{$pbstep+1} $context"; … … 2713 2714 if (($cmt =~ /VE/) && ($vetype ne "docker")) { 2714 2715 # 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: $!"; 2716 2717 while (<PASS>) { 2717 2718 my ($c1,$c2,$c3,$c4,$c5,$c6,$c7) = split(/:/); … … 2725 2726 if ($pbstep >= 2) { 2726 2727 # 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`; 2728 2729 chomp($homedir); 2729 open(CID,"$cidfile") || cluck "Unable to open $cidfile" && return;2730 open(CID,"$cidfile") || cluck "Unable to open $cidfile"; 2730 2731 my $cid = <CID>; 2731 2732 close(CID); 2732 pb_system("$cmd1 rm $cid","","quiet");2733 2733 unlink("$cidfile"); 2734 2734 } else { … … 2798 2798 my $pbextdir = pb_get_extdir(); 2799 2799 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; 2802 2802 } 2803 2803 … … 2956 2956 pb_exit(-1); 2957 2957 } 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'}.$$"; 2959 2959 my $src = <KEEP>; 2960 2960 chomp($src); … … 2974 2974 } 2975 2975 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'}"; 2977 2977 foreach my $p (split(/ +/,$src)) { 2978 2978 my $j = basename($p); … … 2985 2985 if (($cmt =~ /^VE/) && ($vetype eq "docker") && ($pbstep >= 3)) { 2986 2986 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 } 2988 2990 } else { 2989 2991 pb_system("$shcmdbase \"rm -rf $tdir $bdir\"","$cmt cleanup"); … … 3017 3019 pb_log(1,"ADVISE: Install Net::Telnet to benefit from monitoring control and snapshot feature.\nWARNING: No snapshot created"); 3018 3020 } 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"; 3020 3022 # move to monitor mode 3021 3023 my @lines = $t->cmd("c"); … … 3143 3145 } 3144 3146 $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));3147 confess "Aborting, one or more of the children failed." if ((not $all_ok) && ($Global::pb_stop_on_error)); 3146 3148 } 3147 3149 … … 3165 3167 3166 3168 # Check that v exists 3167 die"No VM/VE/RM defined, unable to launch" if (not defined $v);3169 confess "No VM/VE/RM defined, unable to launch" if (not defined $v); 3168 3170 3169 3171 # If creation or snapshot creation mode, no snapshot usable … … 3267 3269 } elsif ($vmtype eq "vmware") { 3268 3270 } 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"; 3270 3272 } 3271 3273 # Restore the ENV VAR Value … … 3279 3281 if (! $vexist) { 3280 3282 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); 3282 3284 if (($vmtype eq "qemu") || ($vmtype eq "xen") || ($vmtype eq "kvm")) { 3283 3285 my $command = pb_check_req("qemu-img",0); … … 3463 3465 # 3464 3466 # 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}"; 3466 3468 print SCRIPT "#!/bin/bash\n"; 3467 3469 … … 3576 3578 } 3577 3579 $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));3580 confess "Aborting, one or more of the children failed." if ((not $all_ok) && ($Global::pb_stop_on_error)); 3579 3581 3580 3582 # Launch the VM/VE/RM … … 3589 3591 3590 3592 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'}); 3593 3595 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"); 3594 3596 sleep $sleep; … … 3599 3601 sub pb_newver { 3600 3602 3601 die"-V Version parameter needed" if ((not defined $newver) || ($newver eq ""));3603 confess "-V Version parameter needed" if ((not defined $newver) || ($newver eq "")); 3602 3604 3603 3605 # Need this call for PBDIR … … 3612 3614 3613 3615 if ($scheme !~ /^svn/) { 3614 die"Only SVN is supported at the moment";3616 confess "Only SVN is supported at the moment"; 3615 3617 } 3616 3618 3617 3619 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); 3619 3621 3620 3622 $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); 3622 3624 3623 3625 # Tree identical between PBCONFDIR and PBROOTDIR. The delta is what … … 3652 3654 3653 3655 # 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"; 3656 3658 while(<FILE>) { 3657 3659 if (/^projver\s+$ENV{'PBPROJ'}\s*=\s*$oldvertxt$/) { … … 3679 3681 my $f2 = $f; 3680 3682 $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"; 3682 3684 my $foundnew = 0; 3683 3685 while (<PBCL>) { … … 3685 3687 } 3686 3688 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"; 3689 3691 # We skip as long as we do not reach the new version in the log (case of devel) 3690 3692 my $skip = 1; … … 3800 3802 3801 3803 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}"; 3803 3805 3804 3806 print SCRIPT << 'EOF'; … … 3851 3853 my $useless = 0; 3852 3854 } else { 3853 die"Unknown virtual type $vtype";3855 confess "Unknown virtual type $vtype"; 3854 3856 } 3855 3857 … … 4096 4098 my ($pkg) = pb_conf_read("$ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.yml","pbpkg"); 4097 4099 $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); 4099 4101 4100 4102 # We consider 2 specific packages … … 4148 4150 } else { 4149 4151 # 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"); 4151 4153 } 4152 4154 print SCRIPT << 'EOF'; … … 4181 4183 my $f = "$d/$m"; 4182 4184 if (-f "$f") { 4183 open(PBD,"$f") || die"Unable to open $f: $!";4185 open(PBD,"$f") || confess "Unable to open $f: $!"; 4184 4186 while (<PBD>) { 4185 4187 next if (/^package/); … … 4209 4211 } 4210 4212 $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));4213 confess "Aborting, one or more of the children failed." if ((not $all_ok) && ($Global::pb_stop_on_error)); 4212 4214 4213 4215 # These build scripts need to be run as root and force stop of VM at end … … 4249 4251 4250 4252 # 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"; 4252 4254 print SCRIPT << 'EOF'; 4253 4255 #!/bin/bash … … 4283 4285 # Prepare the script to be executed on the VM/VE/RM 4284 4286 # in $ENV{'PBDESTDIR'}/updatev 4285 open(SCRIPT,"> $pbscript") || die"Unable to create $pbscript";4287 open(SCRIPT,"> $pbscript") || confess "Unable to create $pbscript"; 4286 4288 4287 4289 print SCRIPT << 'EOF'; … … 4395 4397 $chglog = undef if (! -f $chglog); 4396 4398 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: $!"; 4398 4400 my $pb; 4399 4401 $pb->{'realpkg'} = $pbrealpkg; … … 4445 4447 4446 4448 # 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"; 4448 4450 print PBS "#!/bin/bash\n"; 4449 4451 print PBS "set -x\n" if ($pbdebug gt 1); … … 4462 4464 4463 4465 # 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: $!"; 4465 4467 print ANN << "EOF"; 4466 4468 $sl</p> … … 4474 4476 } 4475 4477 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: $!"; 4477 4479 if ($antype eq "Announce") { 4478 4480 my $col = 2; … … 4618 4620 # Get each package changelog content 4619 4621 foreach my $f (sort(@files)) { 4620 open(IN,"$f") || die"Unable to read $f:$!";4622 open(IN,"$f") || confess "Unable to read $f:$!"; 4621 4623 while (<IN>) { 4622 4624 print ANN $_; … … 4638 4640 # To read whole file 4639 4641 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: $!"; 4641 4643 my $announce = <ANN>; 4642 4644 close(ANN); … … 4644 4646 pb_log(2,"INSERT INTO announces VALUES (NULL, $pbdate, $announce)"); 4645 4647 my $sth = $dbh->prepare(qq{INSERT INTO announces VALUES (NULL,?,?)}) 4646 || die"Unable to insert into db";4648 || confess "Unable to insert into db"; 4647 4649 $sth->execute($pbdate, $announce); 4648 4650 $sth->finish(); … … 4653 4655 4654 4656 # 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: $!"; 4656 4658 print ML << 'EOF'; 4657 4659 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/x html1/DTD/xhtml1-strict.dtd"> … … 4663 4665 <p> 4664 4666 EOF 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: $!"; 4666 4668 while(<ANN>) { 4667 4669 print ML $_; … … 4675 4677 # To read whole file 4676 4678 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: $!"; 4678 4680 my $msg = <ANN>; 4679 4681 close(ANN); … … 4701 4703 if (! sendmail(%mail)) { 4702 4704 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"; 4704 4706 } 4705 4707 } … … 4746 4748 # Generate the HTML content 4747 4749 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: $!"; 4749 4751 print NEWS "$news{$pref}"; 4750 4752 close(NEWS); … … 4765 4767 my $dbh = DBI->connect("dbi:SQLite:dbname=$db","","", 4766 4768 { RaiseError => 1, AutoCommit => 1 }) 4767 || die"Unable to connect to $db";4769 || confess "Unable to connect to $db"; 4768 4770 4769 4771 if ($precmd ne "") { 4770 4772 my $sth = $dbh->prepare(qq{$precmd}) 4771 || die"Unable to create table into $db";4773 || confess "Unable to create table into $db"; 4772 4774 $sth->execute(); 4773 4775 } … … 4869 4871 $vmcmd =~ s/qemu-.*/qemu/; 4870 4872 } 4871 open(PS, "ps auxhww|") || die"Unable to call ps";4873 open(PS, "ps auxhww|") || confess "Unable to call ps"; 4872 4874 while (<PS>) { 4873 4875 next if (! /$vmcmd/); … … 4900 4902 $res = pb_system("tar xfpj $src $dir","Extracting $mandatory files from $src",$flag); 4901 4903 } else { 4902 die"Unknown compression algorithm for $src";4904 confess "Unknown compression algorithm for $src"; 4903 4905 } 4904 4906 # If not mandatory return now … … 4930 4932 push @files,pb_move_extracted_files("$dir/$f","$ddir/$f"); 4931 4933 } 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"; 4933 4935 pb_log(2,"mv $dir/$f $ddir\n"); 4934 4936 push @files,"$ddir/$f"; … … 4954 4956 4955 4957 pb_log(2,"DEBUG: entering pb_list_bfiles in $dir: ".Dumper($bfiles)."\n"); 4956 opendir($bdir,"$dir") || die"Unable to open dir $dir: $!";4958 opendir($bdir,"$dir") || confess "Unable to open dir $dir: $!"; 4957 4959 foreach my $f (readdir($bdir)) { 4958 4960 pb_log(3,"DEBUG: pb_list_bfiles found $f\n"); … … 5047 5049 my $nport; 5048 5050 5049 die"No port passed in parameter. Report to dev team\n" if (not defined $port);5051 confess "No port passed in parameter. Report to dev team\n" if (not defined $port); 5050 5052 # key is project on VM, but machine tuple for RM 5051 5053 if ($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'}"}); 5053 5055 $nport = $port->{"$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}"}; 5054 5056 } 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)); 5056 5058 $nport = $port->{$ENV{'PBPROJ'}}; 5057 5059 } … … 5326 5328 # in particular we can remove duplicate in .ssh/authorized_keys of our key if needed 5327 5329 # Store the pub key part in a variable 5328 open(FILE,"$keyfile.pub") || die"Unable to open $keyfile.pub";5330 open(FILE,"$keyfile.pub") || confess "Unable to open $keyfile.pub"; 5329 5331 my ($zero0,$zero1,$zero2) = split(/ /,<FILE>); 5330 5332 close(FILE); … … 5332 5334 my $perls = "$ENV{'PBTMP'}/perls.$$"; 5333 5335 5334 open(FILE,"> $perls") || die"Unable to open $perls";5336 open(FILE,"> $perls") || confess "Unable to open $perls"; 5335 5337 print FILE << 'EOF'; 5336 5338 my $file1="$ENV{'HOME'}/.ssh/authorized_keys";
Note:
See TracChangeset
for help on using the changeset viewer.