Bug #4518 - extra slash in the symlink when -p option is presented

For sles.pm, clean up the $path variable to remove multiple slash
and trailing slash.

In debian.pm , move the check for -p and -w further down so it does
not appear unless we have decided that debian is the image we are
copying.  The message is misleading when copycds is run for non
ubuntu/debian OSes
This commit is contained in:
Victor Hu 2015-03-02 12:36:17 -05:00
parent 350421129d
commit 30f6a66814
2 changed files with 16 additions and 7 deletions

View File

@ -221,16 +221,18 @@ sub copycd
return;
}
if ( $copypath || $nonoverwrite ){
$callback->({info=> ["copycd on debian/ubuntu doesn't support -p, -w options!"]});
return;
}
unless (-r $path . "/.disk/info")
{
#xCAT::MsgUtils->message("S","The CD doesn't look like a Debian CD, exiting...");
return;
}
if ( $copypath || $nonoverwrite )
{
$callback->({info=> ["copycds on Ubuntu/Debian does not support -p or -w option."]});
return;
}
my $dinfo;
open($dinfo, $path . "/.disk/info");
my $line = <$dinfo>;

View File

@ -1621,10 +1621,17 @@ sub copycd
);
unless ($mntpath)
{
#this plugin needs $mntpath...
# $mntpath needs to be specified for this plugin
return;
}
if ($path) {
# if path if specified, clean up removing trailing slash...
$path =~ s/\/$//;
# and multiple slashes
$path =~ s,//*,/,g;
}
if ($distname and $distname !~ /^sles|^suse/)
{