Hello community, here is the log from the commit of package yast2 for openSUSE:Factory checked in at 2013-08-07 21:59:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2 (Old) and /work/SRC/openSUSE:Factory/.yast2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2/yast2.changes 2013-08-01 11:07:21.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2.new/yast2.changes 2013-08-07 22:00:00.000000000 +0200 @@ -1,0 +2,6 @@ +Mon Aug 5 10:47:14 CEST 2013 - [email protected] + +- added support for handling product profiles (port of fate#310730) +- 3.0.1 + +------------------------------------------------------------------- Old: ---- yast2-3.0.0.tar.bz2 New: ---- yast2-3.0.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2.spec ++++++ --- /var/tmp/diff_new_pack.CajMRj/_old 2013-08-07 22:00:02.000000000 +0200 +++ /var/tmp/diff_new_pack.CajMRj/_new 2013-08-07 22:00:02.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2 -Version: 3.0.0 +Version: 3.0.1 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-3.0.0.tar.bz2 -> yast2-3.0.1.tar.bz2 ++++++ ++++ 2863 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-3.0.0/Makefile.am new/yast2-3.0.1/Makefile.am --- old/yast2-3.0.0/Makefile.am 2013-07-31 11:41:17.000000000 +0200 +++ new/yast2-3.0.1/Makefile.am 2013-08-07 17:40:21.000000000 +0200 @@ -193,4 +193,4 @@ test ! -f $(srcdir)/po/Makefile || $(MAKE) -C po checkpo # test ! -f $(srcdir)/po/Makefile || $(MAKE) -C po checkpo make-pox # No ./SUBDIRS file found - assuming default: All direct subdirs with Makefile.am -SUBDIRS = data doc library remote scripts +SUBDIRS = data doc library scripts diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-3.0.0/Makefile.am.common new/yast2-3.0.1/Makefile.am.common --- old/yast2-3.0.0/Makefile.am.common 2013-07-31 11:41:17.000000000 +0200 +++ new/yast2-3.0.1/Makefile.am.common 2013-08-07 17:40:21.000000000 +0200 @@ -30,10 +30,10 @@ dist-hook: check-syntax CHECK_SYNTAX = true -check-syntax: $(client_DATA) $(ycpchook) $(ybcfiles) - @if test "$(filter %.ycp,client_DATA)"; then \ +check-syntax: $(client_DATA) $(module_DATA) $(ynclude_DATA) $(ydata_DATA) $(ycpchook) $(ybcfiles) + @if test "$(filter %.ycp, $(client_DATA) $(ydata_DATA))"; then \ if $(CHECK_SYNTAX); then \ - TO_CHECK="$(filter %.ycp,$^)"; \ + TO_CHECK="$(filter %.ycp, $(client_DATA) $(ydata_DATA))"; \ echo "Checking syntax of $${TO_CHECK}"; \ if ! $(YCPC) -qE -M. -I. $(YCPCFLAGS) $${TO_CHECK}; then \ echo "Failed. Disable by 'make ... CHECK_SYNTAX=false' at your own risk"; \ @@ -42,6 +42,20 @@ else \ echo "Syntax check disabled"; \ fi; \ + fi + @if test "$(filter %.rb, $^)"; then \ + if $(CHECK_SYNTAX); then \ + TO_CHECK="$(filter %.rb, $^)"; \ + echo "Checking syntax of $${TO_CHECK}"; \ + for f in $${TO_CHECK}; do \ + if ! ruby -c $$f > /dev/null; then \ + echo "Failed. Disable by 'make ... CHECK_SYNTAX=false' at your own risk"; \ + exit 1; \ + fi; \ + done; \ + else \ + echo "Syntax check disabled"; \ + fi; \ fi -include .dep diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-3.0.0/VERSION new/yast2-3.0.1/VERSION --- old/yast2-3.0.0/VERSION 2013-07-31 11:41:07.000000000 +0200 +++ new/yast2-3.0.1/VERSION 2013-08-05 12:22:00.000000000 +0200 @@ -1 +1 @@ -3.0.0 +3.0.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-3.0.0/configure.ac new/yast2-3.0.1/configure.ac --- old/yast2-3.0.0/configure.ac 2013-07-31 11:41:17.000000000 +0200 +++ new/yast2-3.0.1/configure.ac 2013-08-07 17:40:21.000000000 +0200 @@ -1,9 +1,9 @@ dnl configure.ac for yast2 dnl -dnl -- This file is generated by y2autoconf 2.24.7 - DO NOT EDIT! -- +dnl -- This file is generated by y2autoconf 3.0.2 - DO NOT EDIT! -- dnl (edit configure.ac.in or configure.in.in instead) -AC_INIT(yast2, 3.0.0, http://bugs.opensuse.org/, yast2) +AC_INIT(yast2, 3.0.1, http://bugs.opensuse.org/, yast2) dnl Check for presence of file 'RPMNAME' AC_CONFIG_SRCDIR([RPMNAME]) @@ -18,7 +18,7 @@ AM_INIT_AUTOMAKE(tar-ustar -Wno-portability) dnl Important YaST2 variables -VERSION="3.0.0" +VERSION="3.0.1" RPMNAME="yast2" MAINTAINER="YaST2 Maintainers <[email protected]>" @@ -211,7 +211,6 @@ library/xml/doc/Makefile library/xml/src/Makefile library/xml/Makefile -library/commandline/agents/Makefile library/commandline/doc/autodocs/Makefile library/commandline/doc/Makefile library/commandline/src/Makefile @@ -243,7 +242,6 @@ library/log/doc/Makefile library/log/src/Makefile library/log/Makefile -library/system/agents/Makefile library/system/doc/autodocs/Makefile library/system/doc/Makefile library/system/src/Makefile @@ -258,7 +256,6 @@ library/cron/doc/autodocs/Makefile library/cron/doc/Makefile library/cron/Makefile -library/network/agents/Makefile library/network/doc/autodocs/Makefile library/network/doc/Makefile library/network/src/Makefile @@ -273,7 +270,6 @@ library/general/testsuite/Makefile library/general/Makefile library/Makefile -remote/Makefile scripts/Makefile) AC_OUTPUT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-3.0.0/library/commandline/Makefile.am new/yast2-3.0.1/library/commandline/Makefile.am --- old/yast2-3.0.0/library/commandline/Makefile.am 2013-01-22 12:22:06.000000000 +0100 +++ new/yast2-3.0.1/library/commandline/Makefile.am 2013-08-01 09:09:58.000000000 +0200 @@ -1,5 +1,5 @@ # -# Makefile.am for yast2/commandline +# Makefile.am for yast2/library/commandline # -SUBDIRS = agents doc src testsuite +SUBDIRS = doc src testsuite diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-3.0.0/library/control/src/Makefile.am new/yast2-3.0.1/library/control/src/Makefile.am --- old/yast2-3.0.0/library/control/src/Makefile.am 2013-07-30 14:09:40.000000000 +0200 +++ new/yast2-3.0.1/library/control/src/Makefile.am 2013-08-05 12:22:00.000000000 +0200 @@ -9,8 +9,9 @@ modules/InstError.rb \ modules/ProductControl.rb \ modules/ProductFeatures.rb \ + modules/ProductProfile.rb \ modules/WorkflowManager.rb EXTRA_DIST = $(module_DATA) -include $(top_srcdir)/Makefile.am.common \ No newline at end of file +include $(top_srcdir)/Makefile.am.common diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-3.0.0/library/control/src/modules/ProductProfile.rb new/yast2-3.0.1/library/control/src/modules/ProductProfile.rb --- old/yast2-3.0.0/library/control/src/modules/ProductProfile.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-3.0.1/library/control/src/modules/ProductProfile.rb 2013-08-05 12:22:00.000000000 +0200 @@ -0,0 +1,242 @@ +# encoding: utf-8 + +# File: modules/ProductProfile.ycp +# Package: yast2 +# Summary: Functions for handling Product Profiles +# Authors: Jiri Suchomel <[email protected]> +# +# $Id$ +require "yast" + +module Yast + class ProductProfileClass < Module + def main + textdomain "base" + + Yast.import "Directory" + Yast.import "Label" + Yast.import "Mode" + Yast.import "Pkg" + Yast.import "Report" + + # path to the profile file on the media + @profile_path = "/product.profile" + + # Result map of isCompliance call. + # If map is not empty, contains reasons why system is not compliant. + @compliance = {} + + # profiles for all installed products + # (full paths to the temporary copies) + @all_profiles = [] + + # mapping of product id's to product names + @productid2name = {} + + # remember products already checked + @compliance_checked = {} + + # directory to store profiles temporary during installation + @profiles_dir = "" + end + + # return the result of last compliance test + def GetComplianceMap + deep_copy(@compliance) + end + + # Return the list of paths to gpg keyfiles present in the root of given product media + # @param the product id + def GetSigKeysForProduct(src_id) + # find the list of sigkeys + dir_file = Pkg.SourceProvideOptionalFile(src_id, 1, "/directory.yast") + out = Convert.to_map( + SCR.Execute( + path(".target.bash_output"), + Builtins.sformat("grep 'gpg-pubkey' %1 2>/dev/null", dir_file) + ) + ) + keys = [] + Builtins.foreach( + Builtins.splitstring(Ops.get_string(out, "stdout", ""), "\n") + ) do |k| + if k != "" + key = Pkg.SourceProvideOptionalFile(src_id, 1, Ops.add("/", k)) + keys = Builtins.add(keys, key) if key != nil + end + end + deep_copy(keys) + end + + + # Checks the profile compliance with the system. + # @param if productId is not nil, check only compliance with given product + # (once new product is added, function should be called to with new product ID) + # @ret true if the system is compliant + def IsCompliant(productId) + profiles = [] + products = [] + sigkeys = [] + + if @profiles_dir == "" + @profiles_dir = Ops.add(Directory.tmpdir, "/profiles/") + SCR.Execute(path(".target.mkdir"), @profiles_dir) + end + + # iterate all (or given) products and get the info about them + Builtins.foreach(Pkg.ResolvableProperties("", :product, "")) do |product| + src_id = Ops.get_integer(product, "source", -1) + name = Ops.get_string(product, "name", "") + if productId == nil && + Ops.get_symbol(product, "status", :none) != :selected + next + end + next if productId != nil && src_id != productId + Ops.set(@compliance_checked, src_id, true) + profile = Pkg.SourceProvideOptionalFile(src_id, 1, @profile_path) + if profile != nil + profiles = Builtins.add(profiles, profile) + # backup profiles so they can be copied them to the installed system + tmp_path = Ops.add(Ops.add(@profiles_dir, name), ".profile") + SCR.Execute( + path(".target.bash"), + Builtins.sformat("/bin/cp -a '%1' '%2'", profile, tmp_path) + ) + @all_profiles = Builtins.add(@all_profiles, tmp_path) + Ops.set(@productid2name, src_id, name) + else + Builtins.y2debug("no profile found for product %1", name) + next + end + # generate product map: + version_release = Builtins.splitstring( + Ops.get_string(product, "version", ""), + "-" + ) + products = Builtins.add( + products, + { + "arch" => Ops.get_string(product, "arch", ""), + "name" => name, + "version" => Ops.get(version_release, 0, ""), + "release" => Ops.get(version_release, 1, ""), + "vendor" => Ops.get_string(product, "vendor", "") + } + ) + sigkeys = Convert.convert( + Builtins.union(sigkeys, GetSigKeysForProduct(src_id)), + :from => "list", + :to => "list <string>" + ) + end + + if profiles == [] + Builtins.y2milestone("no product profile present") + @compliance = {} + return true + end + + @compliance = YaPI::SubscriptionTools.isCompliant(profiles, products, sigkeys) + @compliance == nil + end + + + # Checks the profile compliance with the system. + # If system is not complient, shows a popup with reasons and asks + # to continue with the installation. + # @ret Returns true if system is complient or user agrees to continue + # although the complience test failed. + # @param if productId is not nil, check only compliance with given product + # (once new product is added, function should be called to with new product ID) + def CheckCompliance(productId) + # behavior for non-installation not defined yet + return true if !Mode.installation + + # no need to check same products twice + if productId == nil && @compliance_checked != {} || + productId != nil && Ops.get(@compliance_checked, productId, false) + return true + end + + begin + # YaPI::SubscriptionTools are only available for SLES + Yast.import "YaPI::SubscriptionTools" + rescue NameError => e + y2milestone("subscription-tools package not present: no compliance checking") + return true + end + + return true if IsCompliant(productId) + + reasons = [] + Builtins.foreach(@compliance) do |key, val| + if Ops.is_map?(val) && Builtins.haskey(Convert.to_map(val), "message") + reasons = Builtins.add( + reasons, + Ops.get_string(Convert.to_map(val), "message", "") + ) + end + end + reasons_s = Builtins.mergestring(reasons, "\n") + # last part of the question (variable) + end_question = _("Do you want to continue or abort the installation?") + + # button label + continue_button = _("&Continue Installation") + # button label + cancel_button = _("&Abort Installation") + + # checking specific product + if productId != nil + # last part of the question (variable) + end_question = _("Do you want to add new product anyway?") + continue_button = Label.YesButton + cancel_button = Label.NoButton + end + + ret = Report.AnyQuestion( + # popup dialog caption + _("Warning"), + # popup message, %1 is list of problems + Builtins.sformat( + _( + "The profile does not allow you to run the products on this system.\n" + + "Proceeding to run this installation will leave you in an unsupported state\n" + + "and might impact your compliance requirements.\n" + + " \n" + + "The following requirements are not fulfilled on this system:\n" + + " \n" + + "%1\n" + + "\n" + + "%2" + ), + reasons_s, + end_question + ), + continue_button, + cancel_button, + :no_button + ) + if !ret && productId != nil + # canceled adding add-on: remove profile stored before + name = Ops.get(@productid2name, productId, "") + tmp_path = Ops.add(Ops.add(@profiles_dir, name), ".profile") + Builtins.y2milestone("deleting %1", tmp_path) + SCR.Execute(path(".target.bash"), Ops.add("/bin/rm ", tmp_path)) + @all_profiles = Builtins.filter(@all_profiles) { |p| p != tmp_path } + end + ret + end + + publish :variable => :all_profiles, :type => "list <string>" + publish :variable => :productid2name, :type => "map <integer, string>" + publish :variable => :compliance_checked, :type => "map <integer, boolean>" + publish :function => :GetComplianceMap, :type => "map <string, any> ()" + publish :function => :GetSigKeysForProduct, :type => "list <string> (integer)" + publish :function => :IsCompliant, :type => "boolean (integer)" + publish :function => :CheckCompliance, :type => "boolean (integer)" + end + + ProductProfile = ProductProfileClass.new + ProductProfile.main +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-3.0.0/library/control/testsuite/tests/ProductProfile.out new/yast2-3.0.1/library/control/testsuite/tests/ProductProfile.out --- old/yast2-3.0.0/library/control/testsuite/tests/ProductProfile.out 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-3.0.1/library/control/testsuite/tests/ProductProfile.out 2013-08-05 12:22:00.000000000 +0200 @@ -0,0 +1,4 @@ +Return true +Return $[] +Return true +Return true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-3.0.0/library/control/testsuite/tests/ProductProfile.rb new/yast2-3.0.1/library/control/testsuite/tests/ProductProfile.rb --- old/yast2-3.0.0/library/control/testsuite/tests/ProductProfile.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-3.0.1/library/control/testsuite/tests/ProductProfile.rb 2013-08-05 12:22:00.000000000 +0200 @@ -0,0 +1,50 @@ +# encoding: utf-8 + +# ProductProfile.ycp +# Tests of ProductProfile routines +module Yast + class ProductProfileClient < Client + def main + # testedfiles: ProductProfile.ycp + Yast.import "Testsuite" + Yast.import "ProductProfile" + + @READ = { "target" => { "tmpdir" => "/tmp/YaST" } } + @EX = { "target" => { "bash_output" => {} } } + + # just returns true because of non-installation mode + Testsuite.Test(lambda { ProductProfile.CheckCompliance(nil) }, [ + @READ, + {}, + @EX + ], 0) + + Testsuite.Test(lambda { ProductProfile.compliance_checked }, [], 0) + + Yast.import "Mode" + Mode.SetMode("installation") + + ProductProfile.compliance_checked = { 1 => true } + + # exits on compliance_checked test + Testsuite.Test(lambda { ProductProfile.CheckCompliance(nil) }, [ + @READ, + {}, + @EX + ], 0) + + Testsuite.Test(lambda { ProductProfile.CheckCompliance(1) }, [ + @READ, + {}, + @EX + ], 0) + + # this would continue to IsCompliant and initialize Pkg:: + # Testsuite::Test (``(ProductProfile::CheckCompliance (2)), [ READ, $[], EX ], 0); + + nil + end + end +end + +Yast::ProductProfileClient.new.main diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-3.0.0/library/network/Makefile.am new/yast2-3.0.1/library/network/Makefile.am --- old/yast2-3.0.0/library/network/Makefile.am 2013-01-22 12:22:06.000000000 +0100 +++ new/yast2-3.0.1/library/network/Makefile.am 2013-08-01 09:09:58.000000000 +0200 @@ -1,5 +1,5 @@ # -# Makefile.am for yast2/commandline +# Makefile.am for yast2/library/network # -SUBDIRS = agents doc src testsuite +SUBDIRS = doc src testsuite diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-3.0.0/library/system/Makefile.am new/yast2-3.0.1/library/system/Makefile.am --- old/yast2-3.0.0/library/system/Makefile.am 2013-01-22 12:22:06.000000000 +0100 +++ new/yast2-3.0.1/library/system/Makefile.am 2013-08-01 09:09:58.000000000 +0200 @@ -1,3 +1,3 @@ -# Makefile.am for yast2/library +# Makefile.am for yast2/library/system -SUBDIRS = agents doc src testsuite +SUBDIRS = doc src testsuite diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-3.0.0/library/system/src/clients/view_anymsg.rb new/yast2-3.0.1/library/system/src/clients/view_anymsg.rb --- old/yast2-3.0.0/library/system/src/clients/view_anymsg.rb 2013-07-30 14:09:40.000000000 +0200 +++ new/yast2-3.0.1/library/system/src/clients/view_anymsg.rb 2013-08-07 11:01:18.000000000 +0200 @@ -46,7 +46,7 @@ class ViewAnymsgClient < Client def main Yast.import "UI" - textdomain "repair" + textdomain "base" Yast.import "CommandLine" Yast.import "Directory" -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
