aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-07-02 17:27:21 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-07-02 17:27:21 -0400
commitf344e34d089ccbe8c43ec829ddbdd0ad34767e61 (patch)
treead22457205e28eb44b7980a8d80ee67d35664a3f
parentad3fd56c19f919b8cc3932feed76537298a0800e (diff)
parentce0443811182e71e8a792a533d8a1d686afda8d2 (diff)
downloadinxi-f344e34d089ccbe8c43ec829ddbdd0ad34767e61.tar.bz2
inxi-f344e34d089ccbe8c43ec829ddbdd0ad34767e61.tar.xz
inxi-f344e34d089ccbe8c43ec829ddbdd0ad34767e61.tar.zst
Update upstream source from tag 'upstream/3.0.34-1'
Update to upstream version '3.0.34-1' with Debian dir f6f7981892133d8b290e3e32805614f03b5651fe
-rwxr-xr-xinxi230
-rw-r--r--inxi.155
-rw-r--r--inxi.changelog112
3 files changed, 309 insertions, 88 deletions
diff --git a/inxi b/inxi
index b039e5c..2a528f0 100755
--- a/inxi
+++ b/inxi
@@ -31,8 +31,8 @@ use POSIX qw(uname strftime ttyname);
## INXI INFO ##
my $self_name='inxi';
-my $self_version='3.0.32';
-my $self_date='2019-02-07';
+my $self_version='3.0.34';
+my $self_date='2019-04-30';
my $self_patch='00';
## END INXI INFO ##
@@ -549,6 +549,7 @@ sub system_files {
'asound-cards' => '/proc/asound/cards',
'asound-modules' => '/proc/asound/modules',
'asound-version' => '/proc/asound/version',
+ 'cmdline' => '/proc/cmdline',
'cpuinfo' => '/proc/cpuinfo',
'dmesg-boot' => '/var/run/dmesg.boot',
'lsb-release' => '/etc/lsb-release',
@@ -1786,6 +1787,7 @@ sub system_files {
copy_files(\@files,'system-distro');
@files = (
'/proc/1/comm',
+ '/proc/cmdline',
'/proc/cpuinfo',
'/proc/meminfo',
'/proc/modules',
@@ -2437,7 +2439,7 @@ sub run {
my (@data,@rows);
my $line = make_line();
my $pm = get_pm();
- @data = basic_data($line);
+ @data = basic_data($line,$pm);
push @rows,@data;
if (!$bsd_type){
@data = check_items('required system directories',$line,$pm);
@@ -2467,9 +2469,10 @@ sub run {
}
sub basic_data {
- my ($line) = @_;
+ my ($line,$pm_local) = @_;
my (@data,@rows);
my $client = $client{'name-print'};
+ $pm_local ||= 'N/A';
$client .= ' ' . $client{'version'} if $client{'version'};
my $default_shell = 'N/A';
if ($ENV{'SHELL'}){
@@ -2491,6 +2494,7 @@ sub basic_data {
['0', '', '', "Current shell: " . $client ],
['0', '', '', "Default shell: " . $default_shell ],
['0', '', '', "sh links to: $sh_real" ],
+ ['0', '', '', "Package manager: $pm_local" ],
);
return @rows;
}
@@ -2512,7 +2516,8 @@ sub check_items {
}
else {
@data = qw(blockdev dig dmidecode fdisk file hddtemp ifconfig ip ipmitool
- ipmi-sensors lsblk lsusb modinfo runlevel sensors strings sudo tree upower uptime);
+ ipmi-sensors lsblk lsusb modinfo runlevel sensors smartctl strings sudo
+ tree upower uptime);
}
$b_program = 1;
$item = 'Program';
@@ -2611,7 +2616,10 @@ sub check_items {
}
else {
$result = 'Missing';
- $install = " ~ Install package: $info{$pm}" if (($b_program || $b_module) && $pm);
+ if (($b_program || $b_module) && $pm){
+ $info{$pm} ||= 'N/A';
+ $install = " ~ Install package: $info{$pm}";
+ }
push @missing, "$_$install";
}
$row = make_row($_,$about,$result);
@@ -2639,7 +2647,7 @@ sub check_items {
sub item_data {
my ($type) = @_;
my %data = (
- # directory data
+ # Directory Data
'/sys/class/dmi/id' => ({
'info' => '-M system, motherboard, bios',
}),
@@ -2664,7 +2672,7 @@ sub item_data {
'/sys' => ({
'info' => '',
}),
- # file data
+ # File Data
'/etc/lsb-release' => ({
'info' => '-S distro version data (older version)',
}),
@@ -2701,8 +2709,9 @@ sub item_data {
'/var/run/dmesg.boot' => ({
'info' => '-D,-d disk data',
}),
- # system tools
- # apt-dpkg,apt-get; pm-arch,pacman; rpm-redhat,suse
+ ## START PACKAGE MANAGER BLOCK ##
+ # Note: see inxi-perl branch for details: docs/recommends-package-manager.txt
+ # System Tools
'blockdev' => ({
'info' => '--admin -p/-P (filesystem blocksize)',
'info-bsd' => '',
@@ -2858,8 +2867,8 @@ sub item_data {
'rpm' => 'lm-sensors',
}),
'smartctl' => ({
- 'info' => '-Dx show hdd temp',
- 'info-bsd' => '-Dx show hdd temp',
+ 'info' => '-Dxx rotation (alt), type, smart',
+ 'info-bsd' => '-Dx rotation (alt), type, smart',
'apt' => '',
'pacman' => '',
'rpm' => '',
@@ -2920,7 +2929,7 @@ sub item_data {
'pacman' => 'wget',
'rpm' => 'wget',
}),
- # display tools
+ # Display Tools
'glxinfo' => ({
'info' => '-G glx info',
'info-bsd' => '-G glx info',
@@ -2956,7 +2965,7 @@ sub item_data {
'pacman' => 'xrandr',
'rpm' => 'x11-server-utils',
}),
- # Perl modules
+ # Perl Modules
'Cpanel::JSON::XS' => ({
'info' => '--output json - required for export.',
'info-bsd' => '--output json - required for export.',
@@ -3006,6 +3015,7 @@ sub item_data {
'pacman' => 'perl-xml-dumper',
'rpm' => 'perl-XML-Dumper',
}),
+ ## END PACKAGE MANAGER BLOCK ##
);
my $ref = $data{$type};
my %values = %$ref;
@@ -3013,6 +3023,7 @@ sub item_data {
}
sub get_pm {
my ($pm) = ('');
+ # support maintainers of other pm types using custom lists
if (main::check_program('dpkg')){
$pm = 'apt';
}
@@ -4074,7 +4085,7 @@ sub get_options{
my ($opt,$arg) = @_;
# let api processor handle checks if valid, this
# future proofs this
- if ($arg =~ /^[0-9]$/){
+ if ($arg =~ /^[1-9]$/){
$weather_source = $arg;
}
else {
@@ -4446,10 +4457,11 @@ sub show_options {
verbose or line output, not short form):" ],
['2', '-C', '', "If available: CPU vulnerabilities (bugs); family, model-id, stepping - format:
hex (decimal) if greater than 9, otherwise hex; microcode - format: hex." ],
- ['2', '-d', '', "If available: logical and physical block sizes." ],
+ ['2', '-d,-D', '', "If available: logical and physical block sizes." ],
['2', '-p,-P', '', "If available: raw size of partition, percent available for user,
block size of file system (root required); for swap, shows swapiness and vfs cache
pressure, and if values are default or not." ],
+ ['2', '-S', '', "If available: kernel boot parameters." ],
['1', '-A', '--audio', "Audio/sound card(s), driver, sound server." ],
['1', '-b', '--basic', "Basic output, short form. Same as $self_name^-v^2." ],
['1', '-B', '--battery', "System battery info, including charge and condition, plus
@@ -4550,14 +4562,15 @@ sub show_options {
if ( $b_weather ){
@rows = (
['1', '-w', '--weather', "Local weather data/time. To check an alternate
- location, see -W."],
+ location, see -W. NO AUTOMATED QUERIES ALLOWED!"],
['1', '-W', '--weather-location', "[location] Supported options for
- [location]: postal code[,country]; city, state/country; latitude, longitude.
- Only use if you want the weather somewhere other than the machine running
- $self_name. Use only ASCII characters, replace spaces in city/state/country
- names with '+'. Example:^$self_name^-W^new+york,ny"],
- ['1', '', '--weather-source', "[0-9] Change weather data source. 0 uses
- a legacy source internally. 1-3 generally active, 4-9 check. See man."],
+ [location]: postal code[,country/country code]; city, state (USA)/country
+ (country/two character country code); latitude, longitude. Only use if you
+ want the weather somewhere other than the machine running $self_name. Use
+ only ASCII characters, replace spaces in city/state/country names with '+'.
+ Example:^$self_name^-W^[new+york,ny^london,gb^madrid,es]"],
+ ['1', '', '--weather-source', "[1-9] Change weather data source. 1-4 generally
+ active, 5-9 check. See man."],
['1', '', '--weather-unit', "Set weather units to metric (m), imperial (i),
metric/imperial (mi), or imperial/metric (im)."],
);
@@ -5454,7 +5467,7 @@ sub row_defaults {
'unknown-desktop-version' => "ERR-101",
'unknown-dev' => "ERR-102",
'unknown-shell' => "ERR-100",
- 'weather-error' => "Error in weather data: $id",
+ 'weather-error' => "Error: $id",
'weather-null' => "No $id found. Internet connection working?",
'xdpyinfo-missing' => '<xdpyinfo missing>',
);
@@ -6660,8 +6673,8 @@ sub create_output_full {
$flag_key = ($b_arm || $bsd_type) ? 'features': 'flags';
my $flag = 'N/A';
if (@flags){
- # failure to read dmesg.boot: dmesg.boot permissions
- @flags = grep {/^(dmesg.boot|lm|nx|pae|permissions|pni|svm|vmx|(sss|ss)e([2-9])?([a-z])?(_[0-9])?)$/} @flags;
+ # failure to read dmesg.boot: dmesg.boot permissions; then short -Cx list flags
+ @flags = grep {/^(dmesg.boot|permissions|avx[2-9]?|lm|nx|pae|pni|(sss|ss)e([2-9])?([a-z])?(_[0-9])?|svm|vmx)$/} @flags;
@flags = map {s/pni/sse3/; $_} @flags;
@flags = sort(@flags);
$flag = join ' ', @flags if @flags;
@@ -8720,6 +8733,7 @@ sub device_vendor {
# 0 - match pattern; 1 - replace pattern; 2 - vendor print; 3 - serial pattern
# Data URLs: inxi-resources.txt Section: DiskData device_vendor()
# $model = 'MEDIAMAX ';
+ # $model = 'Patriot Memory';
my @vendors = (
## These go first because they are the most likely and common ##
['(Crucial|^(FC)?CT|-CT|^M4\b)','Crucial','Crucial',''],
@@ -8735,7 +8749,7 @@ sub device_vendor {
['^STEC\b','^STEC\b','STEC',''], # ssd drive, must come before seagate ST test
# real, SSEAGATE Backup+; XP1600HE30002 | 024 HN (spinpoint)
['(^ST[^T]|[S]?SEAGATE|^X[AFP]|^5AS|^BUP|Expansion Desk|FreeAgent|GoFlex|Backup(\+|\s?Plus)\s?Hub)','[S]?SEAGATE','Seagate',''],
- ['^(WD|Western Digital|My (Book|Passport)|\d*LPCX|Elements|M000|EARX|EFRX|\d*EAVS|0JD|JPVX|[0-9]+(BEV|(00)?AAK|AAV|AZL))','(^WDC|Western\s?Digital)','Western Digital',''],
+ ['^(WD|WL[0]9]|Western Digital|My (Book|Passport)|\d*LPCX|Elements|M000|EARX|EFRX|\d*EAVS|0JD|JPVX|[0-9]+(BEV|(00)?AAK|AAV|AZL))','(^WDC|Western\s?Digital)','Western Digital',''],
## Then better known ones ##
['^(A-DATA|ADATA|AXN|CH11)','^(A-DATA|ADATA)','A-Data',''],
['^ADTRON','^(ADTRON)','Adtron',''],
@@ -8747,7 +8761,6 @@ sub device_vendor {
# note: 2012: wdc bought hgst
['^(HGST|Touro|5450)','^HGST','HGST (Hitachi)',''], # HGST HUA
['^(Hitachi|HD[ST]|DK[0-9]|IC|HT|HU)','^Hitachi','Hitachi',''],
- ['^Hoodisk','^Hoodisk','Hoodisk',''],
# vb: VB0250EAVER but clashes with vbox; HP_SSD_S700_120G ;GB0500EAFYL GB starter too generic?
['^(HP\b|MB0|G[BJ]0|v[0-9]{3}[ow])','^HP','HP',''],
['^(LSD|Lexar|JumpDrive|JD\s?Firefly)','^Lexar','Lexar',''], # mmc-LEXAR_0xb016546c; JD Firefly;
@@ -8764,22 +8777,34 @@ sub device_vendor {
# unknown: AL25744_12345678; ADP may be usb 2.5" adapter; udisk unknown: Z1E6FTKJ 00AAKS
# SSD2SC240G726A10 MRS020A128GTS25C EHSAJM0016GB
['^5ACE','^5ACE','5ACE',''], # could be seagate: ST316021 5ACE
+ ['^Addlink','^Addlink','Addlink',''],
+ ['^Aireye','^Aireye','Aireye',''],
+ ['^Alfawise','^Alfawise','Alfawise',''],
['^Android','^Android','Android',''],
+ ['^Apotop','^Apotop','Apotop',''],
# must come before AP|Apacer
- ['^APPLE','^APPLE','Apple',''],
+ ['^(APPLE|iPod)','^APPLE','Apple',''],
['^(AP|Apacer)','^Apacer','Apacer',''],
+ ['^(A-?RAM|ARSSD)','^A-?RAM','A-RAM',''],
['^(ASM|2115)','^ASM','ASMedia',''],#asm1153e
+ ['^Bell\b','^Bell','Packard Bell',''],
['^BHT','^BHT','BHT',''],
+ ['^BIOSTAR','^BIOSTAR','Biostar',''],
['^BIWIN','^BIWIN','BIWIN',''],
['^BUFFALO','^BUFFALO','Buffalo',''],
+ ['^Centerm','^Centerm','Centerm',''],
['^CHN\b','','Zheino',''],
+ ['^Clover','^Clover','Clover',''],
['^Colorful\b','^Colorful','Colorful',''],
['^CSD','^CSD','CSD',''],
['^(Dane-?Elec|Z Mate)','^Dane-?Elec','DaneElec',''],
# Daplink vfs is an ARM software thing
+ ['^Dell\b','^Dell','Dell',''],
['^DeLOCK','^Delock(\s?products)?','Delock',''],
['^DGM','^DGM\b','DGM',''],
['^DIGITAL\s?FILM','DIGITAL\s?FILM','Digital Film',''],
+ ['^Dogfish','^Dogfish','Dogfish',''],
+ ['^DragonDiamond','^DragonDiamond','DragonDiamond',''],
['^DREVO\b','^DREVO','Drevo',''],
['^(Eaget|V8$)','^Eaget','Eaget',''],
['^EDGE','^EDGE','EDGE',''],
@@ -8791,6 +8816,7 @@ sub device_vendor {
['^FORESEE','^FORESEE','Foresee',''],
['^GALAX\b','^GALAX','GALAX',''],
['^Galaxy\b','^Galaxy','Galaxy',''],
+ ['^Geil','^Geil','Geil',''],
['^Generic','^Generic','Generic',''],
['^Gigabyte','^Gigabyte','Gigabyte',''], # SSD
['^Gigastone','^Gigastone','Gigastone',''],
@@ -8798,6 +8824,9 @@ sub device_vendor {
['^(GOODRAM|IR SSD)','^GOODRAM','GOODRAM',''],
# supertalent also has FM: |FM
['^(G[\.]?SKILL)','^G[\.]?SKILL','G.SKILL',''],
+ ['^HDC','^HDC\b','HDC',''],
+ ['^Hectron','^Hectron','Hectron',''],
+ ['^Hoodisk','^Hoodisk','Hoodisk',''],
['^HUAWEI','^HUAWEI','Huawei',''],
['^(IBM|DT)','^IBM','IBM',''],
['^IEI Tech','^IEI Tech(\.|nology)?( Corp(\.|oration)?)?','IEI Technology',''],
@@ -8822,20 +8851,27 @@ sub device_vendor {
['^Lenovo','^Lenovo','Lenovo',''],
['^RPFT','','Lenovo O.E.M.',''],
['^(LITE[\-\s]?ON[\s\-]?IT)','^LITE[\-]?ON[\s\-]?IT','LITE-ON IT',''], # LITEONIT_LSS-24L6G
- ['^(LITE[\-\s]?ON|PH6)','^LITE[\-]?ON','LITE-ON',''], # PH6-CE240-L
+ ['^(LITE[\-\s]?ON|PH[1-9])','^LITE[\-]?ON','LITE-ON',''], # PH6-CE240-L
['^M-Systems','^M-Systems','M-Systems',''],
- ['^(MAXTOR)','^MAXTOR','Maxtor',''], # note M3 is usually maxtor, but can be samsung
+ ['^(MAXTOR|Atlas)','^MAXTOR','Maxtor',''], # note M2 M3 is usually maxtor, but can be samsung
+ ['^Memorex','^Memorex','Memorex',''],
# note: C300/400 can be either micron or crucial, but C400 is M4 from crucial
['(^MT|^M5|^Micron|00-MT|C[34]00)','^Micron','Micron',''],# C400-MTFDDAK128MAM
+ ['^MARSHAL\b','^MARSHAL','Marshal',''],
['^MARVELL','^MARVELL','Marvell',''],
['^MDT\b','^MDT','MDT (rebuilt WD/Seagate)',''], # mdt rebuilds wd/seagate hdd
['^Medion','^Medion','Medion',''],
['^(MEDIAMAX|WL[0-9]{2})','^MEDIAMAX','MediaMax',''],
+ ['^Morebeck','^Morebeck','Morebeck',''],
['^Motorola','^Motorola','Motorola',''],
+ ['^MTRON','^MTRON','MTRON',''],
['^Netac','^Netac','Netac',''],
['^OOS[1-9]','','Utania',''],
+ ['^OWC','^OWC\b','OWC',''],
['^PALIT','PALIT','Palit',''], # ssd
+ ['^PERC\b','','Dell PowerEdge RAID Card',''], # ssd
['^(PS[8F]|Patriot)','^Patriot([-\s]?Memory)?','Patriot',''],
+ ['^Pioneer','Pioneer','Pioneer',''],
['^PIX[\s]?JR','^PIX[\s]?JR','Disney',''],
['^(PLEXTOR|PX-)','^PLEXTOR','Plextor',''],
['^(PQI|Intelligent\s?Stick)','^PQI','PQI',''],
@@ -8846,17 +8882,23 @@ sub device_vendor {
['^RENICE','^RENICE','Renice',''],
['^(Ricoh|R5)','^Ricoh','Ricoh',''],
['^RIM[\s]','^RIM','RIM',''],
+ ['^Runcore','^Runcore','Runcore',''],
+ ['^Sage','^Sage(\s?Micro)?','Sage Micro',''],
['^SigmaTel','^SigmaTel','SigmaTel',''],
- ['^(Silicon\s?Power|SPPC|Silicon)','Silicon\s?Power','Silicon Power',''],
- ['Smartbuy','\s?Smartbuy','Smartbuy',''], # SSD Smartbuy 60GB
+ # DIAMOND_040_GB
+ ['^(SILICON\s?MOTION|SM[0-9])','^SILICON\s?MOTION','Silicon Motion',''],
+ ['^(Silicon\s?Power|SP[CP]C|Silicon|Diamond|Haspeed)','Silicon\s?Power','Silicon Power',''],
+ ['Smartbuy','\s?Smartbuy','Smartbuy',''], # SSD Smartbuy 60GB; mSata Smartbuy 3
# HFS128G39TND-N210A; seen nvme with name in middle
['(SK\s?HYNIX|^HFS)','\s?SK\s?HYNIX','SK Hynix',''],
['hynix','hynix','Hynix',''],# nvme middle of string, must be after sk hynix
['^SH','','Smart Modular Tech.',''],
+ ['^Skill','^Skill','Skill',''],
['^(SMART( Storage Systems)?|TX)','^(SMART( Storage Systems)?)','Smart Storage Systems',''],
['^(S[FR]-|Sony)','^Sony','Sony',''],
['^STE[CK]','^STE[CK]','sTec',''], # wd bought this one
['^STORFLY','^STORFLY','StorFly',''],
+ ['^SUNEAST','^SUNEAST','SunEast',''],
# NOTE: F[MNETU] not reliable, g.skill starts with FM too:
# Seagate ST skips STT.
['^(STT)','','Super Talent',''],
@@ -8867,6 +8909,8 @@ sub device_vendor {
['^(TDK|TF[1-9][0-9])','^TDK','TDK',''],
['^TEAC','^TEAC','TEAC',''],
['^TEAM','^TEAM( Group)?','Team',''],
+ ['^Teclast','^Teclast','Teclast',''],
+ ['^Teleplan','^Teleplan','Teleplan',''],
['^Tigo','^Tigo','Tigo',''],
['^TopSunligt','^TopSunligt','TopSunligt',''], # is this a typo? hard to know
['^TopSunlight','^TopSunlight','TopSunlight',''],
@@ -8874,6 +8918,7 @@ sub device_vendor {
# Twister Line but if we slice out Twister it would just say Line
['^(TrekStor|DS maxi)','^TrekStor','TrekStor',''],
['^UDinfo','^UDinfo','UDinfo',''],
+ ['^USBTech','^USBTech','USBTech',''],
['^(UG|Unigen)','^Unigen','Unigen',''],
['^VBOX','','VirtualBox',''],
['^(Verbatim|STORE N GO)','^Verbatim','Verbatim',''],
@@ -8881,6 +8926,8 @@ sub device_vendor {
['^VISIONTEK','^VISIONTEK','VisionTek',''],
['^VMware','^VMware','VMware',''],
['^(Vseky|Vaseky)','^Vaseky','Vaseky',''], # ata-Vseky_V880_350G_
+ ['^(YUCUN|R880)','^YUCUN','YUCUN',''],
+ ['^ZTC','^ZTC','ZTC',''],
['^(ASMT|2115)','^ASMT','ASMT (case)',''],
);
foreach my $ref (@vendors){
@@ -13329,7 +13376,12 @@ sub get_repos_linux {
@apt_working = ();
$b_apt_enabled = 1;
foreach my $row (@data2){
- next if $row =~ /^\s+/; # deb822 supports line folding which starts with space
+ # NOTE: the syntax of deb822 must be considered a bug, it's sloppy beyond belief.
+ # deb822 supports line folding which starts with space
+ # BUT: you can start a URIs: block of urls with a space, sigh.
+ next if $row =~ /^\s+/ && $row !~ /^\s+[^#]+:\//;
+ # strip out line space starters now that it's safe
+ $row =~ s/^\s+//;
#print "$row\n";
if ($row eq '~'){
if (@apt_working && $b_apt_enabled){
@@ -14366,7 +14418,8 @@ sub lm_sensors_data {
#my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/sensors/sensors-asus-chassis-1.txt";
#my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/sensors/sensors-devnull-1.txt";
#my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/sensors/sensors-jammin1.txt";
- #@sensors_data = main::reader($file);
+ # my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/sensors/sensors-maximus-arch-1.txt";
+ # @sensors_data = main::reader($file);
# print join ("\n", @sensors_data), "\n";
@sensors_data = map {$_ =~ s/\s*:\s*\+?/:/;$_} @sensors_data;
foreach (@sensors_data){
@@ -14562,7 +14615,6 @@ sub sysctl_data {
}
last if /^(hw.cpuspeed|hw.vendor|hw.physmem)/;
}
-
%sensors = data_processor(%sensors) if %sensors;
main::log_data('dump','%sensors',\%sensors) if $b_log;
# print Data::Dumper::Dumper \%sensors;
@@ -14930,12 +14982,14 @@ sub gpu_data {
$holder = '';
}
if ($b_found){
- if (/^temp.*:([0-9]+).*(C|F)/){
+ $gpudata[$j]{'type'} = $holder;
+ if (/^[^:]*:([0-9]+).*\b(C|F)\s/i){
$gpudata[$j]{'temp'} = $1;
- $gpudata[$j]{'type'} = $holder;
$gpudata[$j]{'unit'} = $2;
+ # print "$_\n";
}
- if (/^fan.*:([0-9]+).*(RPM)?/){
+ # speeds can be in percents or rpms, so need the 'fan' in regex
+ if (/^.*fan.*:([0-9]+).*(RPM)?/i){
$gpudata[$j]{'fan-speed'} = $1;
# NOTE: we test for nvidia %, everything else stays with nothing
$gpudata[$j]{'speed-unit'} = '';
@@ -15460,7 +15514,16 @@ sub create_output {
if ($weather{'sunset'}){
$rows[0]{main::key($num++,'Sunset')} = $weather{'sunset'};
}
+ if ($weather{'moonphase'}){
+ $value = $weather{'moonphase'} . '%';
+ $value .= ($weather{'moonphase-graphic'}) ? ' ' . $weather{'moonphase-graphic'} :'';
+ $rows[0]{main::key($num++,'Moonphase')} = $value;
+ }
+ if ($weather{'forecast'}){
+ $rows[0]{main::key($num++,'Forecast')} = $weather{'forecast'};
+ }
}
+
if ($weather{'api-source'}){
$rows[0]{main::key($num++,'Source')} = $weather{'api-source'};
}
@@ -15631,6 +15694,9 @@ sub get_weather {
elsif ( $working[0] eq 'error' ){
$weather{'error'} = $working[1];
}
+ elsif ( $working[0] eq 'forecast' ){
+ $weather{'forecast'} = $working[1];
+ }
elsif ( $working[0] eq 'heat_index_string' ){
$weather{'heat-index'} = $working[1];
$working[1] =~ /^([0-9\.]+)\sF\s\(([0-9\.]+)\sC\)/;
@@ -15653,6 +15719,12 @@ sub get_weather {
elsif ( $working[0] eq 'local_epoch' ){
$weather{'local-epoch'} = $working[1];
}
+ elsif ( $working[0] eq 'moonphase' ){
+ $weather{'moonphase'} = $working[1];
+ }
+ elsif ( $working[0] eq 'moonphase_graphic' ){
+ $weather{'moonphase-graphic'} = $working[1];
+ }
elsif ( $working[0] eq 'observation_time_rfc822' ){
$weather{'observation-time-rfc822'} = $working[1];
}
@@ -15792,25 +15864,25 @@ sub get_weather {
# remote timezone for this local block only
local $ENV{'TZ'} = $tz if $tz;
$date_time = POSIX::strftime "%c", localtime();
- $date_time = test_local_date($date_time,'','');
+ $date_time = test_locale_date($date_time,'','');
$weather{'date-time'} = $date_time;
# only wu has rfc822 value, and we want the original observation time then
if ($weather{'observation-epoch'} && $tz){
$date_time = POSIX::strftime "%Y-%m-%d %T ($tz %z)", localtime($weather{'observation-epoch'});
- $date_time = test_local_date($date_time,$show{'weather-location'},$weather{'observation-epoch'});
+ $date_time = test_locale_date($date_time,$show{'weather-location'},$weather{'observation-epoch'});
$weather{'observation-time-local'} = $date_time;
}
}
else {
$date_time = POSIX::strftime "%c", localtime();
- $date_time = test_local_date($date_time,'','');
+ $date_time = test_locale_date($date_time,'','');
$tz = ( $location[2] ) ? " ($location[2])" : '';
$weather{'date-time'} = $date_time . $tz;
}
# we get the wrong time using epoch for remote -W location
if ( !$show{'weather-location'} && $weather{'observation-epoch'}){
$date_time = POSIX::strftime "%c", localtime($weather{'observation-epoch'});
- $date_time = test_local_date($date_time,$show{'weather-location'},$weather{'observation-epoch'});
+ $date_time = test_locale_date($date_time,$show{'weather-location'},$weather{'observation-epoch'});
$weather{'observation-time-local'} = $date_time;
}
return %weather;
@@ -15819,14 +15891,9 @@ sub get_weather {
sub download_weather {
eval $start if $b_log;
my ($now,$file_cached,@location) = @_;
- my (@weather,@weather_temp,$temp,$ua,$url);
- if ($weather_source == 0){
- $url = "http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=$location[0]";
- }
- else {
- $url = "https://smxi.org/opt/xr2.php?loc=$location[0]&src=$weather_source";
- }
- $ua = 'weather' if $url =~ /smxi/;
+ my (@weather,$temp,$ua,$url);
+ $url = "https://smxi.org/opt/xr2.php?loc=$location[0]&src=$weather_source";
+ $ua = 'weather';
# {
# #my $file2 = "$ENV{'HOME'}/bin/scripts/inxi/data/weather/weather-1.xml";
# # my $file2 = "$ENV{'HOME'}/bin/scripts/inxi/data/weather/feed-oslo-1.xml";
@@ -15836,24 +15903,7 @@ sub download_weather {
# $temp = <$fh>;
# }
$temp = main::download_file('stdout',$url,'',$ua);
- $temp =~ s/\r|\n\n/\n/g if $weather_source == 0;
- @weather_temp = split /\n/, $temp;
- if ($weather_source == 0){
- foreach (@weather_temp){
- chomp $_;
- $_ =~ s/<\/[^>]+>//;
- $_ =~ s/.*icon.*|\r//g;
- $_ =~ s/\s\s/ /g;
- $_ =~ s/^\s+|\s+$//g;
- $_ =~ s/>/^^/;
- $_ =~ s/^<|NA$//g;
- $_ =~ s/^(current|credit|terms|image|title|link|.*_url).*//;
- push @weather, $_ if $_ !~ /^\s*$/;
- }
- }
- else {
- @weather = @weather_temp;
- }
+ @weather = split(/\n/, $temp) if $temp;
unshift (@weather,("timestamp^^$now"));
main::writer($file_cached,\@weather);
#print "$file_cached: download/cleaned\n";
@@ -15862,7 +15912,7 @@ sub download_weather {
}
# resolve wide character issue, if detected, switch to iso
# date format, we won't try to be too clever here.
-sub test_local_date {
+sub test_locale_date {
my ($date_time,$location,$epoch) = @_;
# $date_time .= 'дек';
#print "1: $date_time\n";
@@ -15973,7 +16023,7 @@ sub complete_location {
if ($location && $location =~ /[\+\-0-9]/ && $city){
$location = $country . ', ' . $location if $country && $location !~ m|$country|i;
$location = $state . ', ' . $location if $state && $location !~ m|$state|i;
- $location = $city . ', ' . $location;
+ $location = $city . ', ' . $location if $city && $location !~ m|$city|i;
}
eval $end if $b_log;
return $location;
@@ -16566,7 +16616,7 @@ sub set_info_data {
my (@data,@info,$item);
my $pattern = 'alltray|awn|bar|bmpanel|bmpanel2|budgie-panel|cairo-dock|';
$pattern .= 'dde-dock|dmenu|dockbarx|docker|docky|dzen|dzen2|';
- $pattern .= 'fbpanel|fspanel|glx-dock|gnome-panel|hpanel|i3bar|icewmtray|';
+ $pattern .= 'fancybar|fbpanel|fspanel|glx-dock|gnome-panel|hpanel|i3bar|icewmtray|';
$pattern .= 'kdocker|kicker|';
$pattern .= 'latte|latte-dock|lemonbar|ltpanel|lxpanel|lxqt-panel|';
$pattern .= 'matchbox-panel|mate-panel|ourico|';
@@ -17384,6 +17434,32 @@ sub get_kernel_bits {
return $bits;
}
+sub get_kernel_parameters {
+ eval $start if $b_log;
+ my ($parameters);
+ if (my $file = system_files('cmdline') ) {
+ $parameters = get_kernel_parameters_linux($file);
+ }
+ elsif ($bsd_type) {
+ $parameters = get_kernel_parameters_bsd();
+ }
+ eval $end if $b_log;
+ return $parameters;
+}
+sub get_kernel_parameters_linux {
+ eval $start if $b_log;
+ my ($file) = @_;
+ my $line = (reader($file))[0];
+ eval $end if $b_log;
+ return $line;
+}
+sub get_kernel_parameters_bsd {
+ eval $start if $b_log;
+ my ($parameters);
+ eval $end if $b_log;
+ return $parameters;
+}
+
sub get_memory_data_full {
eval $start if $b_log;
my ($source) = @_;
@@ -18044,8 +18120,10 @@ sub pciconf_data {
if ($_ =~ /^~$/) {
$vendor = main::cleaner($vendor);
$device = main::cleaner($device);
+ # handle possible regex in device name, like [ConnectX-3]
+ my $device_temp = main::regex_cleaner($device);
if ($vendor && $device){
- if ($vendor !~ /$device/i){
+ if (main::regex_cleaner($vendor) !~ /$device_temp/i){
$device = "$vendor $device";
}
}
@@ -19734,6 +19812,7 @@ sub generate_system_data {
$data{$data_name}[$index]{main::key($num++,'Host')} = &get_hostname();
}
$data{$data_name}[$index]{main::key($num++,'Kernel')} = &get_kernel_data();
+
$data{$data_name}[$index]{main::key($num++,'bits')} = &get_kernel_bits;
if ($extra > 0){
my @compiler = get_compiler_version(); # get compiler data
@@ -19747,6 +19826,11 @@ sub generate_system_data {
$data{$data_name}[$index]{main::key($num++,'v')} = $compiler[1];
}
}
+ if ($b_admin && (my $params = get_kernel_parameters())){
+ $index = scalar(@{ $data{$data_name} } );
+ $data{$data_name}[$index]{main::key($num++,'parameters')} = $params;
+ $index = scalar(@{ $data{$data_name} } );
+ }
# note: tty can have the value of 0 but the two tools
# return '' if undefined, so we test for explicit ''
if ($b_display){
diff --git a/inxi.1 b/inxi.1
index 5429073..ef6ec3d 100644
--- a/inxi.1
+++ b/inxi.1
@@ -1,4 +1,4 @@
-.TH INXI 1 "2019\-02\-07" inxi "inxi manual"
+.TH INXI 1 "2019\-04\-30" inxi "inxi manual"
.SH NAME
inxi \- Command line system information script for console and IRC
.SH SYNOPSIS
@@ -458,33 +458,48 @@ processes (\fB\-tcm\fR), admin (\fB\-\-admin\fR). Useful for testing output and
see what data you can get from your system.
.TP
.B \-w\fR,\fB \-\-weather\fR
-Adds weather line. Note, this depends on an unreliable API so it may not always
-be working in the future. To get weather for an alternate location, use
-\fB\-W\fR. See also \fB\-x\fR, \fB\-xx\fR, \fB\-xxx\fR options.
+Adds weather line. To get weather for an alternate location, use
+\fB\-W [location]\fR. See also \fB\-x\fR, \fB\-xx\fR, \fB\-xxx\fR options.
Please note that your distribution's maintainer may chose to disable this feature.
+
+DO NOT USE THIS FEATURE FOR AUTOMATED WEATHER UPDATES! You will be blocked
+from any further access. This feature is not meant for widget type
+weather monitoring, or Conky type use. It is meant to get weather when you need to
+see it, for example, on a remote server.
.TP
.B \-W\fR, \fB\-\-weather\-location <location_string>\fR
Get weather/time for an alternate location. Accepts postal/zip code[, country],
city,state pair, or latitude,longitude. Note: city/country/state names must not
contain spaces. Replace spaces with '\fB+\fR' sign. Don't place spaces around
any commas. Postal code is not reliable except for North America and maybe the UK.
-Try postal codes with and without country code added.
+Try postal codes with and without country code added. Note that City,State applies
+only to USA, otherwise it's City,Country. If country name (english) does not work,
+try 2 character country code (e.g. Spain: es; Great Britain: gb).
+
+See \fIhttps://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\fR for current 2 letter
+country codes.
Use only ASCII letters in city/state/country names.
Examples: \fB\-W 95623,us\fR OR \fB\-W Boston,MA\fR OR
\fB\-W 45.5234,\-122.6762\fR OR \fB\-W new+york,ny\fR OR \fB\-W bodo,norway\fR.
+
+DO NOT USE THIS FEATURE FOR AUTOMATED WEATHER UPDATES! Use of automated queries,
+will result in your access being blocked. If you try to work around the ban, you
+will be permanently banned from this service.
.TP
.B \-\-weather\-source\fR, \fB\-\-ws <unit>\fR
-[\fB0\-9\fR] Switches weather data source. 0 uses a legacy source which may vanish
-any day. \fB1\-9\fR use different remote sources. \fB2\fR may not support city /
-country names with spaces (even if you use the \fB+\fR sign instead of space).
-\fB3\fR offers pretty good data, but may not have all small city names for
-\fB\-W\fR.
-
-More data sources will be added as time permits, so try each one and
-see which you prefer. If you get unsupported source message, it means that number
-has not been implemented.
+[\fB1\-9\fR] Switches weather data source. Possible values are \fB1\-9\fR. \fB1\-4\fR
+will generally be active, and \fB5\-9\fR may or may not be active, so check.
+\fB1\fR may not support city / country names with spaces (even if you use the \fB+\fR
+sign instead of space). \fB2\fR offers pretty good data, but may not have all small
+city names for \fB\-W\fR.
+
+Please note that the data sources are not static per value, and can change any time,
+or be removed, so always test to verify which source is being used for each value
+if that is important to you. Data sources may be added or removed on occasions, so
+try each one and see which you prefer. If you get unsupported source message, it means
+that number has not been implemented.
.TP
.B \-\-weather\-unit <unit>\fR
[\fBm\fR|\fBi\fR|\fBmi\fR|\fBim\fR] Sets weather units to metric (\fBm\fR), imperial (\fBi\fR),
@@ -864,7 +879,7 @@ Format is \fBhexadecimal (decimal)\fR if greater than 9, otherwise \fBhexadecima
(Linux kernel 4.14 or newer, or patched older kernels).
.TP
-.B \-a \-d\fR
+.B \-a \-d\fR,\fB\-a \-D\fR
\- Adds logical and physical block size in bytes.
.TP
@@ -888,6 +903,11 @@ shows default value as well, e.g.
\fBswappiness: 60 (default) cache pressure: 90 (default 100)\fR.
+.TP
+.B \-a \-S\fR
+\- Adds kernel boot parameters to \fBKernel\fR section (if detected). Support
+varies by OS type.
+
.SH ADVANCED OPTIONS
.TP
@@ -1021,6 +1041,11 @@ sort will be random.
\fBused\fR - KiB used of partition.
.TP
+.B \-\-pm\-type [package manager name]\fR
+For distro package maintainers only, and only for non apt, rpm, or pacman based systems.
+To be used to test replacement package lists for recommends for that package manager.
+
+.TP
.B \-\-sleep [0\-x.x]\fR
Usually in decimals. Change CPU sleep time for \fB\-C\fR (current: \fB\0.35\fR).
Sleep is used to let the system catch up and show a more accurate CPU use. Example:
diff --git a/inxi.changelog b/inxi.changelog
index c32598a..d9f40f5 100644
--- a/inxi.changelog
+++ b/inxi.changelog
@@ -1,4 +1,116 @@
=====================================================================================
+Version: 3.0.34
+Patch: 00
+Date: 2019-04-30
+-----------------------------------
+Changes:
+-----------------------------------
+New version, new man, new feature!! Bug fixes!
+
+Bugs:
+1. issue #182 - in freebsd, there was an oversight in the pciconf parser, it
+was using unfiltered strings as regex pattern, and of course, a string flipped
+an error. Fix was to add the regex cleaner to the string before it's used in test.
+
+2. NOTE: issue #182 had a second bug, but the issue poster didn't follow up with
+data or output so it couldn't be fixed. This was related to a syntax change in
+usbdevs -v output in FreeBSD. Such changes are too common, but it might also
+simply be a variant I have not seen or handled, but so far no data, so can't fix.
+Don't blame me if you get this bug, but do post requested debugger data if you
+want it fixed!
+
+Fixes:
+1. Updated man for weather, explained more clearly how to use country codes for
+weather output. More clarifying in general about weather location, and weather
+restrictions.
+
+Enhancements:
+1. Added avx/avx2 to default flag list in -C short form. Thanks damentz from
+liquorix for clarifying why that was a good idea. Note the initial issue came up
+in a Debian issue report, not here. People!! please post issues here, and don't bug
+maintainers with feature requests! Maintainers aren't in a position to add a feature,
+so you should go straight to the source.
+
+1.a. Created in inxi-perl/docs new doc file: cpu-flags.txt, which explains all
+the flags, and also covers the short form flags and explains why they are used.
+
+2. To resolve another issue, I made a new documentation file:
+inxi-perl/docs/inxi-custom-recommends.txt
+This is instructions for maintainers of distros who do not use rpm/apt/pacman but
+still want the --recommends feature to output their package pool package names for
+missing packages. I decided to not allow more than the default 3 package managers
+because no matter what people say, if I allow in more, the maintainer will vanish
+or lose interest, and I'll be stuck having to maintain their package lists forever.
+
+Also, it's silly to even include that package list for any distro that does not
+use rpm/apt/pacman, since the list is just wasted lines. Instructions in doc file
+show what to change, and how, and has an example to make it clear. Odds of this
+actually being used? Not high, lol, but that's fine, if people want it done, they
+can do it, if not, nothing bad happens, it just won't show any suggested install
+package, no big deal.
+
+3. Using the new disk vendor method, added even more disk vendors. Thanks
+linux litet hardware database!!
+
+4. EXCITING!! A new --admin/-a option, suggested by a user on techpatterns.com/forums/
+Now -S or -b or -F with -a option for GNU/Linux shows the kernel boot parameters,
+from /proc/cmdline. Didn't find anything comparable for BSDs, if you can tell me
+where to look, I'll add it for those too, but wasn't anywhere I looked. Do the
+BSDs even use that method? Don't know, but the logic is there, waiting to be used
+if someone shows me how to get it cleanly. The 'parameters:' item shows in the main
+'System:' -S output, and will just show the entire kernel parameters used to boot.
+
+This could be very helpful to distros who often have to determine if for example
+graphics blacklists are correctly applied for non free drivers, like nomodeset etc,
+or if the opposite is present.
+
+For forum/distro support, they just have to ask for: inxi -ba and they will see t
+the relevant graphics info, for instance, or -SGaxxx, or -Faxxx, whatever is used
+to trigger in this case the graphics and system lines.
+
+5. Updated man/help for 4 as well, now explains what they will see with --admin/
+-a options and -S. Good user suggestion, I wish all new features were this easy,
+heh.
+
+
+-----------------------------------
+-- Harald Hope - Tue, 30 Apr 2019 17:37:10 -0700
+
+=====================================================================================
+Version: 3.0.33
+Patch: 00
+Date: 2019-03-29
+-----------------------------------
+Changes:
+-----------------------------------
+New version, new man. Weather explanations, disks, bugs!!
+
+Bugs:
+1. For sensors, in some cases, gpu failed to show correctly. This fixed issue #175
+
+Fixes:
+1. Made help/man explanations of weather changes more clear.
+Particularly in regards to no automated query info. But also for supported
+location syntaxes.
+2. Some corner cases of null weather data return null and tripped
+a null data error. This is corrected.
+3. Added city duplicate filter to weather output, this hopefully will
+in some cases avoid printing city name twice, depends on weather source.
+4. Removed --weather-source option 0, that no longer works so all code was
+removed.
+5. More deb822 fixes, loosened up even more syntax. That's a poorly designed
+config syntax, hard to work with.
+
+Enhancements:
+1. Lots of new disk vendors. So many!! Thanks linux-lite hardware database!
+switched to a new method of getting disk name/vendor data, now it's a lot easier
+to check for new ones.
+2. Added fancybar to desktop info.
+
+-----------------------------------
+-- Harald Hope - Fri, 29 Mar 2019 14:03:51 -0700
+
+=====================================================================================
Version: 3.0.32
Patch: 00
Date: 2019-02-07