Hello community, here is the log from the commit of package yast2-update for openSUSE:Factory checked in at 2014-04-05 14:42:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-update (Old) and /work/SRC/openSUSE:Factory/.yast2-update.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-update" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-update/yast2-update.changes 2013-12-23 22:21:49.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-update.new/yast2-update.changes 2014-04-05 14:42:53.000000000 +0200 @@ -1,0 +2,15 @@ +Fri Mar 28 15:02:22 CET 2014 - [email protected] + +- Fixed loading kernel modules while probing disks (bnc#869091) +- 3.1.4 + +------------------------------------------------------------------- +Thu Mar 27 15:25:48 CET 2014 - [email protected] + +- Re-added SUSERelease library to read product information from + /etc/SuSE-release (bnc#869091) +- Using OSRelease (and then SUSERelease as a fallback) to + find out the name of the installed system (bnc#869091) +- 3.1.3 + +------------------------------------------------------------------- Old: ---- yast2-update-3.1.2.tar.bz2 New: ---- yast2-update-3.1.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-update.spec ++++++ --- /var/tmp/diff_new_pack.aXe6cz/_old 2014-04-05 14:42:53.000000000 +0200 +++ /var/tmp/diff_new_pack.aXe6cz/_new 2014-04-05 14:42:53.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package yast2-update # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,14 +17,17 @@ Name: yast2-update -Version: 3.1.2 +Version: 3.1.4 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: %{name}-%{version}.tar.bz2 BuildRequires: update-desktop-files +BuildRequires: yast2 >= 3.1.28 BuildRequires: yast2-devtools >= 3.1.15 +BuildRequires: yast2-packager +BuildRequires: yast2-ruby-bindings >= 1.0.0 # xmllint BuildRequires: libxml2-tools @@ -32,10 +35,13 @@ # control.rng BuildRequires: yast2-installation-control +# Needed for tests +BuildRequires: rubygem-rspec + # Stroage::ChangeDmNamesFromCrypttab Requires: yast2-storage >= 2.22.9 # OSRelease -Requires: yast2 >= 3.0.4 +Requires: yast2 >= 3.1.28 Requires: yast2-installation # Function SelectKernelPackages has been moved to Packages module (bnc #326269). Requires: yast2-packager >= 2.17.27 ++++++ yast2-update-3.1.2.tar.bz2 -> yast2-update-3.1.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.2/package/yast2-update.changes new/yast2-update-3.1.4/package/yast2-update.changes --- old/yast2-update-3.1.2/package/yast2-update.changes 2013-12-19 13:27:43.000000000 +0100 +++ new/yast2-update-3.1.4/package/yast2-update.changes 2014-03-28 15:53:02.000000000 +0100 @@ -1,4 +1,19 @@ ------------------------------------------------------------------- +Fri Mar 28 15:02:22 CET 2014 - [email protected] + +- Fixed loading kernel modules while probing disks (bnc#869091) +- 3.1.4 + +------------------------------------------------------------------- +Thu Mar 27 15:25:48 CET 2014 - [email protected] + +- Re-added SUSERelease library to read product information from + /etc/SuSE-release (bnc#869091) +- Using OSRelease (and then SUSERelease as a fallback) to + find out the name of the installed system (bnc#869091) +- 3.1.3 + +------------------------------------------------------------------- Wed Dec 18 12:44:15 UTC 2013 - [email protected] - updated BuildRequires: RNG schema for control files has been diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.2/package/yast2-update.spec new/yast2-update-3.1.4/package/yast2-update.spec --- old/yast2-update-3.1.2/package/yast2-update.spec 2013-12-19 13:27:43.000000000 +0100 +++ new/yast2-update-3.1.4/package/yast2-update.spec 2014-03-28 15:53:02.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-update -Version: 3.1.2 +Version: 3.1.4 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -27,6 +27,9 @@ License: GPL-2.0 BuildRequires: update-desktop-files BuildRequires: yast2-devtools >= 3.1.15 +BuildRequires: yast2-ruby-bindings >= 1.0.0 +BuildRequires: yast2 >= 3.1.28 +BuildRequires: yast2-packager # xmllint BuildRequires: libxml2-tools @@ -34,10 +37,13 @@ # control.rng BuildRequires: yast2-installation-control +# Needed for tests +BuildRequires: rubygem-rspec + # Stroage::ChangeDmNamesFromCrypttab Requires: yast2-storage >= 2.22.9 # OSRelease -Requires: yast2 >= 3.0.4 +Requires: yast2 >= 3.1.28 Requires: yast2-installation # Function SelectKernelPackages has been moved to Packages module (bnc #326269). Requires: yast2-packager >= 2.17.27 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.2/src/Makefile.am new/yast2-update-3.1.4/src/Makefile.am --- old/yast2-update-3.1.2/src/Makefile.am 2013-12-19 13:27:43.000000000 +0100 +++ new/yast2-update-3.1.4/src/Makefile.am 2014-03-28 15:53:02.000000000 +0100 @@ -2,7 +2,8 @@ module_DATA = \ modules/Update.rb \ - modules/RootPart.rb + modules/RootPart.rb \ + modules/SUSERelease.rb client_DATA = \ clients/inst_rootpart.rb \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.2/src/modules/RootPart.rb new/yast2-update-3.1.4/src/modules/RootPart.rb --- old/yast2-update-3.1.2/src/modules/RootPart.rb 2013-12-19 13:27:43.000000000 +0100 +++ new/yast2-update-3.1.4/src/modules/RootPart.rb 2014-03-28 15:53:02.000000000 +0100 @@ -44,7 +44,6 @@ Yast.import "ModuleLoading" Yast.import "FileSystems" Yast.import "Update" - Yast.import "OSRelease" Yast.import "FileUtils" Yast.import "Arch" Yast.import "String" @@ -1962,13 +1961,9 @@ end # Get installed release name - release = OSRelease.ReleaseInformation(Installation.destdir) - Builtins.y2debug("release: %1", release) - if release == "?" - # label for an unknown installed system - release = _("Unknown") - end - Ops.set(freshman, :name, release) + # TRANSLATORS: label for an unknown installed system + freshman[:name] = Update.installed_product || _("Unknown") + Builtins.y2debug("release: %1", freshman[:name]) # Right architecture? Ops.set( @@ -2049,35 +2044,24 @@ def FindRootPartitions return if @didSearchForRootPartitions - ModuleLoading.Load( - "reiserfs", - "", - "Linux", - "Reiser FS", - Linuxrc.manual, - true - ) - ModuleLoading.Load("jfs", "", "Linux", "JFS", Linuxrc.manual, true) - ModuleLoading.Load("xfs", "", "Linux", "XFS", Linuxrc.manual, true) - ModuleLoading.Load("ext3", "", "Linux", "Ext3", Linuxrc.manual, true) - ModuleLoading.Load("ext4", "", "Linux", "Ext4", Linuxrc.manual, true) - ModuleLoading.Load("btrfs", "", "Linux", "BtrFS", Linuxrc.manual, true) - ModuleLoading.Load("raid0", "", "Linux", "Raid 0", Linuxrc.manual, true) - ModuleLoading.Load("raid1", "", "Linux", "Raid 1", Linuxrc.manual, true) - ModuleLoading.Load("raid5", "", "Linux", "Raid 5", Linuxrc.manual, true) - ModuleLoading.Load("raid6", "", "Linux", "Raid 6", Linuxrc.manual, true) - ModuleLoading.Load("raid10", "", "Linux", "Raid 10", Linuxrc.manual, true) - ModuleLoading.Load( - "multipath", - "", - "Linux", - "Multipath", - Linuxrc.manual, - true - ) - ModuleLoading.Load("dm-mod", "", "Linux", "DM", Linuxrc.manual, true) - SCR.Execute(path(".target.bash"), "/sbin/devmap_mknod.sh") - ModuleLoading.Load("dm-snapshot", "", "Linux", "DM", Linuxrc.manual, true) + modules_to_load = { + "reiserfs" => "Reiser FS", + "xfs" => "XFS", + "ext3" => "Ext3", + "ext4" => "Ext4", + "btrfs" => "BtrFS", + "raid0" => "Raid 0", + "raid1" => "Raid 1", + "raid5" => "Raid 5", + "raid6" => "Raid 6", + "raid10" => "Raid 10", + "dm-multipath" => "Multipath", + "dm-mod" => "DM", + "dm-snapshot" => "DM Snapshot", + } + modules_to_load.each do |module_to_load, show_name| + ModuleLoading.Load(module_to_load, "", "Linux", show_name, Linuxrc.manual, true) + end if Mode.test Storage.SetTargetMap( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.2/src/modules/SUSERelease.rb new/yast2-update-3.1.4/src/modules/SUSERelease.rb --- old/yast2-update-3.1.2/src/modules/SUSERelease.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-update-3.1.4/src/modules/SUSERelease.rb 2014-03-28 15:53:02.000000000 +0100 @@ -0,0 +1,91 @@ +# encoding: utf-8 + +# ------------------------------------------------------------------------------ +# Copyright (c) 2006-2012 Novell, Inc. All Rights Reserved. +# +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of version 2 of the GNU General Public License as published by the +# Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, contact Novell, Inc. +# +# To contact Novell about this file by physical or electronic mail, you may find +# current contact information at www.novell.com. +# ------------------------------------------------------------------------------ + +# Module: SUSERelease.rb +# +# Authors: Lukas Ocilka <[email protected]> +# +# Purpose: Provides access to information provided by /etc/SuSE-release. +# Only for backward-compatibility during upgrade - it has been +# replaced by /etc/os-release handled by OSRelease module. +# +require "yast" + +module Yast + + class SUSEReleaseFileMissingError < StandardError + def initialize(message) + super message + end + end + + class SUSEReleaseClass < Module + include Yast::Logger + + RELEASE_FILE_PATH = "/etc/SuSE-release" + + def initialize + textdomain "update" + + Yast.import "FileUtils" + end + + # Returns product name as found in SuSE-release file. + # Compatible with OSRelease.ReleaseInformation. + # Returns SUSEReleaseFileMissingError if SuSE-release file is missing. + # Returns IOError is SuSE-release could not be open. + # + # @param [String] system base-directory, default is "/" + # @return [String] product name + def ReleaseInformation(base_dir="/") + release_file = File.join(base_dir, RELEASE_FILE_PATH) + + if !FileUtils.Exists(release_file) + log.info "Release file #{release_file} not found" + raise( + SUSEReleaseFileMissingError, + _("Release file %{file} not found") % { :file => release_file } + ) + end + + file_contents = SCR.Read(path(".target.string"), release_file) + if file_contents.nil? + log.error "Cannot read file #{release_file}" + raise( + IOError, + _("Cannot read release file %{file}") % { :file => release_file } + ) + end + + product_name = file_contents.split(/\n/)[0] + shorten(product_name) + end + + # Removes all unneeded stuff such as architecture or product nickname + def shorten(long_name) + long_name.gsub(/[ ]*\(.*/, "") + end + + publish :function => :ReleaseInformation, :type => "string (string)" + end + + SUSERelease = SUSEReleaseClass.new +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.2/src/modules/Update.rb new/yast2-update-3.1.4/src/modules/Update.rb --- old/yast2-update-3.1.2/src/modules/Update.rb 2013-12-19 13:27:43.000000000 +0100 +++ new/yast2-update-3.1.4/src/modules/Update.rb 2014-03-28 15:53:02.000000000 +0100 @@ -27,11 +27,14 @@ # # Purpose: Update module # -# $Id$ + require "yast" module Yast class UpdateClass < Module + + include Yast::Logger + def main Yast.import "Pkg" @@ -43,6 +46,7 @@ Yast.import "ProductControl" Yast.import "Stage" Yast.import "OSRelease" + Yast.import "SUSERelease" Yast.import "Mode" # number of packages to install @@ -156,7 +160,7 @@ default_ous = Convert.to_boolean(default_ous_a) end - installed_system = OSRelease.ReleaseInformation(Installation.destdir) + installed_system = installed_product Builtins.y2milestone( "Processing '%1' from '%2'", installed_system, @@ -208,7 +212,7 @@ default_sdp = Convert.to_boolean(default_sdp_a) end - installed_system = OSRelease.ReleaseInformation(Installation.destdir) + installed_system = installed_product Builtins.y2milestone( "Processing '%1' from '%2'", installed_system, @@ -244,7 +248,7 @@ # Returns whether the installed product is supported for upgrade. # (Functionality for FATE #301844). def IsProductSupportedForUpgrade - installed_system = OSRelease.ReleaseInformation(Installation.destdir) + installed_system = installed_product Builtins.y2milestone( "Processing '%1' from '%2'", installed_system, @@ -481,7 +485,7 @@ # cannot use product information from package manager # for pre-zypp products # #153576 - old_name = OSRelease.ReleaseInformation(Installation.destdir) + old_name = installed_product Builtins.y2milestone("OSRelease::ReleaseInformation: %1", old_name) # Remove 'Beta...' from product release @@ -819,6 +823,28 @@ nil end + # Returns product installed on root partition mounted to Installation.destdir + # If not found, nil is returned + # + # @return [String] product name + def installed_product + begin + return OSRelease.ReleaseInformation(Installation.destdir) + rescue OSReleaseFileMissingError => e + log.info "Cannot read release information #{e.message}, trying SUSERelease" + end + + begin + return SUSERelease.ReleaseInformation(Installation.destdir) + rescue SUSEReleaseFileMissingError => e + log.info "Cannot read release information: #{e.message}" + rescue IOError => e + log.error "Error reading SuSE-release in #{Installation.destdir}: #{e.message}" + end + + return nil + end + publish :variable => :packages_to_install, :type => "integer" publish :variable => :packages_to_update, :type => "integer" publish :variable => :packages_to_remove, :type => "integer" @@ -850,6 +876,7 @@ publish :function => :GetBasePatterns, :type => "list <string> ()" publish :function => :SetDesktopPattern, :type => "void ()" publish :function => :Detach, :type => "void ()" + publish :function => :installed_product, :type => "string ()" end Update = UpdateClass.new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.2/test/Makefile.am new/yast2-update-3.1.4/test/Makefile.am --- old/yast2-update-3.1.2/test/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-update-3.1.4/test/Makefile.am 2014-03-28 15:53:02.000000000 +0100 @@ -0,0 +1,9 @@ +TESTS = \ + suse_release_test.rb \ + update_test.rb + +TEST_EXTENSIONS = .rb +RB_LOG_COMPILER = rspec +VERBOSE = 1 +EXTRA_DIST = $(TESTS) + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.2/test/data/etc/SuSE-release_0 new/yast2-update-3.1.4/test/data/etc/SuSE-release_0 --- old/yast2-update-3.1.2/test/data/etc/SuSE-release_0 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-update-3.1.4/test/data/etc/SuSE-release_0 2014-03-28 15:53:02.000000000 +0100 @@ -0,0 +1,3 @@ +SUSE Linux Enterprise Server 11 (x86_64) +VERSION = 11 +PATCHLEVEL = 3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.2/test/data/etc/SuSE-release_1 new/yast2-update-3.1.4/test/data/etc/SuSE-release_1 --- old/yast2-update-3.1.2/test/data/etc/SuSE-release_1 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-update-3.1.4/test/data/etc/SuSE-release_1 2014-03-28 15:53:02.000000000 +0100 @@ -0,0 +1,2 @@ +openSUSE 12.2 (Badger) (x86_64) +VERSION = 11.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.2/test/data/update-test-2/etc/SuSE-release new/yast2-update-3.1.4/test/data/update-test-2/etc/SuSE-release --- old/yast2-update-3.1.2/test/data/update-test-2/etc/SuSE-release 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-update-3.1.4/test/data/update-test-2/etc/SuSE-release 2014-03-28 15:53:02.000000000 +0100 @@ -0,0 +1,3 @@ +SUSE Linux Enterprise Server 11 (x86_64) +VERSION = 11 +PATCHLEVEL = 3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.2/test/data/update-test-3/etc/SuSE-release new/yast2-update-3.1.4/test/data/update-test-3/etc/SuSE-release --- old/yast2-update-3.1.2/test/data/update-test-3/etc/SuSE-release 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-update-3.1.4/test/data/update-test-3/etc/SuSE-release 2014-03-28 15:53:02.000000000 +0100 @@ -0,0 +1,3 @@ +SUSE Linux Enterprise Server 11 (x86_64) +VERSION = 11 +PATCHLEVEL = 3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.2/test/data/update-test-3/etc/os-release new/yast2-update-3.1.4/test/data/update-test-3/etc/os-release --- old/yast2-update-3.1.2/test/data/update-test-3/etc/os-release 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-update-3.1.4/test/data/update-test-3/etc/os-release 2014-03-28 15:53:02.000000000 +0100 @@ -0,0 +1,10 @@ +NAME=openSUSE +VERSION="13.1 (Bottle)" +VERSION_ID="13.1" +PRETTY_NAME="openSUSE 13.1 (Bottle) (x86_64)" +ID=opensuse +ANSI_COLOR="0;32" +CPE_NAME="cpe:/o:opensuse:opensuse:13.1" +BUG_REPORT_URL="https://bugs.opensuse.org" +HOME_URL="https://opensuse.org/" +ID_LIKE="suse" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.2/test/suse_release_test.rb new/yast2-update-3.1.4/test/suse_release_test.rb --- old/yast2-update-3.1.2/test/suse_release_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-update-3.1.4/test/suse_release_test.rb 2014-03-28 15:53:02.000000000 +0100 @@ -0,0 +1,31 @@ +#! /usr/bin/rspec + +ENV["Y2DIR"] = File.join(File.expand_path(File.dirname(__FILE__)), "../src/") + +require "yast" + +Yast.import "SUSERelease" + +DATA_DIR = File.join( + File.expand_path(File.dirname(__FILE__)), + "data" +) + +describe Yast::SUSERelease do + describe "#ReleaseInformation" do + it "returns product name without any additional information (arch, sub-release)" do + stub_const("Yast::SUSEReleaseClass::RELEASE_FILE_PATH", "/etc/SuSE-release_0") + expect(Yast::SUSERelease.ReleaseInformation(DATA_DIR)).to eq "SUSE Linux Enterprise Server 11" + + stub_const("Yast::SUSEReleaseClass::RELEASE_FILE_PATH", "/etc/SuSE-release_1") + expect(Yast::SUSERelease.ReleaseInformation(DATA_DIR)).to eq "openSUSE 12.2" + end + + it "raises exception if SuSE-release file is not found" do + stub_const("Yast::SUSEReleaseClass::RELEASE_FILE_PATH", "/etc/this-file-doesnt-exist") + expect { Yast::SUSERelease.ReleaseInformation(DATA_DIR) }.to raise_error( + Yast::SUSEReleaseFileMissingError + ) + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.2/test/update_test.rb new/yast2-update-3.1.4/test/update_test.rb --- old/yast2-update-3.1.2/test/update_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-update-3.1.4/test/update_test.rb 2014-03-28 15:53:02.000000000 +0100 @@ -0,0 +1,32 @@ +#! /usr/bin/rspec + +ENV["Y2DIR"] = File.join(File.expand_path(File.dirname(__FILE__)), "../src/") + +require "yast" + +Yast.import "Update" +Yast.import "Installation" + +DATA_DIR = File.join( + File.expand_path(File.dirname(__FILE__)), + "data" +) + +describe Yast::Update do + describe "#installed_product" do + it "returns `nil` if neither os-release nor SuSE-release files exist in Installation.destdir" do + Yast::Installation.destdir = File.join(DATA_DIR, "update-test-1") + expect(Yast::Update.installed_product).to be_nil + end + + it "returns product name from SUSE-release if os-release is missing and SUSE-release exists in Installation.destdir" do + Yast::Installation.destdir = File.join(DATA_DIR, "update-test-2") + expect(Yast::Update.installed_product).to eq("SUSE Linux Enterprise Server 11") + end + + it "returns product name from os-release if such file exists in Installation.destdir" do + Yast::Installation.destdir = File.join(DATA_DIR, "update-test-3") + expect(Yast::Update.installed_product).to eq("openSUSE 13.1") + end + end +end -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
