Hello community, here is the log from the commit of package update-checker for openSUSE:Factory checked in at 2018-12-04 20:55:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/update-checker (Old) and /work/SRC/openSUSE:Factory/.update-checker.new.19453 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "update-checker" Tue Dec 4 20:55:05 2018 rev:4 rq:653530 version:1.0+git20181104.a2c4ebf Changes: -------- --- /work/SRC/openSUSE:Factory/update-checker/update-checker.changes 2018-10-04 19:03:21.903085270 +0200 +++ /work/SRC/openSUSE:Factory/.update-checker.new.19453/update-checker.changes 2018-12-04 20:55:13.892792613 +0100 @@ -1,0 +2,9 @@ +Thu Nov 29 17:45:53 UTC 2018 - iforster@suse.de + +- Update to version 1.0+git20181104.a2c4ebf: + * Improve error checking + * introduce profiles for configuration file, so that we can call the tool + from commandline or from systemd with differout output. +- Fixes boo#1117647 + +------------------------------------------------------------------- Old: ---- update-checker-1.0+git20181004.228275e.tar.xz New: ---- update-checker-1.0+git20181104.a2c4ebf.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ update-checker.spec ++++++ --- /var/tmp/diff_new_pack.am2vvN/_old 2018-12-04 20:55:14.416792029 +0100 +++ /var/tmp/diff_new_pack.am2vvN/_new 2018-12-04 20:55:14.420792024 +0100 @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# Please submit bugfixes or comments via http://bugs.opensuse.org/ # @@ -23,7 +23,7 @@ %endif Name: update-checker -Version: 1.0+git20181004.228275e +Version: 1.0+git20181104.a2c4ebf Release: 0 Summary: Scripts to check for new updates and migration targets License: GPL-2.0-or-later ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.am2vvN/_old 2018-12-04 20:55:14.464791975 +0100 +++ /var/tmp/diff_new_pack.am2vvN/_new 2018-12-04 20:55:14.464791975 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">git://github.com/thkukuk/update-checker.git</param> - <param name="changesrevision">228275efeaaec54bba29cf784a356749f1e314f8</param> + <param name="changesrevision">a2c4ebf388d647504a30e15a990fbe1dd59da35e</param> </service> </servicedata> \ No newline at end of file ++++++ update-checker-1.0+git20181004.228275e.tar.xz -> update-checker-1.0+git20181104.a2c4ebf.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/update-checker-1.0+git20181004.228275e/etc/update-checker.conf new/update-checker-1.0+git20181104.a2c4ebf/etc/update-checker.conf --- old/update-checker-1.0+git20181004.228275e/etc/update-checker.conf 2018-10-04 10:04:07.000000000 +0200 +++ new/update-checker-1.0+git20181104.a2c4ebf/etc/update-checker.conf 2018-11-04 11:21:39.000000000 +0100 @@ -1,6 +1,9 @@ [global] -output=stdout,issue +output=stdout + +[globel-systemd] +output=issue [update] -variant=dup +variant=up orphaned=false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/update-checker-1.0+git20181004.228275e/sbin/update-checker new/update-checker-1.0+git20181104.a2c4ebf/sbin/update-checker --- old/update-checker-1.0+git20181004.228275e/sbin/update-checker 2018-10-04 10:04:07.000000000 +0200 +++ new/update-checker-1.0+git20181104.a2c4ebf/sbin/update-checker 2018-11-04 11:21:39.000000000 +0100 @@ -35,6 +35,8 @@ --update Check for available updates via "zypper up", default --patch Check for available patches via "zypper patch" --dup Check for distribution updates via "zypper dup" + --profile <string> Use entry from a different profile from the configuration file. + --verbose Print additional informations. --usage Print usage --man Display manual page -h|-? Help @@ -68,6 +70,7 @@ my $output_salt = 0; my $variant = ""; my $orphaned = 0; +my $profile = ""; GetOptions('c|config=s' => $configfile, 'v|verbose' => $verbose, @@ -78,6 +81,8 @@ 'dup' => sub { $variant = "dup" }, 'patch' => sub { $variant = "patch" }, 'patches' => sub { $variant = "patch" }, + 'profile' => $profile, + 'verbose' => $verbose, 'man' => $man, 'usage' => $usage, 'help|h|?' => $help) or pod2usage(2); @@ -87,9 +92,14 @@ my $cfg = new Config::IniFiles(-file => $configfile); if (defined $cfg) { - $output_cfg = $cfg->val("global", "output", "stdout"); + $profile = "global-$profile" if ( $profile ne ""); + $output_cfg = $cfg->val($profile, "output", ""); + $output_cfg = $cfg->val("global", "output", "stdout") if ($output_cfg eq ""); $variant = $cfg->val("update", "variant", "update") if ($variant eq ""); + $variant = "update" if ($variant eq "up"); $orphaned = $cfg->val("update", "orphaned", 0); + $orphaned = 0 if ($orphaned eq "false"); + $orphaned = 1 if ($orphaned eq "true"); } $variant = "update" if ($variant eq ""); @@ -126,18 +136,21 @@ my @dup_remove; my $zypper_output; +print "Refreshing services and repositories\n" if $verbose; `zypper refresh -f --services 2>&1`; +print "Read list of pending updates\n" if $verbose; if ($variant eq "update") { $zypper_output = `zypper --no-refresh --xml list-updates 2>&1`; } elsif ($variant eq "patch" || $variant eq "patches") { $zypper_output = `zypper --no-refresh --xml list-patches 2>&1`; } elsif ($variant eq "dup") { - $zypper_output = `zypper ---no-refresh -xml --non-interactive dup --dry-run 2>&1`; + $zypper_output = `zypper --no-refresh --xml --non-interactive dup --dry-run 2>&1`; } else { warn "ERROR: unknown variant "$variant"\n"; exit 1; } +print "Parse zypper output\n" if $verbose; my $Parser = new XML::Twig(twig_handlers=>{'stream/update-status/update-list/update' => &GetUpdateList, 'stream/update-status/blocked-update-list/update' => &GetUpdateList, @@ -153,6 +166,7 @@ @dup_remove = sort @dup_remove unless $dup_remove_count == 0; if ($orphaned == 1) { + print "Search for orphaned packages\n" if $verbose; $zypper_output = `zypper --no-refresh --xml pa --orphaned 2>&1`; $Parser = new XML::Twig(twig_handlers=>{'stream/XXX' => &GetOrphanedList}); @@ -167,27 +181,33 @@ if ($patch_count > 0) { print_stdout ("patches", $patch_count, @patches) if ($output_stdout); - create_issue ("patches", $patch_count, @patches) if ($output_stdout); - update_grains ("patches", $patch_count, @patches) if ($output_stdout); + create_issue ("patches", $patch_count, @patches) if ($output_issue); + update_grains ("patches", $patch_count, @patches) if ($output_salt); } if ($dup_install_count > 0 || $dup_update_count > 0 || $dup_remove_count > 0) { print "Distribution update: $dup_install_count to install, $dup_update_count to update, $dup_remove_count to remove\n"; - print "List of packages to install: "; - foreach (@dup_install) { - print "$_ "; + if ($dup_install_count > 0) { + print "List of packages to install: "; + foreach (@dup_install) { + print "$_ "; + } + print "\n"; } - print "\n"; - print "List of packages to update: "; - foreach (@dup_update) { - print "$_ "; + if ($dup_update_count > 0) { + print "List of packages to update: "; + foreach (@dup_update) { + print "$_ "; + } + print "\n"; } - print "\n"; - print "List of packages to remove: "; - foreach (@dup_remove) { - print "$_ "; + if ($dup_remove_count) { + print "List of packages to remove: "; + foreach (@dup_remove) { + print "$_ "; + } + print "\n"; } - print "\n"; } exit; @@ -197,11 +217,13 @@ my ($type, $count, @packages) = @_; print "Pending $type: $count\n"; - print "List of $type: "; - foreach (@packages) { - print "$_ "; + if ($count > 0) { + print "List of $type: "; + foreach (@packages) { + print "$_ "; + } + print "\n"; } - print "\n"; } @@ -209,10 +231,13 @@ { my ($type, $count, @packages) = @_; - open (my $fh, '>', "/var/run/issue.d/83-$type"); - print $fh "Pending $type: $count\n"; - close $fh; - `/usr/sbin/issue-generator`; + if (open (my $fh, '>', "/var/run/issue.d/83-$type")) { + print $fh "Pending $type: $count\n"; + close $fh; + `/usr/sbin/issue-generator`; + } else { + warn "Could not open file '/var/run/issue.d/83-$type'. $!"; + } } sub update_grains