mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-06-18 04:10:46 +00:00
[xCAT-client]xdshbak: Use version
sorting on hostnames
This commit is contained in:
@ -10,6 +10,9 @@ use xCAT::MsgUtils;
|
||||
use xCAT::DSHCLI;
|
||||
use locale;
|
||||
use Getopt::Std;
|
||||
|
||||
eval "use Sort::Versions qw/versioncmp/; 1;" or *versioncmp = sub ($$) { ($a,$b)= @_ ; return $a cmp $b };
|
||||
|
||||
#####################################################################
|
||||
# #
|
||||
# Module: xdshbak #
|
||||
@ -231,7 +234,7 @@ sub print_list
|
||||
|
||||
local (@lines, $numhosts, $hn_string, $l_string);
|
||||
|
||||
foreach $hostname (sort @hs)
|
||||
foreach $hostname (sort { versioncmp($a, $b) } @hs)
|
||||
{
|
||||
if (!$::opt_x) { ($num_hosts >= 1) && print "\n"; }
|
||||
$num_hosts++;
|
||||
@ -297,7 +300,7 @@ sub print_tree
|
||||
($num_hosts >= 1) && print "\n";
|
||||
$num_hosts++;
|
||||
@wc = split(/:/, $hdr{$index});
|
||||
@wc = sort(@wc);
|
||||
@wc = sort { versioncmp($a, $b) } @wc;
|
||||
|
||||
#system "$SPMSG DSH $MSGCAT INFO511 'HOSTS '";
|
||||
xCAT::MsgUtils->message("I",
|
||||
|
@ -8,5 +8,6 @@ Standards-Version: 3.7.2
|
||||
Package: xcat-client
|
||||
Architecture: all
|
||||
Depends: ${perl:Depends}, nmap, perl-xcat
|
||||
Recommends: libsort-versions-perl
|
||||
Description: Core executables and data of the xCAT management project
|
||||
xCAT-client provides the fundamental xCAT commands (chtab, chnode, rpower, etc) helpful in administrating systems at scale, with particular attention paid to large HPC clusters.
|
||||
|
Reference in New Issue
Block a user