Index: /devel/pb/bin/pb
===================================================================
--- /devel/pb/bin/pb	(revision 1215)
+++ /devel/pb/bin/pb	(revision 1216)
@@ -1617,16 +1617,17 @@
 		($vtmout) = pb_conf_get($tmout);
 	}
-	my $sshmachine = $sshhost->{$ENV{'PBPROJ'}};
-	if ($cmt =~ /^RM/) {
-		# In that case our real host is in the rmhost with the OS as key, not project as above
-		$sshmachine = pb_distro_get_param($pbos,$sshhost);
-	}
-	pb_log(2,"ssh: ".Dumper(($sshhost,$sshlogin,$sshdir,$sshport,$vtmout,$vepath,$rbsconf))."\n");
+	my $remhost = $sshhost->{$ENV{'PBPROJ'}};
+	my $remdir = $sshdir->{$ENV{'PBPROJ'}};
+	if ($cmt =~ /^V[EM]|RM/) {
+		# In that case our real host is in the xxhost with the OS as key, not project as above
+		$remhost = pb_distro_get_param($pbos,$sshhost);
+	}
+	pb_log(2,"ssh: ".Dumper(($remhost,$sshlogin,$remdir,$sshport,$vtmout,$vepath,$rbsconf))."\n");
 
 	my $mac;
 	if ($cmt !~ /^VE/) {
-		$mac = "$sshlogin->{$ENV{'PBPROJ'}}\@$sshmachine";
+		$mac = "$sshlogin->{$ENV{'PBPROJ'}}\@$remhost";
 		# Overwrite account value if passed as parameter
-		$mac = "$pbaccount\@$sshmachine" if (defined $pbaccount);
+		$mac = "$pbaccount\@$remhost" if (defined $pbaccount);
 		pb_log(2, "DEBUG: pbaccount: $pbaccount => mac: $mac\n") if (defined $pbaccount);
 	} else {
@@ -1640,21 +1641,21 @@
 	my $bdir;
 	if (($cmt eq "Sources") || ($cmt =~ /(V[EM]|RM)Script/)) {
-		$tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}/src";
+		$tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}/src";
 	} elsif ($cmt =~ /(V[EM]|RM)(build|test)/) {
-		$tdir = $sshdir->{$ENV{'PBPROJ'}}."/$ENV{'PBPROJ'}/delivery";
-		$bdir = $sshdir->{$ENV{'PBPROJ'}}."/$ENV{'PBPROJ'}/build";
+		$tdir = $remdir."/$ENV{'PBPROJ'}/delivery";
+		$bdir = $remdir."/$ENV{'PBPROJ'}/build";
 		# Remove a potential $ENV{'HOME'} as bdir should be relative to pb's home
 		$bdir =~ s|\$ENV.+\}/||;
 	} elsif ($cmt eq "Announce") {
-		$tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}";
+		$tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}";
 	} elsif ($cmt eq "Web") {
-		$tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}";
+		$tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}";
 	} elsif ($cmt eq "Packages") {
 		if (($pbos->{'type'} eq "rpm") || ($pbos->{'type'} eq "pkg") || ($pbos->{'type'} eq "hpux") || ($pbos->{'type'} eq "tgz")) {
 			# put packages under an arch subdir
-			$tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}";
+			$tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}";
 		} elsif (($pbos->{'type'} eq "deb") || ($pbos->{'type'} eq "ebuild")) {
 			# No need for an arch subdir
-			$tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}";
+			$tdir = "$remdir/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}";
 		} else {
 			die "Please teach the dev team where to deliver ($pbos->{'type'} type of packages\n";
@@ -1662,5 +1663,5 @@
 
 		my $repodir = $tdir;
-		$repodir =~ s|^$sshdir->{$ENV{'PBPROJ'}}/||;
+		$repodir =~ s|^$remdir/||;
 
 		my ($pbrepo) = pb_conf_get("pbrepo");
@@ -1845,5 +1846,5 @@
 	my $tm = undef;
 	if ($cmt =~ /^(V|R)M/) {
-		$tm = $vtmout->{$ENV{'PBPROJ'}};
+		$tm = $vtmout->{$v};
 	}
 
@@ -2168,5 +2169,5 @@
 				if (($vmtype eq "qemu") || ($vmtype eq "xen") || ($vmtype eq "kvm")) {
 					my $command = pb_check_req("qemu-img",0);
-					pb_system("$command create -f qcow2 $vmm $vmsize->{$ENV{'PBPROJ'}}","Creating the QEMU VM");
+					pb_system("$command create -f qcow2 $vmm $vmsize->{$v}","Creating the QEMU VM");
 				} elsif ($vmtype eq "vmware") {
 				} else {
@@ -2388,5 +2389,5 @@
 
 my $vtype = shift;
-my $v = shift;
+my $pbos = shift;
 
 my ($ntp) = pb_conf_get_if($vtype."ntp");
@@ -2395,8 +2396,8 @@
 
 if (defined $vntp) {
-	my ($ntpcmd) = pb_conf_get($vtype."ntpcmd");
+	my ($ntpcmd) = pb_distro_get_param($pbos,pb_conf_get($vtype."ntpcmd"));
 	my $vntpcmd;
-	if (defined $ntpcmd->{$v}) {
-		$vntpcmd = $ntpcmd->{$v};
+	if (defined $ntpcmd->{"$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}"}) {
+		$vntpcmd = $ntpcmd->{"$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}"};
 	} elsif (defined $ntpcmd->{$ENV{'PBPROJ'}}) {
 		$vntpcmd = $ntpcmd->{$ENV{'PBPROJ'}};
@@ -2482,5 +2483,8 @@
 	}
 
-	my $ntpline = pb_date2v($vtype,$v);
+	# Get distro context
+	my $pbos = pb_distro_get_context($v);
+	
+	my $ntpline = pb_date2v($vtype,$pbos);
 	print SCRIPT "# Time sync\n";
 	print SCRIPT "echo 'setting up date with '";
@@ -2726,10 +2730,10 @@
 	$pm->start($counter) and next if (defined $pbparallel);
 
-	# Deal with date sync.
-	my $ntpline = pb_date2v($vtype,$v);
-
 	# Get distro context
 	my $pbos = pb_distro_get_context($v);
 	
+	# Deal with date sync.
+	my $ntpline = pb_date2v($vtype,$pbos);
+
 	# Name of the account to deal with for VM/VE/RM
 	# Do not use the one passed potentially with -a
Index: /devel/pb-modules/etc/pb.conf.pod
===================================================================
--- /devel/pb-modules/etc/pb.conf.pod	(revision 1215)
+++ /devel/pb-modules/etc/pb.conf.pod	(revision 1216)
@@ -450,5 +450,5 @@
 
  Nature: Mandatory
- Key: project (as defined in the -p option or PBPROJ environment variable)
+ Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch).
  Value: NTP command to use to perform time synchronization with the B<rmntp> server. Use full path name, as this command will be used in the sudoers file to allow its launch by root.
  Conffile: rm
@@ -466,5 +466,5 @@
 
  Nature: Mandatory
- Key: project (as defined in the -p option or PBPROJ environment variable)
+ Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch).
  Value: port number to use to communicate with the RM using the SSH protocol. This localport is redirected to the port 22 of the RM.
  Conffile: rm
@@ -487,4 +487,35 @@
  Example: rmrtype default = ssh
 
+=item B<sshdir>
+
+ Nature: Mandatory
+ Key: project (as defined in the -p option or PBPROJ environment variable)
+ Value: dirname into which packages are uploaded on the B<sshhost> machine.
+ Conffile: project
+ Example: sshdir mondorescue = /pub/mondorescue
+
+=item B<sshhost>
+
+ Nature: Mandatory
+ Key: project (as defined in the -p option or PBPROJ environment variable)
+ Value: hostname to connect to in order to deliver packages to the repository server.
+ Conffile: project
+ Example: sshhost mondorescue = ftp.mondorescue.org
+
+=item B<sshlogin>
+
+ Nature: Mandatory
+ Key: project (as defined in the -p option or PBPROJ environment variable)
+ Value: login to use when connecting to the repository server B<sshhost> for package delivery.
+ Conffile: project
+ Example: sshlogin mondorescue = mylogin
+
+=item B<sshport>
+
+ Nature: Mandatory
+ Key: project (as defined in the -p option or PBPROJ environment variable)
+ Value: port to use when connecting to the repository server B<sshhost> for package delivery.
+ Conffile: project
+ Example: sshport mondorescue = 22
 
 =item B<supfiles>
@@ -596,9 +627,8 @@
  Example: vmcmd default = /usr/bin/kvm
 
-
 =item B<vmhost>
 
  Nature: Mandatory
- Key: project (as defined in the -p option or PBPROJ environment variable)
+ Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch).
  Value: hostname to connect to in order to reach the VM through ssh. Generally redirected from a port on localhost.
  Conffile: vm
@@ -624,5 +654,5 @@
 
  Nature: Optional
- Key: project (as defined in the -p option or PBPROJ environment variable)
+ Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch).
  Value: Memory size in MB to allocate to the VM.
  Conffile: vm
