Hello community,
here is the log from the commit of package yast2-packager
checked in at Fri Sep 14 16:30:47 CEST 2007.
--------
--- yast2-packager/yast2-packager.changes 2007-09-12 16:21:23.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-packager/yast2-packager.changes 2007-09-14 09:19:30.000000000 +0200
@@ -1,0 +2,9 @@
+Fri Sep 14 09:12:23 CEST 2007 - locilka@suse.cz
+
+- Fixed behavior when the same licence had to be accepted several
+ times - for every single repository added. Now, the same licence
+ has to be accepted only once (during one YaST run) (#305503).
+- Adjusted RPM dependency (md5sum binary) (#305503).
+- 2.15.79
+
+-------------------------------------------------------------------
Old:
----
yast2-packager-2.15.78.tar.bz2
New:
----
yast2-packager-2.15.79.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-packager.spec ++++++
--- /var/tmp/diff_new_pack.Wc5209/_old 2007-09-14 16:29:32.000000000 +0200
+++ /var/tmp/diff_new_pack.Wc5209/_new 2007-09-14 16:29:32.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-packager (Version 2.15.78)
+# spec file for package yast2-packager (Version 2.15.79)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,13 +11,13 @@
# norootforbuild
Name: yast2-packager
-Version: 2.15.78
+Version: 2.15.79
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-packager-2.15.78.tar.bz2
-prefix: /usr
+Source0: yast2-packager-2.15.79.tar.bz2
+Prefix: /usr
BuildRequires: docbook-xsl-stylesheets doxygen gcc-c++ libxcrypt-devel libxslt perl-XML-Writer sgml-skel update-desktop-files yast2-country yast2-devtools yast2-slp yast2-testsuite yast2-xml
BuildRequires: yast2 >= 2.15.38
# Module: OneClickInstallStandard
@@ -34,6 +34,8 @@
Requires: yast2-transfer
# XML module (inst_productsources.ycp)
Requires: yast2-xml
+# Bugzilla #305503 - storing/checking MD5 of licenses
+Requires: /usr/bin/md5sum
# setenv() builtin
Conflicts: yast2-core < 2.15.10
# NotEnoughMemory-related functions moved to misc.ycp import-file
@@ -59,7 +61,7 @@
Arvin Schnell
%prep
-%setup -n yast2-packager-2.15.78
+%setup -n yast2-packager-2.15.79
%build
%{prefix}/bin/y2tool y2autoconf
@@ -100,6 +102,12 @@
%doc %{prefix}/share/doc/packages/yast2-packager
%changelog
+* Fri Sep 14 2007 - locilka@suse.cz
+- Fixed behavior when the same licence had to be accepted several
+ times - for every single repository added. Now, the same licence
+ has to be accepted only once (during one YaST run) (#305503).
+- Adjusted RPM dependency (md5sum binary) (#305503).
+- 2.15.79
* Wed Sep 12 2007 - locilka@suse.cz
- Fixed evaluation of $short_language localization key in online
repositories.
++++++ yast2-packager-2.15.78.tar.bz2 -> yast2-packager-2.15.79.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.15.78/src/modules/ProductLicense.ycp new/yast2-packager-2.15.79/src/modules/ProductLicense.ycp
--- old/yast2-packager-2.15.78/src/modules/ProductLicense.ycp 2007-09-03 09:44:15.000000000 +0200
+++ new/yast2-packager-2.15.79/src/modules/ProductLicense.ycp 2007-09-14 10:42:24.000000000 +0200
@@ -30,9 +30,88 @@
textdomain "packager";
+// list of already accepted licenses
+list <string> already_accepted_licenses = [];
+
+/**
+ * Creates a unique identification from filename
+ * (MD5sum + file size)
+ *
+ * @param string filename
+ * @return string unique ID
+ */
+string GetLicenseIdentString (string filename) {
+ if (! FileUtils::Exists (filename)) {
+ y2error ("License '%1' doesn't exist", filename);
+ return nil;
+ }
+
+ string ret = "";
+
+ string cmd = sformat ("md5sum '%1'", String::Quote (filename));
+ map cmd_out = (map) SCR::Execute (.target.bash_output, cmd);
+
+ if (cmd_out["exit"]:-1 != 0) {
+ y2error ("Command >%1< returned %2", cmd, cmd_out);
+ return nil;
+ }
+
+ string filemd5 = cmd_out["stdout"]:"";
+ if (regexpmatch (filemd5, "[^ \t]+[ \t]+.*$")) {
+ // Format: '19ea7ea41de37314f71c6849ddd259d5 /the/file'
+ filemd5 = regexpsub (filemd5, "^([^ \t]+)[ \t]+.*$", "\\1");
+ } else {
+ y2warning ("Strange md5out: '%1'", filemd5);
+ }
+
+ ret = sformat("%1-%2", filemd5, FileUtils::GetSize (filename));
+
+ y2milestone ("License ident for '%1' is '%2'", filename, ret);
+
+ return ret;
+}
+
+/**
+ * Checks whether the license (file) has been already accepted
+ *
+ * @param string filename
+ * @return boolean whether the license has been accepted before
+ */
+boolean IsLicenseAlreadyAccepted (string license_ident) {
+ if (license_ident == nil || license_ident == "") {
+ y2error ("Wrong license ID '%1'", license_ident);
+ return false;
+ }
+
+ return contains (already_accepted_licenses, license_ident);
+}
+
+/**
+ * Sets that the license (file) has been already accepted
+ *
+ * @param string filename
+ */
+void LicenseHasBeenAccepted (string license_ident) {
+ if (license_ident == nil || license_ident == "") {
+ y2error ("Wrong license ID '%1'", license_ident);
+ return;
+ }
+
+ y2milestone ("Adding License ID '%1' as already accepted", license_ident);
+ already_accepted_licenses = add (already_accepted_licenses, license_ident);
+}
+
+string WhichLicenceFile (string license_language, map & licenses) {
+ string license_file = licenses[license_language]:"";
+
+ y2milestone ("Using license file: %1", license_file);
+
+ return license_file;
+}
+
term GetLicenseContent (string lic_lang, map & licenses) {
- string license_file = licenses[lic_lang]:"";
- y2milestone ("Using license file: %1", license_file);
+ string license_file = WhichLicenceFile (lic_lang, licenses);
+
string license_text = (string) SCR::Read(.target.string, license_file);
if (license_text == nil)
{
@@ -534,6 +613,35 @@
return `auto;
}
+ // Check whether such license hasn't been already accepted
+ // Bugzilla #305503
+ string license_ident_lang = nil;
+
+ // We need to store the oroginal -- not localized license ID (if possible)
+ foreach (string check_this, ["", "en", lic_lang], {
+ if (contains (available_langs, check_this)) {
+ license_ident_lang = check_this;
+ y2milestone ("Using localization '%1' (for license ID)", license_ident_lang);
+ break;
+ }
+ });
+
+ // fallback
+ if (license_ident_lang == nil) license_ident_lang = lic_lang;
+
+ string base_license = WhichLicenceFile (license_ident_lang, licenses);
+ string license_ident = GetLicenseIdentString (base_license);
+
+ // defined, properly ($md5sum(32)-(1)$size(1..n))
+ if (license_ident != nil && size (license_ident) > 33 && IsLicenseAlreadyAccepted (license_ident)) {
+ y2milestone ("License has been already accepted");
+
+ CleanUpLicense (tmpdir);
+ return `accepted;
+ } else {
+ y2milestone ("License needs to be accepted");
+ }
+
// bugzilla #303922
// src_id == nil (the initial product license)
if (src_id != nil) {
@@ -687,7 +795,12 @@
}
}
- CleanUpLicense(tmpdir);
+ if (ret == `accepted && license_ident != nil) {
+ // store already accepted license ID
+ LicenseHasBeenAccepted (license_ident);
+ }
+
+ CleanUpLicense (tmpdir);
// bugzilla #303922
if (src_id != nil) {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-packager-2.15.78/VERSION new/yast2-packager-2.15.79/VERSION
--- old/yast2-packager-2.15.78/VERSION 2007-09-12 16:15:58.000000000 +0200
+++ new/yast2-packager-2.15.79/VERSION 2007-09-14 09:23:36.000000000 +0200
@@ -1 +1 @@
-2.15.78
+2.15.79
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org