Hello community,

here is the log from the commit of package perl-Bootloader for openSUSE:Factory 
checked in at 2018-07-13 10:15:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Bootloader (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Bootloader.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Bootloader"

Fri Jul 13 10:15:26 2018 rev:183 rq:621153 version:0.921

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Bootloader/perl-Bootloader.changes  
2018-03-30 11:58:11.865748549 +0200
+++ /work/SRC/openSUSE:Factory/.perl-Bootloader.new/perl-Bootloader.changes     
2018-07-13 10:15:29.810038013 +0200
@@ -0,0 +1,14 @@
+--------------------------------------------------------------------
+Thu Jul 5 13:10:53 UTC 2018 - [email protected]
+
+- merge gh#openSUSE/perl-bootloader#116
+- add --get-option to pbl (bsc#1033776, bsc#1050349)
+- 0.921
+
+--------------------------------------------------------------------
+Thu Jul 5 11:32:35 UTC 2018 - [email protected]
+
+- merge gh#openSUSE/perl-bootloader#115
+- Avoid undefined var warning
+- 0.920
+

Old:
----
  perl-Bootloader-0.919.tar.xz

New:
----
  perl-Bootloader-0.921.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Bootloader.spec ++++++
--- /var/tmp/diff_new_pack.qyVdaW/_old  2018-07-13 10:15:30.350038651 +0200
+++ /var/tmp/diff_new_pack.qyVdaW/_new  2018-07-13 10:15:30.354038655 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           perl-Bootloader
-Version:        0.919
+Version:        0.921
 Release:        0
 Requires:       coreutils
 Requires:       perl-base = %{perl_version}

++++++ perl-Bootloader-0.919.tar.xz -> perl-Bootloader-0.921.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/perl-Bootloader-0.919/Makefile 
new/perl-Bootloader-0.921/Makefile
--- old/perl-Bootloader-0.919/Makefile  2017-05-12 11:34:28.000000000 +0200
+++ new/perl-Bootloader-0.921/Makefile  2018-07-05 15:10:53.000000000 +0200
@@ -42,12 +42,14 @@
        @install -m 755 grub2/config $(DESTDIR)/usr/lib/bootloader/grub2
        @install -m 755 grub2/add-option $(DESTDIR)/usr/lib/bootloader/grub2
        @install -m 755 grub2/del-option $(DESTDIR)/usr/lib/bootloader/grub2
+       @install -m 755 grub2/get-option $(DESTDIR)/usr/lib/bootloader/grub2
 
        @install -d -m 755 $(DESTDIR)/usr/lib/bootloader/grub2-efi
        @install -m 755 grub2-efi/install 
$(DESTDIR)/usr/lib/bootloader/grub2-efi
        @install -m 755 grub2/config $(DESTDIR)/usr/lib/bootloader/grub2-efi
        @install -m 755 grub2/add-option $(DESTDIR)/usr/lib/bootloader/grub2-efi
-       @install -m 755 grub2/del-option $(DESTDIR)/usr/lib/bootloader/grub2
+       @install -m 755 grub2/del-option $(DESTDIR)/usr/lib/bootloader/grub2-efi
+       @install -m 755 grub2/get-option $(DESTDIR)/usr/lib/bootloader/grub2-efi
 
        @install -d -m 755 $(DESTDIR)/usr/lib/bootloader/u-boot
        @install -m 755 u-boot/config $(DESTDIR)/usr/lib/bootloader/u-boot
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/perl-Bootloader-0.919/VERSION 
new/perl-Bootloader-0.921/VERSION
--- old/perl-Bootloader-0.919/VERSION   2017-05-12 11:34:28.000000000 +0200
+++ new/perl-Bootloader-0.921/VERSION   2018-07-05 15:10:53.000000000 +0200
@@ -1 +1 @@
-0.919
+0.921
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/perl-Bootloader-0.919/changelog 
new/perl-Bootloader-0.921/changelog
--- old/perl-Bootloader-0.919/changelog 2017-05-12 11:34:28.000000000 +0200
+++ new/perl-Bootloader-0.921/changelog 2018-07-05 15:10:53.000000000 +0200
@@ -1,3 +1,9 @@
+2018-07-05:    0.921
+       - add --get-option to pbl (bsc #1033776, bsc #1050349)
+
+2018-05-15:    0.920
+       - Avoid undefined var warning
+
 2017-04-13:    0.919
        - fix device name check (bsc #1033634)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/perl-Bootloader-0.919/grub2/get-option 
new/perl-Bootloader-0.921/grub2/get-option
--- old/perl-Bootloader-0.919/grub2/get-option  1970-01-01 01:00:00.000000000 
+0100
+++ new/perl-Bootloader-0.921/grub2/get-option  2018-07-05 15:10:53.000000000 
+0200
@@ -0,0 +1,53 @@
+#! /usr/bin/perl
+
+# usage: get-option OPTION
+#
+# Read boot option.
+#
+# OPTION is either of the form 'key=value' or 'key="value"' or just 'key'.
+#
+# The option value is written into the file passed via 'PBL_RESULT' 
environment var.
+# Either 'option=value', or 'option', or nothing is returned.
+
+use strict;
+
+my $file = "/etc/default/grub";
+
+my $opt = shift;
+
+my $opt_name = $opt;
+
+if($opt_name =~ s/=("?).*//) {
+  $opt =~ s/"/\\"/g;
+}
+
+exit 1 if $opt_name eq "";
+
+open my $f, $file or die "$file: $!\n";
+my @lines = (<$f>);
+close $f;
+
+my $option;
+
+for (@lines) {
+  if(/^(GRUB_CMDLINE_LINUX_DEFAULT)=(.*)/) {
+    my $val = $2;
+
+    $val =~ s/(^"\s*|\s*"\s*$)//g;
+
+    if(
+      $val =~ /(^|\s)($opt=(\\"[^"]*\\"\s*))/ ||
+      $val =~ /(^|\s)($opt((\s|$)|(=\S*\s*)))/
+    ) {
+      $option = $2;
+      $option =~ s/^\s+|\s+$//g;
+    }
+  }
+}
+
+if($option && open my $f, ">", $ENV{PBL_RESULT}) {
+  print $f $option;
+  close $f;
+}
+
+exit 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/perl-Bootloader-0.919/pbl 
new/perl-Bootloader-0.921/pbl
--- old/perl-Bootloader-0.919/pbl       2017-05-12 11:34:28.000000000 +0200
+++ new/perl-Bootloader-0.921/pbl       2018-07-05 15:10:53.000000000 +0200
@@ -18,6 +18,7 @@
 use strict;
 use POSIX qw ( strftime uname );
 
+use File::Temp;
 use Getopt::Long;
 use Data::Dumper;
 $Data::Dumper::Sortkeys = 1;
@@ -61,6 +62,7 @@
     --default ENTRY         Set default boot entry to ENTRY.
     --add-option OPTION     Add OPTION to default boot options.
     --del-option OPTION     Delete OPTION from default boot options.
+    --get-option OPTION     Get OPTION from default boot options.
     --log LOGFILE           Log messages to LOGFILE (default: /var/log/pbl.log)
     --version               Show pbl version.
     --help                  Write this help text.
@@ -166,6 +168,14 @@
 
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# exit_code = run_command(args)
+#
+# Run external command. All output is logged.
+#
+# The external command may put anything into the (temporary) file passed via
+# 'PBL_RESULT' environment variable. The content of that file is read and
+# printed to STDOUT.
+#
 sub run_command
 {
   my $ret;
@@ -173,6 +183,9 @@
 
   my $command = join " ", @_;
 
+  my $result_fh = File::Temp->new(TEMPLATE => 'pbl.XXXXXX');
+  $ENV{PBL_RESULT} = $result_fh->filename;
+
   if(open my $f, "-|") {
     binmode $f, ':utf8';
     local $/;
@@ -189,6 +202,12 @@
 
   if(!$ret) {
     log_msg(1, "'$command' = $ret, output:", $output);
+    local $/;
+    my $result = <$result_fh>;
+    if($result ne "") {
+      print "$result\n";
+      log_msg(1, "result: $result");
+    }
   }
   else {
     log_msg(3, "'$command' failed with exit code $ret, output:", $output);
@@ -241,6 +260,7 @@
     'default=s'    => sub { push @todo, [ 'default', $_[1] ] },
     'add-option=s' => sub { push @todo, [ 'add-option', $_[1] ] },
     'del-option=s' => sub { push @todo, [ 'del-option', $_[1] ] },
+    'get-option=s' => sub { push @todo, [ 'get-option', $_[1] ] },
     'version'      => sub { print "$VERSION\n"; exit 0 },
     'help'         => sub { pbl_usage 0 },
   ) || pbl_usage 1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/perl-Bootloader-0.919/src/Tools.pm 
new/perl-Bootloader-0.921/src/Tools.pm
--- old/perl-Bootloader-0.919/src/Tools.pm      2017-05-12 11:34:28.000000000 
+0200
+++ new/perl-Bootloader-0.921/src/Tools.pm      2018-07-05 15:10:53.000000000 
+0200
@@ -596,7 +596,7 @@
 
     $lib_ref->{tools}{mdadm} = $mdadm = AddPathToExecutable("mdadm");
 
-    if (-e $mdadm) {
+    if ($mdadm && -e $mdadm) {
       open (MD, "$mdadm --detail --verbose --scan 2>/dev/null |");
     }
     else {


Reply via email to