small fix, for users, not repo packaged.

This commit is contained in:
Harald Hope 2018-03-21 00:33:10 -07:00
parent 98ed2bc4a0
commit 2d0791cc3e

29
inxi
View file

@ -80,8 +80,8 @@ my @test = (0,0,0,0,0);
## Booleans
my ($b_arm,$b_console_irc,$b_debug_gz,$b_display,$b_dmesg_boot_check,$b_dmi,
$b_dmidecode_force,$b_gpudata,$b_irc,$b_log,$b_log_colors,$b_log_full,$b_mem,
$b_pci,$b_root,$b_running_in_display,$b_sysctl,$b_usb_check);
$b_dmidecode_force,$b_gpudata,$b_irc,$b_log,$b_log_colors,$b_log_full,$b_man,
$b_mem,$b_pci,$b_root,$b_running_in_display,$b_sysctl,$b_usb_check);
## Disk checks
my ($b_dm_boot_disk,$b_dm_boot_optical,$b_glabel,$b_partitions,$b_partition_extra,
$b_raid);
@ -3106,7 +3106,7 @@ sub get_defaults {
'inxi-dev' => 'https://smxi.org/in/',
'inxi-main' => 'https://github.com/smxi/inxi/raw/master/',
'inxi-pinxi' => 'https://github.com/smxi/inxi/raw/inxi-perl/',
'inxi-man' => "https://github.com/smxi/inxi/raw/master/$self_name.1.gz",
'inxi-man' => "https://smxi.org/in/$self_name.1.gz",
);
if ( exists $defaults{$type}){
return $defaults{$type};
@ -3124,7 +3124,6 @@ sub update_me {
my $downloader_error=1;
my $file_contents='';
my $output = '';
my $b_man = 0;
$self_path =~ s/\/$//; # dirname sometimes ends with /, sometimes not
$self_download =~ s/\/$//; # dirname sometimes ends with /, sometimes not
my $full_self_path = "$self_path/$self_name";
@ -3163,7 +3162,7 @@ sub update_me {
$output .= "Starting download of man page file now.\n";
print $output;
$output = '';
if ($b_man && $download_id eq 'main branch' ){
if ($b_man){
update_man();
}
else {
@ -3206,20 +3205,20 @@ sub update_man {
system( 'mandb' );
}
}
if ( $dl{'dl'} =~ /tiny|wget/){
print "Checking Man page download URL...\n";
download_file('spider', $man_file_url);
$downloader_man_error = $?;
}
# if ( $dl{'dl'} =~ /tiny|wget/){
# print "Checking Man page download URL...\n";
# download_file('spider', $man_file_url);
# $downloader_man_error = $?;
# }
if ( $downloader_man_error == 1 ){
if ( $dl{'dl'} =~ /tiny|wget/){
print "Man file download URL verified: $man_file_url\n";
}
# if ( $dl{'dl'} =~ /tiny|wget/){
# print "Man file download URL verified: $man_file_url\n";
# }
print "Downloading Man page file now.\n";
download_file('file', $man_file_url, $man_file_path );
$downloader_man_error = $?;
if ( $downloader_man_error == 0 ){
print "Oh no! Something went wrong downloading the Man gz file at: $man_file_url\n";
print "Oh no! Something went wrong downloading the Man file at: $man_file_url\n";
print "Check the error messages for what happened. Error: $downloader_man_error\n";
}
else {
@ -3704,6 +3703,7 @@ sub get_options{
$self_download = get_defaults('inxi-pinxi');
}
elsif ($arg && $arg eq '3'){
$b_man = 1 if $self_name eq 'inxi';
$download_id = 'dev server';
$self_download = get_defaults('inxi-dev');
}
@ -3711,6 +3711,7 @@ sub get_options{
if (!$arg){
$download_id = 'main branch';
$self_download = get_defaults('inxi-main');
$b_man = 1
}
elsif ( $arg =~ /^[12]$/){
$download_id = "branch $arg";