=================================================================== RCS file: /cvs/openbsd/update_openbsd/post_dmesg_to_nycbug,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- openbsd/update_openbsd/post_dmesg_to_nycbug 2015/02/22 19:31:29 1.2 +++ openbsd/update_openbsd/post_dmesg_to_nycbug 2015/02/23 16:10:07 1.3 @@ -7,17 +7,20 @@ # This script posts your OpenBSD dmesg to the NYC*BUG dmesg archive. -open my $de, '-|', qw( sysctl -n hw.vendor hw.product hw.version ) or die $!; -my $description = join ' ', split /\s+/s, - do { local $/ = undef; readline $de }; -close $de or die $!; +my @sysctls = ( + [qw( hw.vendor hw.product hw.version )], + [qw( hw.model )], +); -# Fall back to a less useful description -unless ($description) { - open my $de, '-|', qw( sysctl -n hw.model ) or die $!; - $description = join ' ', split /\s+/s, - do { local $/ = undef; readline $de }; - close $de or die $!; +my $description = "@ARGV"; + +while ( @sysctls and not $description ) { + my @s = @{ shift @sysctls }; + + open my $de, '-|', qw( sysctl -n ), @s or die $!; + $description = join ' ', split /\s+/s, + do { local $/ = undef; readline $de }; + close $de or die $!; } open my $dm, '<', '/var/run/dmesg.boot' or die $!;