Hello community,
here is the log from the commit of package yast2-add-on-creator
checked in at Thu Apr 12 17:04:02 CEST 2007.
--------
--- yast2-add-on-creator/yast2-add-on-creator.changes 2007-04-05 10:42:16.000000000 +0200
+++ /mounts/work_src_done/NOARCH/yast2-add-on-creator/yast2-add-on-creator.changes 2007-04-11 13:57:40.589621000 +0200
@@ -1,0 +2,7 @@
+Wed Apr 11 13:37:11 CEST 2007 - jsuchome@suse.cz
+
+- really report error if gpg fails (#260588)
+- added 'sign' command for CLI (F302049)
+- 2.15.4
+
+-------------------------------------------------------------------
Old:
----
yast2-add-on-creator-2.15.3.tar.bz2
New:
----
yast2-add-on-creator-2.15.4.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-add-on-creator.spec ++++++
--- /var/tmp/diff_new_pack.d20210/_old 2007-04-12 17:03:06.000000000 +0200
+++ /var/tmp/diff_new_pack.d20210/_new 2007-04-12 17:03:06.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-add-on-creator (Version 2.15.3)
+# spec file for package yast2-add-on-creator (Version 2.15.4)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,12 +11,12 @@
# norootforbuild
Name: yast2-add-on-creator
-Version: 2.15.3
+Version: 2.15.4
Release: 1
License: GNU General Public License (GPL)
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-add-on-creator-2.15.3.tar.bz2
+Source0: yast2-add-on-creator-2.15.4.tar.bz2
prefix: /usr
Requires: yast2
BuildRequires: perl-XML-Writer update-desktop-files yast2 yast2-devtools yast2-testsuite
@@ -33,7 +33,7 @@
Jiř� Suchomel
%prep
-%setup -n yast2-add-on-creator-2.15.3
+%setup -n yast2-add-on-creator-2.15.4
%build
%{prefix}/bin/y2tool y2autoconf
@@ -69,6 +69,10 @@
%doc %{prefix}/share/doc/packages/yast2-add-on-creator
%changelog
+* Wed Apr 11 2007 - jsuchome@suse.cz
+- really report error if gpg fails (#260588)
+- added 'sign' command for CLI (F302049)
+- 2.15.4
* Thu Apr 05 2007 - jsuchome@suse.cz
- added basic Export functionality to support calls from other
modules (F301945)
++++++ yast2-add-on-creator-2.15.3.tar.bz2 -> yast2-add-on-creator-2.15.4.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-add-on-creator-2.15.3/src/add-on-creator_auto.ycp new/yast2-add-on-creator-2.15.4/src/add-on-creator_auto.ycp
--- old/yast2-add-on-creator-2.15.3/src/add-on-creator_auto.ycp 2007-04-05 10:28:36.000000000 +0200
+++ new/yast2-add-on-creator-2.15.4/src/add-on-creator_auto.ycp 2007-04-05 10:42:39.000000000 +0200
@@ -24,7 +24,7 @@
* Summary: Client for autoinstallation
* Authors: Jiri Suchomel
*
- * $Id: add-on-creator_auto.ycp 37317 2007-04-05 07:28:16Z jsuchome $
+ * $Id: add-on-creator_auto.ycp 37326 2007-04-05 08:42:36Z jsuchome $
*
* This is a client for autoinstallation. It takes its arguments,
* goes through the configuration and return the setting.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-add-on-creator-2.15.3/src/add-on-creator.ycp new/yast2-add-on-creator-2.15.4/src/add-on-creator.ycp
--- old/yast2-add-on-creator-2.15.3/src/add-on-creator.ycp 2007-04-05 10:26:57.000000000 +0200
+++ new/yast2-add-on-creator-2.15.4/src/add-on-creator.ycp 2007-04-11 13:40:21.000000000 +0200
@@ -24,7 +24,7 @@
* Summary: Main file
* Authors: Jiri Suchomel
*
- * $Id: add-on-creator.ycp 35715 2007-01-31 08:02:45Z jsuchome $
+ * $Id: add-on-creator.ycp 37326 2007-04-05 08:42:36Z jsuchome $
*
* Main file for add-on-creator configuration. Uses all other files.
*/
@@ -59,13 +59,53 @@
Report::Error (sformat (_("Directory %1 does not exists"), dir));
}
+// helper for parsing command line data regarding iso creation
+void ParseISOData (map options) {
+
+ AddOnCreator::iso = haskey (options, "create_iso");
+ if (haskey (options, "iso_name"))
+ {
+ AddOnCreator::iso = true;
+ AddOnCreator::iso_name = options["iso_name"]:"";
+ }
+ if (haskey (options, "iso_output_dir"))
+ {
+ AddOnCreator::iso = true;
+ AddOnCreator::iso_path = options["iso_output_dir"]:"";
+ }
+}
+
+// helper for parsing command line data regarding product signing
+void ParseGPGData (map options) {
+
+ if (haskey (options, "gpg_key"))
+ AddOnCreator::gpg_key = options["gpg_key"]:AddOnCreator::gpg_key;
+ if (haskey (options, "passphrase"))
+ AddOnCreator::passphrase = options["passphrase"]:"";
+ else if (haskey (options, "passphrase_file"))
+ {
+ string file = options["passphrase_file"]:"";
+ if (FileUtils::Exists (file))
+ {
+ string passphrase = (string) SCR::Read (.target.string, file);
+ if (passphrase != nil) AddOnCreator::passphrase = passphrase;
+ }
+ else
+ {
+ ReportMissingFile (file);
+ }
+ }
+ else
+ AddOnCreator::passphrase =
+ // question on command line
+ CommandLine::PasswordInput(sformat (_("Passphrase for key %1:"),AddOnCreator::gpg_key));
+}
+
/**
* General function for creating new add-on
*/
boolean Create (map options ) {
-y2internal ("options: %1", options);
-
if (!haskey (options, "output_dir"))
{
// error message
@@ -146,12 +186,7 @@
ReportMissingDir (dir);
}
}
- AddOnCreator::iso = haskey (options, "create_iso");
- if (haskey (options, "iso_name"))
- {
- AddOnCreator::iso = true;
- AddOnCreator::iso_name = options["iso_name"]:"";
- }
+ ParseISOData (options);
if (haskey (options, "license"))
{
@@ -224,27 +259,10 @@
}
}
- if (haskey (options, "gpg_key"))
- AddOnCreator::gpg_key = options["gpg_key"]:AddOnCreator::gpg_key;
- if (haskey (options, "passphrase"))
- AddOnCreator::passphrase = options["passphrase"]:"";
- else if (haskey (options, "passphrase_file"))
+ if (!haskey (options, "do_not_sign"))
{
- string file = options["passphrase_file"]:"";
- if (FileUtils::Exists (file))
- {
- string passphrase = (string) SCR::Read (.target.string, file);
- if (passphrase != nil) AddOnCreator::passphrase = passphrase;
- }
- else
- {
- ReportMissingFile (file);
- }
+ ParseGPGData (options);
}
- else
- AddOnCreator::passphrase =
- // question on command line
- CommandLine::PasswordInput(sformat (_("Passphrase for key %1:"),AddOnCreator::gpg_key));
return true;
}
@@ -290,6 +308,31 @@
return Create (options);
}
+/**
+ * Command line handler for signing existing Add-On
+ */
+boolean SignAddOn (map options) {
+
+ AddOnCreator::only_sign_product = false;
+ if (!haskey (options, "addon_dir"))
+ {
+ // error message
+ Report::Error (_("Path to directory with Add-On is missing."));
+ return false;
+ }
+ else
+ AddOnCreator::base_output_path = options["addon_dir"]:"";
+
+ // we need to import same data from existing add-on (e.g. for iso name)
+ AddOnCreator::ImportExistingProduct (AddOnCreator::base_output_path);
+ AddOnCreator::FillContentDefaults ();
+
+ ParseGPGData (options);
+ ParseISOData (options);
+ AddOnCreator::only_sign_product = true;
+ return true;
+}
+
map cmdline_description = $[
"id" : "add-on-creator",
// Command line help text for the add-on-creator module
@@ -308,6 +351,11 @@
// command line help text for 'create' action
"help" : _("Create an Add-On Product based on an existing one"),
],
+ "sign" : $[
+ "handler" : SignAddOn,
+ // command line help text for 'create' action
+ "help" : _("Sign unsigned Add-On Product"),
+ ],
],
"options" : $[
"rpm_dir" : $[
@@ -353,6 +401,15 @@
"help" : _("Name of the output ISO image"),
"type" : "string",
],
+ "iso_output_dir" : $[
+ // command line help text for 'output_dir' option
+ "help" : _("Path to the output directory for ISO image"),
+ "type" : "string"
+ ],
+ "do_not_sign" : $[
+ // command line help text for 'do_not_sign' option
+ "help" : _("Do not sign the product"),
+ ],
"gpg_key" : $[
// command line help text for 'gpg_key' option
"help" : _("GPG key ID used to sign a product"),
@@ -387,18 +444,26 @@
// command line help text for 'license' option
"help" : _("Path to file with license texts (license.zip)"),
"type" : "string",
- ]
+ ],
+ "addon_dir" : $[
+ // command line help text for 'addon-dir' option
+ "help" : _("Path to directory with Add-On Product"),
+ "type" : "string"
+ ],
],
"mappings" : $[
"create" : [ "content", "rpm_dir", "package_descriptions_dir",
"patterns_dir", "output_dir", "create_iso", "iso_name", "gpg_key", "passphrase",
- "passphrase_file", "workflow", "y2update", "y2update_packages_dir", "license"
+ "passphrase_file", "workflow", "y2update", "y2update_packages_dir", "license",
+ "do_not_sign", "iso_output_dir"
],
"clone" : [ "existing", "generate_descriptions", "content",
"package_descriptions_dir", "patterns_dir", "output_dir", "create_iso", "iso_name",
"gpg_key", "passphrase", "passphrase_file", "workflow", "y2update",
- "y2update_packages_dir", "license"
- ]
+ "y2update_packages_dir", "license", "do_not_sign", "iso_output_dir"
+ ],
+ "sign" : [ "addon_dir", "gpg_key", "passphrase", "passphrase_file", "create_iso",
+ "iso_name", "iso_output_dir" ]
]
];
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-add-on-creator-2.15.3/src/AddOnCreator.ycp new/yast2-add-on-creator-2.15.4/src/AddOnCreator.ycp
--- old/yast2-add-on-creator-2.15.3/src/AddOnCreator.ycp 2007-04-04 16:17:34.000000000 +0200
+++ new/yast2-add-on-creator-2.15.4/src/AddOnCreator.ycp 2007-04-11 13:34:58.000000000 +0200
@@ -24,7 +24,7 @@
* Summary: AddOnCreator settings, input and output functions
* Authors: Jiri Suchomel
*
- * $Id: AddOnCreator.ycp 36738 2007-03-06 12:44:51Z jsuchome $
+ * $Id: AddOnCreator.ycp 37326 2007-04-05 08:42:36Z jsuchome $
*
* Representation of the configuration of add-on-creator.
* Input and output routines.
@@ -37,6 +37,7 @@
import "Directory";
import "FileUtils";
+import "Mode";
import "Package";
import "Popup";
import "Progress";
@@ -557,7 +558,8 @@
// tmp directory
string tmpdir = "";
-list full_media_paths = [];
+// full paths to media directories (media.n)
+list<string> full_media_paths = [];
// architecture specific directory names of target product
list<string> arch_directories = [];
@@ -590,6 +592,9 @@
// mapping of package name to full file name
global map package2filename = $[];
+// if we want only to sign existing product (and possibly create iso of it)
+global boolean only_sign_product = false;
+
/**
* Data was modified?
*/
@@ -1136,25 +1141,36 @@
return ret;
}
-
/**
- * Create the directory structure of the Add-On
- * @return success
+ * generate the paths of media, data and description dirs
*/
-global boolean CreateAddOnStructure (string base_path) {
+global void GenerateDirectories (string base_path) {
- if (!FileUtils::Exists (base_path)) return false;
-
- // create the media's directories
integer i = 1;
integer no_of_medias = 1; // FIXME layout is different for more media
while (i <= no_of_medias)
{
string media_path = sformat ("%1/media.%2", base_path, i);
full_media_paths = add (full_media_paths, media_path);
- SCR::Execute (.target.mkdir, media_path);
i = i + 1;
}
+ full_data_path =sformat("%1/%2", base_path,content_map["DATADIR"]:"");
+ full_descr_path = sformat ("%1/%2", base_path, content_map["DESCRDIR"]:"");
+}
+
+/**
+ * Create the directory structure of the Add-On
+ * @return success
+ */
+global boolean CreateAddOnStructure (string base_path) {
+
+ if (!FileUtils::Exists (base_path)) return false;
+
+ GenerateDirectories (base_path);
+ // create the media's directories
+ foreach (string dir, full_media_paths, {
+ SCR::Execute (.target.mkdir, dir);
+ });
// create the data dir
if (content_map["DATADIR"]:"" == "")
@@ -1163,7 +1179,6 @@
return false;
}
- full_data_path =sformat("%1/%2", base_path,content_map["DATADIR"]:"");
SCR::Execute (.target.mkdir, full_data_path);
// create the dirs for packages
@@ -1174,7 +1189,6 @@
});
}
- full_descr_path = sformat ("%1/%2", base_path, content_map["DESCRDIR"]:"");
SCR::Execute (.target.mkdir, full_descr_path);
return true;
@@ -1615,13 +1629,32 @@
out = (map)SCR::Execute (.target.bash_output, sformat ("gpg --list-secret-keys --with-colons %1| grep %2 | gawk -F: '{print $5}'| sed 's/........$//g'", key, local_key));
string big_key = deletechars (out["stdout"]:"0","\n");
- // first, export the key:
+ // save the passphrase
+ string pw_path = tmpdir + "/pw";
+ SCR::Write (.target.string, pw_path, passphrase);
+
+ // sign the content file
+ SCR::Execute (.target.bash, sformat ("rm -f %1/content.asc", base_path));
+ out = (map) SCR::Execute (.target.bash_output, sformat("
+ gpg --passphrase-fd 0 --detach-sign -u %1 -a %2/content < %3",
+ local_key, base_path, pw_path)
+ );
+ if (out["exit"]:0 != 0)
+ {
+ if (Mode::commandline ())
+ Report::Error (out["stderr"]:"");
+ else
+ // error message
+ Popup::ErrorDetails (_("Signing of the product failed."), out["stderr"]:"");
+ return false;
+ }
+
+ // export the key:
command = sformat ("gpg --export -a %1 > %2/gpg-pubkey-%3-%1.asc",
local_key, base_path, big_key);
SCR::Execute (.target.bash, command, $["LANG" : "C"]);
// than, make a sha1 sum of that key (content file is modified last time)
- // TODO move this out?
out = (map) SCR::Execute (.target.bash_output,
sformat ("cd %1; ls -A1 gpg-pubkey*", base_path));
@@ -1635,20 +1668,6 @@
SCR::Execute (.target.bash, command, $["LANG" : "C"]);
});
- // save the passphrase
- string pw_path = tmpdir + "/pw";
- SCR::Write (.target.string, pw_path, passphrase);
-
- // sign the content file
- SCR::Execute (.target.bash, sformat ("rm -f %1/content.asc", base_path));
- if (passphrase != "")
- SCR::Execute (.target.bash, sformat("
- gpg --passphrase-fd 0 --detach-sign -u %1 -a %2/content < %3",
- local_key, base_path, pw_path));
- else
- SCR::Execute (.target.bash, sformat("
- gpg --detach-sign -u %1 -a %2/content", local_key, base_path));
-
SCR::Execute (.target.bash,
sformat("gpg --export -a -u %1 > %2/content.key",local_key, base_path));
@@ -1696,7 +1715,6 @@
name = sformat ("%1-%2-%3",
tolower (content_map["DISTPRODUCT"]:content_map["PRODUCT"]:"addon"),
content_map["DISTVERSION"]:"", content_map["DEFAULTBASE"]:"");
-
if (!issubstring (name, ".iso"))
name = name + ".iso";
iso_name = name;
@@ -1762,60 +1780,79 @@
if (iso)
{
- iso_path = base_output_path;
- base_output_path= tmpdir + "/output";
- SCR::Execute (.target.mkdir, base_output_path);
+ if (iso_path == "")
+ {
+ iso_path = base_output_path;
+ if (!only_sign_product)
+ {
+ base_output_path= tmpdir + "/output";
+ SCR::Execute (.target.mkdir, base_output_path);
+ }
+ }
+ else if (!FileUtils::Exists (iso_path))
+ SCR::Execute (.target.mkdir, iso_path);
}
- if (!WriteContentFile (base_output_path, content))
+ if (only_sign_product)
{
- // Error message (do not translate 'content'
- Report::Error (_("Cannot write content file."));
+ GenerateDirectories (base_output_path);
+ Progress::NextStage();
+ Progress::NextStage();
+ Progress::NextStage();
+ Progress::NextStage();
}
+ else
+ {
+ if (!WriteContentFile (base_output_path, content))
+ {
+ // Error message (do not translate 'content'
+ Report::Error (_("Cannot write content file."));
+ }
- WriteStringFiles (base_output_path, readme_files);
- WriteStringFiles (base_output_path, copying_files);
- WriteStringFiles (base_output_path, copyright_files);
+ WriteStringFiles (base_output_path, readme_files);
+ WriteStringFiles (base_output_path, copying_files);
+ WriteStringFiles (base_output_path, copyright_files);
- Progress::NextStage();
+ Progress::NextStage();
- if (!CreateAddOnStructure (base_output_path))
- {
- // Error message
- Report::Error (_("Cannot create the output directory structure."));
- }
+ if (!CreateAddOnStructure (base_output_path))
+ {
+ // Error message
+ Report::Error (_("Cannot create the output directory structure."));
+ }
- WritePatchesFiles (base_output_path, patches_files);
+ WritePatchesFiles (base_output_path, patches_files);
- WriteProductsFiles (base_output_path, products_files);
+ WriteProductsFiles (base_output_path, products_files);
- WriteMediaFiles (base_output_path, media_files, nextmedia);
+ WriteMediaFiles (base_output_path, media_files, nextmedia);
- WriteLicensesFiles (full_media_paths[0]:"", license_files);
+ WriteLicensesFiles (full_media_paths[0]:"", license_files);
- if (info != "")
- SCR::Write (.target.string, full_media_paths[0]:"" + "/info.txt", info);
+ if (info != "")
+ SCR::Write (.target.string, full_media_paths[0]:"" + "/info.txt", info);
- Progress::NextStage();
+ Progress::NextStage();
- WritePatterns (base_output_path);
+ WritePatterns (base_output_path);
- Progress::NextStage();
+ Progress::NextStage();
- CopyRPMs (rpm_path, base_output_path);
+ CopyRPMs (rpm_path, base_output_path);
- WritePackageDescriptions (full_descr_path, packages_descr);
+ WritePackageDescriptions (full_descr_path, packages_descr);
- WriteWorkflow (
- base_output_path, workflow_path, y2update_packages, y2update_path);
+ WriteWorkflow (base_output_path, workflow_path, y2update_packages, y2update_path);
- Progress::NextStage();
+ Progress::NextStage();
- GenerateArchiveFiles (base_output_path);
+ GenerateArchiveFiles (base_output_path);
- CreateMD5SUMS (base_output_path);
+ CreateMD5SUMS (base_output_path);
+ }
- SignAddOn (base_output_path, gpg_key);
+ if (!SignAddOn (base_output_path, gpg_key))
+ return false;
WriteServicepackArchive (base_output_path);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-add-on-creator-2.15.3/VERSION new/yast2-add-on-creator-2.15.4/VERSION
--- old/yast2-add-on-creator-2.15.3/VERSION 2007-04-03 16:31:06.000000000 +0200
+++ new/yast2-add-on-creator-2.15.4/VERSION 2007-04-11 13:37:41.000000000 +0200
@@ -1 +1 @@
-2.15.3
+2.15.4
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org