=================================================================== RCS file: /cvs/openbsd/update_openbsd/post_dmesg_to_nycbug,v retrieving revision 1.1 retrieving revision 1.5 diff -u -r1.1 -r1.5 --- openbsd/update_openbsd/post_dmesg_to_nycbug 2015/02/22 19:22:08 1.1 +++ openbsd/update_openbsd/post_dmesg_to_nycbug 2015/03/03 18:56:08 1.5 @@ -3,15 +3,33 @@ use warnings; use feature 'say'; +use Sys::Hostname; use HTTP::Tiny; # 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 $nickname = "$ENV{USER}"; +my $email = "$ENV{USER}\@" . hostname(); +my @sysctls = ( + [qw( hw.vendor hw.product hw.version )], + [qw( hw.model )], +); + +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 $!; +} + +print "About to post '$description', OK? "; +readline STDIN; + open my $dm, '<', '/var/run/dmesg.boot' or die $!; my $dmesg = do { local $/ = undef; readline $dm }; close $dm; @@ -23,8 +41,8 @@ 'http://www.nycbug.org/index.cgi', { action => 'dmesgd', do => 'addd', - nickname => 'afresh1', - email => 'andrew+dmesgd@afresh1.com', + nickname => $nickname, + email => $email, description => $description, dmesg => $dmesg, }