Author: jsuchome
Date: Tue Aug 5 13:38:51 2008
New Revision: 49701
URL: http://svn.opensuse.org/viewcvs/yast?rev=49701&view=rev
Log:
- recreate package metadata after signing RPMs (bnc#412591)
- more logging during write phase
- 2.16.14
Modified:
branches/SuSE-Linux-11_0-Branch/add-on-creator/VERSION
branches/SuSE-Linux-11_0-Branch/add-on-creator/package/yast2-add-on-creator.changes
branches/SuSE-Linux-11_0-Branch/add-on-creator/src/AddOnCreator.ycp
Modified: branches/SuSE-Linux-11_0-Branch/add-on-creator/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/add-on-creator/VERSION?rev=49701&r1=49700&r2=49701&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/add-on-creator/VERSION (original)
+++ branches/SuSE-Linux-11_0-Branch/add-on-creator/VERSION Tue Aug 5 13:38:51 2008
@@ -1 +1 @@
-2.16.13
+2.16.14
Modified: branches/SuSE-Linux-11_0-Branch/add-on-creator/package/yast2-add-on-creator.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/add-on-creator/package/yast2-add-on-creator.changes?rev=49701&r1=49700&r2=49701&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/add-on-creator/package/yast2-add-on-creator.changes (original)
+++ branches/SuSE-Linux-11_0-Branch/add-on-creator/package/yast2-add-on-creator.changes Tue Aug 5 13:38:51 2008
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Tue Aug 5 12:49:14 CEST 2008 - jsuchome@suse.cz
+
+- recreate package metadata after signing RPMs (bnc#412591)
+- more logging during write phase
+- 2.16.14
+
+-------------------------------------------------------------------
Mon Jul 14 09:50:58 CEST 2008 - jsuchome@suse.cz
- read all content file values from saved configuration (bnc#406153)
Modified: branches/SuSE-Linux-11_0-Branch/add-on-creator/src/AddOnCreator.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/add-on-creator/src/AddOnCreator.ycp?rev=49701&r1=49700&r2=49701&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/add-on-creator/src/AddOnCreator.ycp (original)
+++ branches/SuSE-Linux-11_0-Branch/add-on-creator/src/AddOnCreator.ycp Tue Aug 5 13:38:51 2008
@@ -43,7 +43,6 @@
import "Package";
import "PackageSystem";
import "PackagesDescr";
-import "Popup";
import "Progress";
import "Report";
import "String";
@@ -1623,11 +1622,14 @@
if (!FileUtils::Exists (descr_path)) return false;
+ y2milestone ("writing package description files...");
+
boolean ret = true;
if (descr == $[]) return ret;
foreach (string lang, map data, (map)descr, {
string file_path = descr_path + "/packages." + lang;
ret = ret && PackagesDescr::Write (file_path,(map)data);
+ y2debug ("file '%1' written, retval: %2", file_path, ret);
if (compress_package_descriptions && gzip_installed ())
{
y2debug ("compressing %1 file: %2", file_path, SCR::Execute (
@@ -1641,6 +1643,7 @@
descr_path));
foreach (string file, [ "packages", "packages.DU", "packages.FL"], {
string pth = tmpdir + "/" + file;
+ y2debug ("processing '%1'", pth);
boolean compress = false;
if (!FileUtils::Exists (pth) && FileUtils::Exists (pth + ".gz"))
pth = pth + ".gz";
@@ -1656,14 +1659,11 @@
});
}
- /* no need to read now, already done in UI or CLI
- if (extra_prov_file != "" && FileUtils::Exists (extra_prov_file))
- extra_prov = (string) SCR::Read (.target.string, extra_prov_file);
- */
string extra_prov = current_product["extra_prov"]:"";
if (extra_prov != "" && extra_prov != nil)
SCR::Write (.target.string, descr_path + "/EXTRA_PROV",extra_prov);
+ y2milestone ("... done");
return ret;
}
@@ -1793,7 +1793,7 @@
y2warning ("no %1 directory exists...", base_path);
return false;
}
-
+ y2milestone ("writing licenses...");
boolean ret = true;
string cmd = "";
foreach (string file, string cont, files, {
@@ -1884,7 +1884,9 @@
file = file + sformat ("+%1:\n%2\n-%1:\n", key, val);
}
});
- SCR::Write (.target.string, descr_path + "/" + filename, file);
+ y2milestone ("writing pattern %1/%2: %3", descr_path, filename,
+ SCR::Write (.target.string, descr_path + "/" + filename, file)
+ );
if (compress_patterns && gzip_installed ())
{
y2debug ("compressing pattern file: %1", SCR::Execute (
@@ -1931,12 +1933,14 @@
if (arch != "ZZZ_imported" && arch != "ZZZ_required" &&
FileUtils::Exists (out_dir))
{
+ y2milestone ("copying packages of '%1' arhitecture", arch);
// arch_directories will be needed later for CreateMD5SUMS and
// resign_packages
arch_directories = (list<string>)
union (arch_directories, [arch]);
if (size (package2filename) > 0 && arch != "src")
{
+ y2debug ("package names known");
foreach (string p, (list<string>) pa, {
SCR::Execute (.target.bash, sformat (
"/bin/cp %1 '%2/'", package2filename[arch,p]:"", out_dir));
@@ -1944,6 +1948,7 @@
}
else if (size (srcpackage2filename) > 0 && arch == "src")
{
+ y2debug ("source packages, names known");
foreach (string p, (list<string>) pa, {
SCR::Execute (.target.bash, sformat (
"/bin/cp %1 '%2/'", srcpackage2filename[arch,p]:"", out_dir));
@@ -1951,6 +1956,7 @@
}
else
{
+ y2debug ("package names not known, using wildcard");
foreach (string p, (list<string>) pa, {
SCR::Execute (.target.bash, sformat (
"/bin/cp %1/%2*.rpm '%3/'", in_path, p, out_dir));
@@ -2022,7 +2028,7 @@
boolean GenerateChangelog (string base_path)
{
if (!Package::Installed ("inst-source-utils") &&
- !FileUtils::Exists ("/usr/bin//usr/bin/mk_changelog"))
+ !FileUtils::Exists ("/usr/bin/mk_changelog"))
{
y2error("inst-source-utils not installed and mk_changelog not present");
return false;
@@ -2117,6 +2123,7 @@
foreach (string full_path, dirs_for_md5, {
if (dir_has_files (full_path))
{
+ y2milestone ("creating MDBSUM in %1", full_path);
// whole dir was copied -> also with original MD5SUMS
if (FileUtils::Exists (full_path + "/MD5SUMS"))
{
@@ -2134,6 +2141,7 @@
map out = (map) SCR::Execute (.target.bash_output, sformat ("ls -A1 '%1'", full_descr_path));
foreach (string file, splitstring (out["stdout"]:"", "\n"), {
if (file == "") return;
+ y2milestone ("creating sha1sum of %1", file);
out = (map) SCR::Execute (.target.bash_output,
sformat ("cd '%1' && sha1sum -- %2", full_descr_path, String::Quote (file)),
$["LANG" : "C"]);
@@ -2143,10 +2151,12 @@
});
// sha1sums of the rest of interesting files
- foreach (string file, [ "installation.xml", "license.tar.gz", "media.1/info.txt"],
+ foreach (string file, [ "installation.xml", "license.tar.gz",
+ "media.1/info.txt"],
{
if (FileUtils::Exists (base_path + "/" + file))
{
+ y2milestone ("creating sha1sum of %1", file);
out = (map) SCR::Execute (.target.bash_output,
sformat ("cd '%1' && sha1sum -- %2", base_path, String::Quote (file)), $["LANG" : "C"]);
string command = sformat ("echo 'HASH SHA1 %1' >> '%2/content'",
@@ -2217,7 +2227,9 @@
}
/**
- * Sign the add-on
+ * Sign current Add-On product
+ * @param base_path path to target product directory
+ * @param key GPG key to sign with
*/
global boolean SignAddOn (string base_path, string key) {
@@ -2257,6 +2269,7 @@
deletechars (out["stdout"]:"", "\n"), base_path);
SCR::Execute (.target.bash, command, $["LANG" : "C"]);
});
+ y2milestone ("signing content file...");
while (true)
{
// sign the content file
@@ -2283,6 +2296,7 @@
}
else break;
}
+ y2milestone ("... done");
SCR::Execute (.target.bash,
sformat("gpg --export -a %1 > '%2/content.key'",local_key, base_path));
@@ -2290,6 +2304,7 @@
// sign the packages
if (current_product["resign_packages"]:false)
{
+ y2milestone ("signing the packages...");
string expect = tmpdir + "/sign.ex";
SCR::Write (.target.string, expect,
sformat (expect_script, key, passphrase));
@@ -2303,20 +2318,42 @@
out = (map) SCR::Execute (.target.bash_output, cmd);
}
});
+ y2milestone ("... done");
SCR::Execute (.target.bash, sformat ("rm %1", expect));
+ // after signing packages checksums have changed:
+ // run create_package_descr again and take new 'packages' file
+ y2milestone ("updating packages descriptions...");
+ string cmd = sformat("/usr/bin/create_package_descr -d %1 -C -F -o %2",
+ full_data_path, tmpdir);
+ if (SCR::Execute (.target.bash, cmd, $["LANG":"C"]) == 0)
+ {
+ cmd = sformat ("/bin/cp %1/packages '%2'", tmpdir, full_descr_path);
+ SCR::Execute (.target.bash, cmd, $["LANG":"C"]);
+ if (compress_package_descriptions)
+ {
+ SCR::Execute (.target.bash,
+ sformat ("gzip %1/packages", full_descr_path));
+ }
+ }
+ else
+ {
+ y2warning ("'%1' failed", cmd);
+ }
+ y2milestone ("... done");
}
-
// sign products file
string products_path = full_media_paths[0]:"" + "/products";
if (FileUtils::Exists (products_path))
{
+ y2milestone ("signing products file...");
SCR::Execute (.target.bash, sformat ("rm -f '%1.asc'", products_path));
SCR::Execute (.target.bash,
sformat("gpg --batch --no-tty --passphrase-fd 0 --detach-sign -u %1 -a '%2' < %3",
local_key, products_path, pw_path));
SCR::Execute (.target.bash,
sformat("gpg --export -a %1 > '%2.key'", local_key,products_path));
+ y2milestone ("... done");
}
SCR::Execute (.target.remove, pw_path);
return true;
@@ -2330,11 +2367,13 @@
if (!FileUtils::Exists (base_path)) return false;
+ y2milestone ("creating directory.yast files...");
foreach (string dir, (list<string>) merge (
[base_path, full_descr_path], full_media_paths),
{
SCR::Execute (.target.bash_output, sformat ("cd '%1'; ls -A1 -p | grep -v 'directory.yast' > directory.yast", dir), $["LANG" : "C"]);
});
+ y2milestone ("... done");
return true;
}
@@ -2355,13 +2394,18 @@
name = name + ".iso";
current_product["iso_name"] = name; // ??
+ y2milestone ("creating iso image '%1/%2' from '%3' with mkisofs...",
+ iso_p, name, dir_path);
+
// possible options -allow-leading-dots
- string cmd = sformat("mkisofs -r -J -l -o '%1/%2' '%3'",iso_p, name, dir_path);
+ string cmd = sformat("mkisofs -r -J -l -o '%1/%2' '%3'",
+ iso_p, name, dir_path);
map out = (map) SCR::Execute (.target.bash_output, cmd);
if (out["exit"]:0 != 0)
{
y2warning ("%1 returned %2", cmd, out);
}
+ y2milestone ("... done");
return true;
}
@@ -2394,6 +2438,8 @@
*/
global void CommitCurrentProduct () {
+ y2milestone ("saving current product to the global list");
+
map modified_product = union (current_product, $[
"content_map" : content_map,
"available_packages" : available_packages,
@@ -2459,6 +2505,7 @@
});
return product;
});
+ y2milestone ("writing list of configured products");
return SCR::Write (.target.ycp, add_on_products_file, add_on_products);
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org