[yast-commit] r40906 - in /trunk/packager: VERSION package/yast2-packager.changes src/modules/ProductLicense.ycp yast2-packager.spec.in
Author: locilka
Date: Fri Sep 14 10:23:45 2007
New Revision: 40906
URL: http://svn.opensuse.org/viewcvs/yast?rev=40906&view=rev
Log:
- 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
Modified:
trunk/packager/VERSION
trunk/packager/package/yast2-packager.changes
trunk/packager/src/modules/ProductLicense.ycp
trunk/packager/yast2-packager.spec.in
Modified: trunk/packager/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/VERSION?rev=40906&r1=40905&r2=40906&view=diff
==============================================================================
--- trunk/packager/VERSION (original)
+++ trunk/packager/VERSION Fri Sep 14 10:23:45 2007
@@ -1 +1 @@
-2.15.78
+2.15.79
Modified: trunk/packager/package/yast2-packager.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.changes?rev=40906&r1=40905&r2=40906&view=diff
==============================================================================
--- trunk/packager/package/yast2-packager.changes (original)
+++ trunk/packager/package/yast2-packager.changes Fri Sep 14 10:23:45 2007
@@ -1,4 +1,13 @@
-------------------------------------------------------------------
+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
+
+-------------------------------------------------------------------
Wed Sep 12 16:16:08 CEST 2007 - locilka@suse.cz
- Fixed evaluation of $short_language localization key in online
Modified: trunk/packager/src/modules/ProductLicense.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/ProductLicense.ycp?rev=40906&r1=40905&r2=40906&view=diff
==============================================================================
--- trunk/packager/src/modules/ProductLicense.ycp (original)
+++ trunk/packager/src/modules/ProductLicense.ycp Fri Sep 14 10:23:45 2007
@@ -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
participants (1)
-
locilka@svn.opensuse.org