@@ -648,5 +678,5 @@
 
  Nature: Mandatory
- Key: project (as defined in the -p option or PBPROJ environment variable)
+ Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch).
  Value: NTP command to use to perform time synchronization with the B<vmntp> server. Use full path name, as this command will be used in the sudoers file to allow its launch by root.
  Conffile: vm
@@ -680,5 +710,5 @@
 
  Nature: Mandatory
- Key: project (as defined in the -p option or PBPROJ environment variable)
+ Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch).
  Value: Size of the VM to create when using the newvm command of pb.
  Conffile: vm
@@ -716,4 +746,36 @@
  Conffile: project
  Example: webdir mondorescue = website
+
+=item B<websshdir>
+
+ Nature: Optional (when not using *2webssh commands)
+ Key: project (as defined in the -p option or PBPROJ environment variable)
+ Value: dirname into which content is uploaded on the B<websshhost> machine.
+ Conffile: project
+ Example: websshdir mondorescue = /var/www/html
+
+=item B<websshhost>
+
+ Nature: Optional (when not using *2webssh commands)
+ Key: project (as defined in the -p option or PBPROJ environment variable)
+ Value: hostname to connect to in order to deliver content to the Web server.
+ Conffile: project
+ Example: websshhost mondorescue = www.mondorescue.org
+
+=item B<websshlogin>
+
+ Nature: Optional (when not using *2webssh commands)
+ Key: project (as defined in the -p option or PBPROJ environment variable)
+ Value: login to use when connecting to the Web server B<websshhost> for content delivery.
+ Conffile: project
+ Example: websshlogin mondorescue = mylogin
+
+=item B<websshport>
+
+ Nature: Optional (when not using *2webssh commands)
+ Key: project (as defined in the -p option or PBPROJ environment variable)
+ Value: port to use when connecting to the Web server B<websshhost> for content delivery.
+ Conffile: project
+ Example: websshport mondorescue = 22
 
 =back
