[yast-commit] [ci_new_pac] JFYI yast2-update -> sle12
Script 'mail_helper' called by ro Hello packager, This is just FYI. Your package was checked in in distribution "sle12" by autobuild-member: ro. Here comes the log... ---------------------------%<------------------------------ Hi, here is the log from ci_new_pac /mounts/work_src_done/SLE12/yast2-update -> sle12 ## BNC# 869091 : "migration: Using DVD media upgrade from SLED11 SP3 (full), sp3 system not listed in [system for update] table" (ASSIGNED/) Changes: -------- --- /work/SRC/SUSE:SLE-12:GA/yast2-update/yast2-update.changes 2014-01-17 14:16:38.000000000 +0100 +++ /mounts/work_src_done/SLE12/yast2-update/yast2-update.changes 2014-03-28 11:26:54.000000000 +0100 @@ -1,0 +2,9 @@ +Thu Mar 27 15:25:48 CET 2014 - locilka@suse.com + +- 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 + +------------------------------------------------------------------- calling whatdependson for sle12-i586 Packages directly triggered for rebuild: - yast2-product-creator - yast2-schema - yast2-update ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/SUSE:SLE-12:GA/yast2-update (Old) and /mounts/work_src_done/SLE12/yast2-update (BS:build ID:35066 MAIL:yast-commit@opensuse.org) (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-update", Maintainer is "yast-commit@opensuse.org" Old: ---- yast2-update-3.1.2.tar.bz2 New: ---- yast2-update-3.1.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-update.spec ++++++ --- /var/tmp/diff_new_pack.ijSwWG/_old 2014-03-28 12:03:20.000000000 +0100 +++ /var/tmp/diff_new_pack.ijSwWG/_new 2014-03-28 12:03:20.000000000 +0100 @@ -17,14 +17,19 @@ Name: yast2-update -Version: 3.1.2 +Version: 3.1.3 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: %{name}-%{version}.tar.bz2 +Group: System/YaST +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 @@ -32,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 @@ -52,13 +60,11 @@ Requires: yast2-ruby-bindings >= 1.0.0 Summary: YaST2 - Update -License: GPL-2.0 -Group: System/YaST %package FACTORY +Group: System/YaST PreReq: %fillup_prereq -Requires: yast2 -Requires: yast2-update +Requires: yast2-update yast2 # moved into yast2-update from yast2-installation # to remove dependency on yast2-storage @@ -67,7 +73,6 @@ Requires: yast2-ruby-bindings >= 1.0.0 Summary: YaST2 - Update -Group: System/YaST %description Use this component if you wish to update your system. @@ -84,6 +89,7 @@ %install %yast_install + %files %defattr(-,root,root) %{yast_ybindir}/* @@ -115,5 +121,3 @@ %{yast_controldir}/update.xml %{yast_clientdir}/update.rb %{yast_clientdir}/run_update.rb - -%changelog ++++++ yast2-update-3.1.2.tar.bz2 -> yast2-update-3.1.3.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.3/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.3/package/yast2-update.changes 2014-03-28 11:23:37.000000000 +0100 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Thu Mar 27 15:25:48 CET 2014 - locilka@suse.com + +- 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 - lslezak@suse.cz - 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.3/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.3/package/yast2-update.spec 2014-03-28 11:23:37.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-update -Version: 3.1.2 +Version: 3.1.3 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.3/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.3/src/Makefile.am 2014-03-28 11:23:37.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.3/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.3/src/modules/RootPart.rb 2014-03-28 11:23:37.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( 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.3/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.3/src/modules/SUSERelease.rb 2014-03-28 11:23:37.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 <locilka@suse.cz> +# +# 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.3/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.3/src/modules/Update.rb 2014-03-28 11:23:37.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.3/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.3/test/Makefile.am 2014-03-28 11:23:37.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.3/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.3/test/data/etc/SuSE-release_0 2014-03-28 11:23:37.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.3/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.3/test/data/etc/SuSE-release_1 2014-03-28 11:23:37.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.3/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.3/test/data/update-test-2/etc/SuSE-release 2014-03-28 11:23:37.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.3/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.3/test/data/update-test-3/etc/SuSE-release 2014-03-28 11:23:37.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.3/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.3/test/data/update-test-3/etc/os-release 2014-03-28 11:23:37.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.3/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.3/test/suse_release_test.rb 2014-03-28 11:23:37.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.3/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.3/test/update_test.rb 2014-03-28 11:23:37.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 continue with "q"... Checked in at Fri Mar 28 12:03:45 CET 2014 by ro Remember to have fun... -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
ro