Author: jsuchome
Date: Thu Jul 24 10:59:35 2008
New Revision: 49375
URL: http://svn.opensuse.org/viewcvs/yast?rev=49375&view=rev
Log:
let's try to backport only ImageCreator stuff,not Product Creator
Modified:
branches/tmp/jsuchome/product-creator/scripts/y2mkiso
branches/tmp/jsuchome/product-creator/src/Kiwi.ycp
branches/tmp/jsuchome/product-creator/src/ProductCreator.ycp
branches/tmp/jsuchome/product-creator/src/commandline.ycp
branches/tmp/jsuchome/product-creator/src/complex.ycp
branches/tmp/jsuchome/product-creator/src/data/kiwi_templates/iso/config.xml
branches/tmp/jsuchome/product-creator/src/dialogs.ycp
branches/tmp/jsuchome/product-creator/src/kiwi_dialogs.ycp
branches/tmp/jsuchome/product-creator/src/product-creator.ycp
branches/tmp/jsuchome/product-creator/src/wizards.ycp
branches/tmp/jsuchome/product-creator/yast2-product-creator.spec.in
Modified: branches/tmp/jsuchome/product-creator/scripts/y2mkiso
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/scripts/y2mkiso?rev=49375&r1=49374&r2=49375&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/scripts/y2mkiso (original)
+++ branches/tmp/jsuchome/product-creator/scripts/y2mkiso Thu Jul 24 10:59:35 2008
@@ -28,28 +28,18 @@
DEST=$2
BOOT_ARCH=$3
-HFS_BLESS=
-
function usage()
{
-echo "This script creates an ISO image from an existing directory containing"
-echo "a SUSE source. The directory has to have files according to the SUSE"
-echo "media specification. This script will also search for the needed files"
-echo "to make a bootable CD and will create one if all files are available."
-echo
-echo "$0 <directory> []"
+echo "This script creates an ISO image from an existing directory containing a SuSE source."
+echo "The directory has to have files according to the SuSE media specification. This script"
+echo "will also search for the needed files to make a bootable CD and will create one if "
+echo "all files are available"
echo
-echo " directory - path to the source directory"
-echo " iso_file_name - output file name (e.g. /tmp/product.iso)"
-echo " boot_architecture - name of the target architecture, set to"
-echo " the directory name in /boot, e.g. i386, x86_64, ppc..."
-echo " If it's missing the old layout (plain /boot directory)"
-echo " is used."
+echo "$0 <directory> <iso file name>"
}
if [ -z "$SOURCE" -o -z "$DEST" ]; then
- echo "ERROR: Missing parameters."
- echo
+ echo "Missing parameters."
usage
exit 1
fi
@@ -222,8 +212,7 @@
# use netatalk and macbinary filename translation
# bless a directory named suseboot, mark it bootable
echo using suseboot for hfs boot
- PARAMS="$PARAMS -part --netatalk --macbin"
- HFS_BLESS="suseboot"
+ PARAMS="$PARAMS -part --netatalk --macbin -hfs-bless $SOURCE/suseboot"
FILE_MAPPING="/usr/share/YaST2/data/product-creator/HFS_mapping"
if [ -f $FILE_MAPPING ] ; then
echo using $FILE_MAPPING for hfs mapping
@@ -257,8 +246,7 @@
# use netatalk and macbinary filename translation
# bless a directory named suseboot, mark it bootable
echo using suseboot for hfs boot
- PARAMS="$PARAMS -part --netatalk --macbin"
- HFS_BLESS="suseboot"
+ PARAMS="$PARAMS -part --netatalk --macbin -hfs-bless $SOURCE/suseboot"
FILE_MAPPING="/usr/share/YaST2/data/product-creator/HFS_mapping"
if [ -f $FILE_MAPPING ] ; then
echo using $FILE_MAPPING for hfs mapping
@@ -352,22 +340,13 @@
fi
fi
-if [ -z "$HFS_BLESS" ] ; then
- set -x
- mkisofs \
- -p "$CD_PREPARER" \
- $PUB_OPT "$CD_PUBLISHER" \
- $PARAMS -o "$DEST" $XPARAMS "$SOURCE"
- set +x
-else
- set -x
- mkisofs \
- -p "$CD_PREPARER" \
- $PUB_OPT "$CD_PUBLISHER" \
- -hfs-bless "$SOURCE/$HFS_BLESS" \
- $PARAMS -o "$DEST" $XPARAMS "$SOURCE"
- set +x
-fi
+set -x
+mkisofs \
+ -p "$CD_PREPARER" \
+ $PUB_OPT "$CD_PUBLISHER" \
+ $PARAMS -o "$DEST" $XPARAMS "$SOURCE"
+set +x
+
if [ -d "$SOURCE2" ] ; then
echo removing $SOURCE2
Modified: branches/tmp/jsuchome/product-creator/src/Kiwi.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/Kiwi.ycp?rev=49375&r1=49374&r2=49375&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/Kiwi.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/Kiwi.ycp Thu Jul 24 10:59:35 2008
@@ -59,6 +59,11 @@
// map with image templates (to base new projects on)
global map Templates = $[];
+ // repository schemes unsupported by kiwi
+ // (= not to be offered as new sources, to be deleted
+ // from current system sources)
+ global list<string> unsupported_schemes = [ "iso", "cd", "dvd", "nfs", "smb" ];
+
/**
* crypt given user password with current encryption algorithm
*/
@@ -168,6 +173,7 @@
list<map> get_type_values (map config, string task) {
string boot_image = sformat ("%1boot/%2", task, config[task + "boot"]:"suse-10.2");
+ boolean primary_included = false;
list<map> retlist = maplist (
string type, map typemap, (map)config["type"]:$[], {
@@ -188,11 +194,14 @@
if (type == "vmx" && ret["format"]:"" == "")
ret["format"] = "vmdk";
if (type == task)
+ {
ret["primary"] = "true";
+ primary_included = true;
+ }
return ret;
});
// create default values for new project
- if (retlist == [])
+ if (retlist == [] || !primary_included)
{
map ret = $[
"__key" : "type",
@@ -206,7 +215,7 @@
ret["format"] = "vmdk";
if (task == "iso" || task == "oem")
ret["flags"] = "unified";
- retlist = [ ret ];
+ retlist = add (retlist, ret);
}
return retlist;
}
Modified: branches/tmp/jsuchome/product-creator/src/ProductCreator.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/ProductCreator.ycp?rev=49375&r1=49374&r2=49375&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/ProductCreator.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/ProductCreator.ycp Thu Jul 24 10:59:35 2008
@@ -32,8 +32,6 @@
import "GPGWidgets";
import "Mode";
import "CommandLine";
-import "FileUtils";
-import "PackageCallbacks";
global define void enableSources();
@@ -335,7 +333,7 @@
global define boolean Read() ``{
/* ProductCreator read dialog caption */
- string caption = _("Initializing Product Creator Configuration");
+ string caption = _("Initializing CD Creator Configuration");
integer steps = 1;
@@ -423,7 +421,7 @@
global define boolean Write() ``{
/* ProductCreator read dialog caption */
- string caption = _("Saving Product Creator Configuration");
+ string caption = _("Saving CD Creator Configuration");
integer steps = 2;
@@ -739,6 +737,16 @@
return ret;
}
+global boolean UpdateMD5File(string directory)
+{
+ string command = sformat("/usr/bin/create_md5sums '%1'", String::Quote(directory));
+ boolean ret = SCR::Execute(.target.bash, command) == 0;
+
+ y2milestone("MD5SUMS updated: %1", ret);
+
+ return ret;
+}
+
// execute a command
boolean Exec(string command)
{
@@ -757,16 +765,6 @@
return ret == 0;
}
-global boolean UpdateMD5File(string directory)
-{
- string command = sformat("/bin/sh /usr/bin/create_md5sums '%1'", String::Quote(directory));
- boolean ret = Exec(command);
-
- y2milestone("MD5SUMS updated: %1", ret);
-
- return ret;
-}
-
boolean CopyFile(integer srcid, integer mid, string src, string target)
{
string local_file = Pkg::SourceProvideFile(srcid, mid, src);
@@ -792,7 +790,7 @@
return true;
}
-boolean CopyDirectoryR(integer srcid, integer mid, string src, string target, boolean optional)
+boolean CopyDirectoryRec(integer srcid, integer mid, string src, string target)
{
y2milestone("CopyDirectoryRec: srcid: %1, mid: %2, src: %3, target: %4", srcid, mid, src, target);
@@ -801,55 +799,29 @@
if (local_dir == nil || local_dir == "")
{
- if (!optional)
- {
- // an error message, %1 is the directory, %2 is URL of the source
- Report::Error(sformat(_("Cannot read directory %1\nfrom source %2."), src, Pkg::SourceGeneralData(srcid)["url"]:""));
- }
-
+ // an error message, %1 is the directory, %2 is URL of the source
+ Report::Error(sformat(_("Cannot read directory %1\nfrom source %2."), src, Pkg::SourceGeneralData(srcid)["url"]:""));
return false;
}
return Exec(sformat("/bin/cp -a -f -- '%1' '%2'", String::Quote(local_dir), String::Quote(target)));
}
-boolean CopyDirectoryRec(integer srcid, integer mid, string src, string target)
-{
- return CopyDirectoryR(srcid, mid, src, target, false);
-}
-
-boolean CopyDirectoryRecOpt(integer srcid, integer mid, string src, string target)
-{
- return CopyDirectoryR(srcid, mid, src, target, true);
-}
-
-list<string> GetList(integer srcid, integer mid, string dir)
+boolean CopyDirectoryNonRec(integer srcid, integer mid, string src, string target)
{
// get file list from directory.yast
- string file_list = Pkg::SourceProvideOptionalFile(srcid, mid, sformat("%1/directory.yast", dir));
+ string file_list = Pkg::SourceProvideOptionalFile(srcid, 1, "directory.yast");
if (file_list == nil || file_list == "")
{
y2error("directory.yast was not found, a YUM source?");
- return nil;
+ return false;
}
string f = (string)SCR::Read(.target.string, file_list);
list<string> files = splitstring(f, "\n");
y2milestone("Remote objects: %1", files);
- return files;
-}
-
-boolean CopyDirectoryNonRec(integer srcid, integer mid, string src, string target)
-{
- // get file list from directory.yast
- list<string> files = GetList(srcid, mid, "");
- if (files == nil)
- {
- files = [];
- }
-
files = filter(string file, files, {return !regexpmatch(file, "/$") && file != "";});
y2milestone("Remote files: %1", files);
@@ -863,126 +835,11 @@
return true;
}
-boolean CopyDocu(integer srcid, string target)
-{
- list<string> lst = GetList(srcid, 1, "");
- if (lst == nil)
- {
- lst = [];
- }
-
- boolean ret = true;
-
- if (contains(lst, "docu/"))
- {
- y2milestone("Copying /docu subdirectory");
- Exec(sformat("/bin/mkdir -p '%1/docu'", String::Quote(target)));
-
- boolean r = CopyDirectoryRecOpt(srcid, 1, "/docu", target);
-
- if (!r)
- {
- list<string> files = [
- "docu/RELEASE-NOTES.en.html", "docu/RELEASE-NOTES.en.rtf"
- ];
-
- y2milestone("Directory listing may be missing using fixed list: %1", files);
-
- foreach(string f, files,
- {
- CopyFile(srcid, 1, f, target + f);
- }
- );
- }
-
- ret = ret && r;
- }
-
- return ret;
-}
-
boolean CopyPPCBoot(integer srcid, string target)
{
- y2milestone("Copying PPC boot files");
-
- list<string> lst = GetList(srcid, 1, "");
- if (lst == nil)
- {
- lst = [];
- }
-
- boolean ret = true;
-
- if (contains(lst, "ppc/"))
- {
- y2milestone("Copying /ppc subdirectory");
- boolean r = CopyDirectoryRecOpt(srcid, 1, "/ppc", target);
-
- if (!r)
- {
- y2milestone("Directory listing may be missing, copying /ppc/bootinfo.txt");
- CopyFile(srcid, 1, "/ppc/bootinfo.txt", target + "/ppc");
- }
-
- ret = ret && r;
- }
-
- if (contains(lst, "PS3/"))
- {
- y2milestone("Copying /ppc subdirectory");
- boolean r = CopyDirectoryRecOpt(srcid, 1, "/PS3", target);
-
- if (!r)
- {
- y2milestone("Directory listing may be missing, copying /ppc/bootinfo.txt");
- Exec(sformat("/bin/mkdir -p '%1/PS3/otheros'", String::Quote(target)));
- CopyFile(srcid, 1, "/PS3/otheros/otheros.bld", target + "/PS3/otheros");
- }
-
- ret = ret && r;
- }
-
- if (contains(lst, "suseboot/"))
- {
- y2milestone("Copying /suseboot subdirectory");
- boolean r = CopyDirectoryRecOpt(srcid, 1, "/suseboot", target);
- y2milestone("Result: %1", r);
-
- if (!r)
- {
- list<string> files = [
- "/suseboot/inst32", "/suseboot/inst64", "/suseboot/os-chooser",
- "/suseboot/yaboot", "/suseboot/yaboot.cnf", "/suseboot/yaboot.ibm",
- "/suseboot/yaboot.txt"
- ];
-
- y2milestone("Directory listing may be missing using fixed list: %1", files);
-
- foreach(string f, files,
- {
- CopyFile(srcid, 1, f, target + f);
- }
- );
- }
-
- ret = ret && r;
- }
-
- if (contains(lst, "etc/"))
- {
- y2milestone("Copying /etc subdirectory");
- boolean r = CopyDirectoryRecOpt(srcid, 1, "/etc", target);
-
- if (!r)
- {
- y2milestone("Directory listing may be missing, copying /etc/yaboot.conf");
- CopyFile(srcid, 1, "/etc/yaboot.conf", target + "/etc");
- }
-
- ret = ret && r;
- }
-
- return ret;
+ return CopyDirectoryRec(srcid, 1, "/ppc", target)
+ && CopyDirectoryRec(srcid, 1, "/etc", target)
+ && CopyDirectoryRec(srcid, 1, "/suseboot", target);
}
string UpDir(string input)
@@ -1086,97 +943,60 @@
list<integer> sources = UrlToId(Config["sources"]:[]);
- if (size(sources) == 1)
- {
- y2milestone("Only one source selected");
- return sources[0]:-1;
- }
-
- // the products must be in the pool
- Pkg::SourceLoad();
+ // we have to sort the products according to requires to get the base product
+ string tsort_input = "";
- list<map> product_deps = Pkg::ResolvableDependencies("", `product, "");
- y2milestone("found products: %1", product_deps);
+ map provide_map = $[];
- // filter out unused products
- product_deps = filter(map prod, product_deps, {return contains(sources, prod["source"]:-1);});
+ string base_product_name = "";
- y2milestone("used products: %1", product_deps);
+ foreach(integer id , sources, ``{
- // we have to sort the products according to requires to get the base product
- string tsort_input = "";
+ map general_info = Pkg::SourceGeneralData(id);
- foreach(map prod, product_deps,
+ // a YUM source cannot contain base product
+ // only YaST source is supported
+ if (general_info["type"]:"" == "YaST")
{
- list<string> provides = [];
- list<string> requires = [];
-
- // collect provides and requires dependencies
- foreach(map dep, (list<map>)prod["dependencies"]:[],
- {
- string kind = dep["dep_kind"]:"";
- // replace ' ' -> '_' (tsort uses space as a separator)
- string name = String::Replace(dep["name"]:"", " ", "_");
-
- if (name != "")
- {
- if (kind == "provides")
- {
- provides = add(provides, name);
- }
- else if (kind == "requires")
- {
- requires = add(requires, name);
- }
- }
- }
- );
+ map content_file = ReadContentFile(id);
- integer src = prod["source"]:-1;
+ string requires = content_file["REQUIRES"]:"";
+ string provides = content_file["PROVIDES"]:"";
- y2milestone("Source %1: provides: %2, requires: %3", src, provides, requires);
+ if (provides == "")
+ {
+ //provides = sformat("%1-%2", productData["productname"]:"", productData["productversion"]:"" );
+ provides = sformat("%1-%2", content_file["PRODUCT"]:"", content_file["VERSION"]:"" );
+ }
- string src_str = sformat("@repository_id:%1@", src);
+ string provides_tsort = String::Replace(provides, " ", "_");
- // add requires dependencies to the tsort input
- foreach(string r, requires,
- {
- tsort_input = tsort_input + sformat("%1 %2\n", src_str, r);
- }
- );
+ base_product_name = provides;
- // add provides dependencies to the tsort input
- foreach(string p, provides,
- {
- tsort_input = tsort_input + sformat("%1 %2\n", p, src_str);
- }
- );
+ tsort_input = tsort_input + provides_tsort + " " + String::Replace(requires, " ", "_") + "\n";
+ provide_map[provides_tsort] = id;
}
- );
+ });
- y2milestone("tsort input: %1", tsort_input);
+ integer base = sources[0]:0;
- // run tsort
- map sorted = (map)SCR::Execute(.target.bash_output, sformat("echo '%1' | tsort | tac", String::Quote(tsort_input)));
- list<string> sorted_prods = splitstring(sorted["stdout"]:"", "\n");
- y2milestone("Sorted products: %1", sorted_prods);
+ if (size(sources) > 1)
+ {
+ y2debug("tsort_input: %1", tsort_input);
+ // run tsort
+ map sorted = (map)SCR::Execute(.target.bash_output, sformat("echo '%1' | tsort | tac", String::Quote(tsort_input)));
+ list<string> sorted_prods = splitstring(sorted["stdout"]:"", "\n");
- integer base_source = sources[0]:-1;
+ // remove requires
+ sorted_prods = filter(string p, sorted_prods, {return haskey(provide_map, p);});
+ y2milestone("Sorted products: %1", sorted_prods);
- foreach(string line, sorted_prods,
- {
- string src_id = regexpsub(line, "@repository_id:([0-9]*)@", "\\1");
+ base = provide_map[sorted_prods[0]:""]:0;
+ }
- if (src_id != nil)
- {
- base_source = tointeger(src_id);
- y2milestone("Found base source: %1", base_source);
- break;
- }
- }
- );
+ y2milestone("Found base source: id: %1, %2", base, Pkg::SourceGeneralData(base));
- return base_source;
+ return base;
}
global string CreateAddonFile(map products)
@@ -1194,7 +1014,7 @@
ret = ret + "\n";
}
- ret = ret + "relurl://./" + subdir;
+ ret = ret + "cd:///" + subdir;
}
}
);
@@ -1239,19 +1059,13 @@
skel_root = sformat("%1/%2", Config["iso-directory"]:"", Config["name"]:"");
SCR::Execute(.target.mkdir, skel_root);
- string base_url = Config["base_repo"]:"";
- y2milestone("Configured base repository: %1", base_url);
-
// detect the base source
- integer base_source = (base_url != "") ? (UrlToId([base_url])[0]:-1) : checkProductDependency();
+ integer base_source = checkProductDependency();
boolean bootable_product = isBootSource(base_source);
- // ppc64 has /boot/ppc
- string boot_architecture = (arch == "ppc64") ? "ppc" : arch;
-
- if (bootable_product && Config["code10"]:false)
+ if (bootable_product)
{
- Exec(sformat("/bin/mkdir -p '%1/boot/%2'", String::Quote(skel_root), String::Quote(boot_architecture)));
+ Exec(sformat("/bin/mkdir -p '%1/boot/%2'", String::Quote(skel_root), String::Quote(arch)));
}
list<integer> enabled = Pkg::SourceGetCurrent(true);
@@ -1277,7 +1091,7 @@
}
else if (Arch::ppc() || Arch::ppc64())
{
- Exec(sformat("/bin/mkdir -p '%1/PS3'", String::Quote(skel_root)));
+ Exec(sformat("/bin/mkdir -p '%1/etc'", String::Quote(skel_root)));
Exec(sformat("/bin/mkdir -p '%1/ppc'", String::Quote(skel_root)));
Exec(sformat("/bin/mkdir -p '%1/suseboot'", String::Quote(skel_root)));
}
@@ -1315,9 +1129,6 @@
if (source == "")
return false;
- // copy /docu (release notes) when present
- CopyDocu(id, skel_root);
-
y2milestone("source: %1", source);
descr_dir = this_source["productData","descrdir"]:"suse/setup/descr";
@@ -1533,13 +1344,6 @@
CopyDirectoryRec(base_source, 1, "boot/loader", sformat("%1/boot", skel_root));
}
}
- else if (Arch::ppc() || Arch::ppc64())
- {
- CopyPPCBoot(base_source, skel_root);
-
- // recursive copy of /boot
- CopyDirectoryRec(base_source, 1, "boot", skel_root);
- }
else
{
// recursive copy of /boot/loader/*
@@ -1548,12 +1352,7 @@
}
else
{
- CopyDirectoryRec(base_source, 1, "boot", skel_root);
-
- if (Arch::ppc() || Arch::ppc64())
- {
- CopyPPCBoot(base_source, skel_root);
- }
+ CopyDirectoryRec(base_source, 1, "/boot", skel_root);
}
}
}
@@ -1596,7 +1395,7 @@
{
// copy slide show
Exec(sformat("/bin/mkdir -p '%1/%2'", String::Quote(skel_root), String::Quote(slidedir)));
- Exec(sformat("/bin/cp -a -- '%1' '%2/%3'", String::Quote(l_slidedir), String::Quote(skel_root), String::Quote(datadir + "/setup/")));
+ Exec(sformat("/bin/cp -a -- '%1/*' '%2/%3'", String::Quote(l_slidedir), String::Quote(skel_root), String::Quote(slidedir)));
}
}
else
@@ -1705,9 +1504,6 @@
// remove the meta information from content file
Exec(sformat("/usr/bin/grep -v -e '^KEY ' -e '^META ' '%1/content' > '%1/content.new'", String::Quote(skel_root)));
Exec(sformat("/bin/mv '%1/content.new' '%1/content'", String::Quote(skel_root)));
- // mark the final product as 'base'
- if (SCR::Execute (.target.bash, sformat("/usr/bin/grep '^TYPE' '%1/content'", String::Quote(skel_root))) != 0)
- Exec(sformat("echo 'TYPE base' >> '%1/content'", String::Quote(skel_root)));
// recreate the index file
// FIXME: use create_directory when it supports parameter with spaces
@@ -1732,14 +1528,12 @@
files = [];
}
- files = filter(string f, files, {return regexpmatch(f, "\\.pat$") || regexpmatch(f, "\\.pat.gz$");});
+ files = filter(string f, files, {return regexpmatch(f, "\\.pat$");});
y2milestone("found pattern files: %1", files);
- list<string> used_files_regexps = (list<string>)union(maplist(string p, used_patterns, {return sformat("^%1-.*\\.pat$", p);}),
- maplist(string p, used_patterns, {return sformat("^%1-.*\\.pat.gz$", p);}));
-
- y2milestone("used_files_regexps: %1", used_files_regexps);
+ list<string> used_files_regexps = maplist(string p, used_patterns, {return sformat("^%1-.*\\.pat$", p);});
+ y2debug("used_files_regexps: %1", used_files_regexps);
boolean refresh_diryast = false;
foreach(string f, files,
@@ -1759,15 +1553,14 @@
{
// remove the pattern
string cmd = sformat("/bin/rm -- '%1/%2/%3'", String::Quote(skel_root), String::Quote(descrDir), String::Quote(f));
+ y2milestone("removing pattern %1", f);
success = success && Exec(cmd);
- y2milestone("removing pattern %1: %2", f, success);
+ y2debug("success: %1", success);
refresh_diryast = true;
}
}
);
- y2milestone("removed patterns: %1", success);
-
if (refresh_diryast)
{
// regenerate directory.yast and patterns file
@@ -1776,8 +1569,9 @@
success = success && Exec(cmd);
y2debug("success: %1", success);
- cmd = sformat("cd '%1/%2'; ls *.pat *.pat.gz > '%1/%2/patterns'", String::Quote(skel_root), String::Quote(descrDir));
- Exec(cmd);
+ cmd = sformat("cd '%1/%2'; ls *.pat > '%1/%2/patterns'", String::Quote(skel_root), String::Quote(descrDir));
+ success = success && Exec(cmd);
+ y2debug("success: %1", success);
}
}
@@ -1796,7 +1590,7 @@
success = success && SCR::Write(.target.string, target_addon_file, addon_file);
}
- y2milestone("Created skeleton: %1", success);
+ y2debug("success: %1", success);
return success;
}
@@ -1837,37 +1631,6 @@
return ret;
}
-string DumpKernelFromObjectFile(string object)
-{
- y2milestone("Extracting kernel from file %1", object);
- string tmpdir = (string)SCR::Read(.target.tmpdir);
- string target = tmpdir + "/tmp_kernel.gz";
-
- string command = sformat("objcopy -O binary -j .kernel:vmlinux.strip '%1' '%2'", String::Quote(object), String::Quote(target));
- string ret = (Exec(command)) ? target : "";
-
- y2milestone("Kernel extracted to %1", ret);
-
- return ret;
-}
-
-string GunzipKernel(string kernel_gz)
-{
- string command = sformat("gunzip -f %1", kernel_gz);
- boolean success = Exec(command);
- string ret = "";
-
- // remove .gz suffix from the file name
- if (success)
- {
- ret = regexpsub (kernel_gz, "^(.*)\\.gz$", "\\1");
- }
-
- y2milestone("Kernel unpacked to %1", ret);
-
- return ret;
-}
-
global boolean InsertKeyToInitrds(string gpg_key, string base_dir)
{
// get initrd list
@@ -1883,54 +1646,12 @@
find_output = out["stdout"]:"";
}
- map inst_mapping = $[];
-
if (SCR::Read(.target.size, base_dir + "/suseboot") >= 0)
{
y2milestone("Searching for 'initrd*' in %1/suseboot...", base_dir);
command = sformat("cd '%1' && find suseboot -type f -name 'initrd*'", String::Quote(base_dir));
out = (map)SCR::Execute(.target.bash_output, command);
find_output = find_output + out["stdout"]:"";
-
- if (size(out["stdout"]:"") == 0)
- {
- y2milestone("initrd not found, searching for inst*");
-
- command = sformat("cd '%1' && find suseboot -type f -name 'inst32'; find suseboot -type f -name 'inst64'", String::Quote(base_dir));
- out = (map)SCR::Execute(.target.bash_output, command);
-
- list<string> inst_files = splitstring(out["stdout"]:"", "\n");
- // remove empty strings
- inst_files = filter(string inst, inst_files, {return inst != "";});
-
- if (size(inst_files) > 0)
- {
- y2milestone("Found inst* files: %1", inst_files);
-
- integer index = 0;
- // unpack the initrd from the inst* object
- foreach(string inst, inst_files,
- {
- string tmp_initrd = sformat("suseboot/.tmp_yast_initrd%1.gz", index);
-
- command = sformat("cd '%1' && objcopy -O binary -j .kernel:initrd '%2' '%3'", String::Quote(base_dir), String::Quote(inst), tmp_initrd);
-
- out = (map)SCR::Execute(.target.bash_output, command);
-
- if (out["exit"]:-1 == 0)
- {
- y2milestone("Extracted %1 from %2", tmp_initrd, inst);
- find_output = find_output + tmp_initrd + "\n";
-
- inst_mapping = add(inst_mapping, inst, tmp_initrd);
- }
-
- index = index + 1;
- }
- );
-
- }
- }
}
list<string> initrds = splitstring(find_output, "\n");
@@ -1953,50 +1674,6 @@
}
);
- // put the initrd back to the inst file
- foreach(string orig_inst, string tmp_initrd, inst_mapping,
- {
- y2milestone("%1 -> %2", tmp_initrd, orig_inst);
-
- if (orig_inst == "suseboot/inst32" || orig_inst == "suseboot/inst64")
- {
- // extract kernel
- string gzkernel = DumpKernelFromObjectFile(base_dir + "/" + orig_inst);
-
- if (gzkernel != "")
- {
- // unpack the kernel image - required by mkzimage
- string kernel = GunzipKernel(gzkernel);
- string tmp_dir = (string)SCR::Read( .target.tmpdir );
-
- string initrd_copy = sformat("%1/tmp_initrd", tmp_dir);
-
- // copy the initrd to a temp dir - mkzimage doesn't work properly
- // when there is a space in path
- ret = ret && Exec(sformat("mv '%1/%2' '%3'", String::Quote(base_dir), tmp_initrd, initrd_copy));
-
- // create new inst file
- // see mk_ppc_installation-images_bootbinaries.sh (installation-images)
- command = sformat("/bin/mkzimage --board chrp --vmlinux '%1' --initrd '%2' --output '%3/new_inst' --tmp '%3'",
- kernel, initrd_copy, tmp_dir);
- ret = ret && Exec(command);
-
- // remove the temporary files
- command = sformat("rm -f '%1' '%2'", kernel, initrd_copy);
- ret = ret && Exec(command);
-
- // move the new file to the target directory
- command = sformat("mv '%1/new_inst' '%2/%3'", tmp_dir, String::Quote(base_dir), orig_inst);
- ret = ret && Exec(command);
- }
- }
- else
- {
- y2warning("Unsupported inst file: %1", orig_inst);
- }
- }
- );
-
return ret;
}
@@ -2035,26 +1712,6 @@
return ret;
}
-// do not sign the sources, just update content files
-global boolean UpdateContentFiles()
-{
- boolean success = true;
-
- foreach(integer srcid, string dir, product_map,
- {
- map general_info = Pkg::SourceGeneralData(srcid);
-
- if (general_info["type"]:"" == "YaST")
- {
- success = UpdateContentFile(skel_root + "/" + dir, "suse/setup/descr") && success;
- y2milestone("Updated content file in %1: %2", skel_root + "/" + dir, success);
- }
- }
- );
-
- return success;
-}
-
global boolean SignSourceStep()
{
boolean success = true;
@@ -2286,22 +1943,7 @@
return;
}
-/**
- * Check if there is a language selected in the package manager,
- * if not then select the language used in the UI. Htis prevents the solver
- * from allocating too many resources (see bug #339756)
- */
-global void CheckLanguage()
-{
-/* FIXME no relevant code in SP2
- if (Pkg::GetPackageLocale() == "" && Pkg::GetAdditionalLocales() == [])
- {
- y2warning("No language selected, preselecting the current UI language: %1", UI::GetLanguage(true));
- // if there is nothing selected yet then preset the language
- Pkg::SetPackageLocale(UI::GetLanguage(true));
- }
-*/
-}
+
/**
* Set packages to be copied to iso image tree
@@ -2319,21 +1961,17 @@
kernels = [
"kernel-64k-pagesize",
"kernel-bigsmp",
- "kernel-pae",
"kernel-debug",
"kernel-default",
"kernel-iseries64",
"kernel-pmac64",
"kernel-pseries64",
- "kernel-ppc64",
"kernel-s390",
"kernel-s390x",
"kernel-smp",
"kernel-sn2",
"kernel-xen",
- "kernel-xenpae",
- "kernel-um",
- "kernel-vanilla"
+ "kernel-um"
];
} else {
kernels = add(kernels, kernel);
@@ -2379,8 +2017,6 @@
Pkg::DoProvide(packages);
- CheckLanguage();
-
boolean ret = Pkg::PkgSolve(false);
return (ret);
@@ -2509,73 +2145,11 @@
return true;
}
-global void CallbackSourceReportEnd(integer numeric_id, string url, string task, symbol error, string reason)
+global void CallbackSourceReportEnd(integer numeric_id, string url, string task, string error, string reason)
{
y2debug("source_id: %1, url: %2, task: %3, error: %4, reason: %5", numeric_id, url, task, error, reason);
}
-global void InitDownload(string task)
-{
- y2debug("InitDownload: %1", task);
-}
-
-global void DestDownload()
-{
- y2debug("DestDownload");
-}
-
-global void StartDownload (string url, string localfile)
-{
- // reformat the URL
- string url_report = URL::FormatURL(URL::Parse(url), 60);
-
- if (Mode::commandline()) {
- CommandLine::PrintVerbose(url_report);
- }
- else
- {
- // change the label
- UI::ChangeWidget(`id(`pb), `Label, sformat(_("Copying %1"), url_report));
- }
-}
-
-
-global void StartDownloadEmpty (string url, string localfile)
-{
- y2debug("StartDownload: %1", url);
-}
-
-global boolean ProgressDownload (integer percent, integer bps_avg, integer bps_current)
-{
- return UI::PollInput() != `abort;
-}
-
-global void RedirectCallbacks()
-{
- Pkg::CallbackSourceReportStart("ProductCreator::CallbackSourceReportStart");
- Pkg::CallbackSourceReportProgress("ProductCreator::CallbackSourceReportProgress");
- Pkg::CallbackSourceReportEnd("ProductCreator::CallbackSourceReportEnd");
-
-// Pkg::CallbackInitDownload ("ProductCreator::InitDownload");
- Pkg::CallbackStartDownload ("ProductCreator::StartDownload");
- Pkg::CallbackProgressDownload ("ProductCreator::ProgressDownload");
- // use the standard callback handler
- Pkg::CallbackDoneDownload ("PackageCallbacks::DoneDownload");
-// Pkg::CallbackDestDownload ("ProductCreator::DestDownload");
-}
-
-global void ResetCallbacks()
-{
- Pkg::CallbackSourceReportStart("PackageCallbacks::SourceReportStart");
- Pkg::CallbackSourceReportProgress("PackageCallbacks::SourceReportProgress");
- Pkg::CallbackSourceReportEnd("PackageCallbacks::SourceReportEnd");
-
-// Pkg::CallbackInitDownload ("PackageCallbacks::InitDownload");
- Pkg::CallbackStartDownload ("PackageCallbacks::StartDownload");
- Pkg::CallbackProgressDownload ("PackageCallbacks::ProgressDownload");
- Pkg::CallbackDoneDownload ("PackageCallbacks::DoneDownload");
-// Pkg::CallbackDestDownload ("PackageCallbacks::DestDownload");
-}
/**
* CopyPackages()
@@ -2591,10 +2165,12 @@
boolean ret = true;
- y2milestone("Package summary: %1", toCopy);
+ // disable source report callbacks - there is a progress dialog
+ Pkg::CallbackSourceReportStart("ProductCreator::CallbackSourceReportStart");
+ Pkg::CallbackSourceReportProgress("ProductCreator::CallbackSourceReportProgress");
+ Pkg::CallbackSourceReportEnd("ProductCreator::CallbackSourceReportEnd");
-// Pkg::CallbackStartDownload (ProductCreator::StartDownloadEmpty);
- Pkg::CallbackStartDownload ("ProductCreator::StartDownloadEmpty");
+ y2milestone("Package summary: %1", toCopy);
// copy the packages
foreach(integer source, map srcmapping, toCopy,
@@ -2665,24 +2241,16 @@
else
{
// TODO FIXME get datadir from the source
- ret = ret && Exec(sformat("cd '%1/%2/%3' && /usr/bin/create_package_descr -x setup/descr/EXTRA_PROV -M 3",
+ ret = ret && Exec(sformat("cd '%1/%2/%3' && /usr/bin/create_package_descr -x setup/descr/EXTRA_PROV",
String::Quote(basedir), String::Quote(subdir), String::Quote(datadir)));
-
- // check if the metadata are gzipped
- boolean compressed_meta = FileUtils::Exists(sformat("%1/%2/%3/setup/descr/packages.DU.gz", basedir, subdir, datadir));
- y2milestone("Compressed metadata: %1", compressed_meta);
-
- if (compressed_meta)
- {
- ret = ret && Exec(sformat("cd '%1/%2/%3/setup/descr/' && gzip -9 -f packages packages.DU packages.en",
- String::Quote(basedir), String::Quote(subdir), String::Quote(datadir)));
- }
}
}
);
-// Pkg::CallbackStartDownload (ProductCreator::StartDownload);
- Pkg::CallbackStartDownload ("ProductCreator::StartDownload");
+ // restore the source report callbacks
+ Pkg::CallbackSourceReportStart("PackageCallbacks::SourceReportStart");
+ Pkg::CallbackSourceReportProgress("PackageCallbacks::SourceReportProgress");
+ Pkg::CallbackSourceReportEnd("PackageCallbacks::SourceReportEnd");
return ret;
}
Modified: branches/tmp/jsuchome/product-creator/src/commandline.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/commandline.ycp?rev=49375&r1=49374&r2=49375&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/commandline.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/commandline.ycp Thu Jul 24 10:59:35 2008
@@ -363,7 +363,7 @@
else
{
// summary text
- CommandLine::Print (_("The medium will not be digitally signed"));
+ CommandLine::Print (_("The medium will not be digitally signed."));
}
return false;
}
Modified: branches/tmp/jsuchome/product-creator/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/complex.ycp?rev=49375&r1=49374&r2=49375&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/complex.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/complex.ycp Thu Jul 24 10:59:35 2008
@@ -267,29 +267,17 @@
help );
- if(ProductCreator::Abort())
- {
- ProductCreator::ResetCallbacks();
- return `abort;
- }
+ if(ProductCreator::Abort()) return `abort;
Progress::NextStage();
- // redirect the download callbacks
- ProductCreator::RedirectCallbacks();
-
if (!ProductCreator::CreateSkeleton())
{
Report::Error(_("Error while creating skeleton."));
- ProductCreator::ResetCallbacks();
return `overview;
}
- if(ProductCreator::Abort())
- {
- ProductCreator::ResetCallbacks();
- return `abort;
- }
+ if(ProductCreator::Abort()) return `abort;
Progress::NextStage();
if (ProductCreator::Config["pkgtype"]:"" == "autoyast")
{
@@ -300,12 +288,9 @@
if (ProductCreator::Config["bootconfig"]:"" != "")
{
y2debug("bootconfig available");
-
- string fname = (ProductCreator::Config["code10"]:false)
- ? sformat("%1/boot/%2/loader/isolinux.cfg", ProductCreator::skel_root, Arch::architecture())
- : sformat("%1/boot/loader/isolinux.cfg", ProductCreator::skel_root);
-
- SCR::Write(.target.string, fname, ProductCreator::Config["bootconfig"]:"" );
+ SCR::Write(.target.string,
+ sformat("%1/boot/loader/isolinux.cfg", ProductCreator::skel_root),
+ ProductCreator::Config["bootconfig"]:"" );
}
}
@@ -313,7 +298,6 @@
Progress::NextStage();
if (!ProductCreator::CopyPackages())
{
- ProductCreator::ResetCallbacks();
return `overview;
}
@@ -322,15 +306,9 @@
Progress::NextStage();
if (!ProductCreator::SignSourceStep())
{
- ProductCreator::ResetCallbacks();
return `overview;
}
}
- else
- {
- // update content files if the source is not signed (bnc #368146)
- ProductCreator::UpdateContentFiles();
- }
integer i = 0;
@@ -366,10 +344,8 @@
{
Popup::ShowFeedback(_("Creating CD Image..."), _("This may take a while"));
}
- string arch = Arch::architecture ();
- if (arch == "s390_64") arch = "s390x";
- string command = sformat("/usr/lib/YaST2/bin/y2mkiso '%1' '%2' '%3'", String::Quote(isodir), String::Quote(isofile), String::Quote((ProductCreator::Config["code10"]:false) ? arch : ""));
+ string command = sformat("/usr/lib/YaST2/bin/y2mkiso '%1' '%2' '%3'", String::Quote(isodir), String::Quote(isofile), String::Quote((ProductCreator::Config["code10"]:false) ? Arch::architecture() : ""));
y2milestone("command: %1", command);
SCR::Execute (.target.bash, command, $["CD_PUBLISHER": pub, "CD_PREPARER": prep ]);
@@ -382,9 +358,6 @@
}
} until (ret == `next || ret == `back || ret == `abort);
-
- ProductCreator::ResetCallbacks();
-
return (symbol)ret;
}
@@ -552,13 +525,6 @@
return `skip_isolinux;
}
- // skip isolinux configuration if the architecture
- // is not i386 or x86_64 - there is no isolinux
- if (Arch::architecture() != "i386" && Arch::architecture() != "x86_64")
- {
- return `skip_isolinux;
- }
-
return `next;
}
@@ -610,7 +576,7 @@
}
// help text
- string help_text = _("<p>Start the creating of new image configuration with <b>Add</b>.</p>") +
+ string help_text = _("<p>Start the creation of a new image configuration with <b>Add</b>.</p>") +
// help text
_("<p>Use <b>Edit</b> to change selected image configuration or create the image.</p>") +
@@ -619,7 +585,7 @@
_("<p>Delete the directory with selected configuration using <b>Delete</b>.</p>") +
// help text, %1 is directory
- sformat (_("<p>All image configurations are saved in <tt>%1</tt> directory.</p>"), images_dir);
+ sformat (_("<p>All image configurations are saved in the <tt>%1</tt> directory.</p>"), images_dir);
// main dialog caption
string caption = _("Image Creator Configuration Overview");
@@ -646,6 +612,7 @@
Wizard::HideAbortButton();
UI::ChangeWidget (`id (`edit), `Enabled, size (overview) > 0);
+ UI::ChangeWidget (`id (`delete), `Enabled, size (overview) > 0);
if (size (overview) > 0)
{
string current = (string) UI::QueryWidget(`id(`table), `CurrentItem);
@@ -679,7 +646,7 @@
{
if (Popup::YesNo (
// yes/no popup
-sformat (_("Delete configutation %1 now?"), current)))
+sformat (_("Delete configuration %1 now?"), current)))
{
map config = Configurations[current]:$[];
string dir =
@@ -691,6 +658,8 @@
overview = filter (term it, (list<term>) overview,
``(it[0,0]:"" != current));
UI::ChangeWidget (`id (`table), `Items, overview);
+ UI::ChangeWidget (`id (`edit), `Enabled, size (overview) > 0);
+ UI::ChangeWidget (`id (`delete), `Enabled, size (overview) > 0);
}
}
else if (ret == `edit)
Modified: branches/tmp/jsuchome/product-creator/src/data/kiwi_templates/iso/config.xml
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/data/kiwi_templates/iso/config.xml?rev=49375&r1=49374&r2=49375&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/data/kiwi_templates/iso/config.xml (original)
+++ branches/tmp/jsuchome/product-creator/src/data/kiwi_templates/iso/config.xml Thu Jul 24 10:59:35 2008
@@ -22,10 +22,6 @@
<opensusePattern name="x11"/>
<opensusePattern name="kde"/>
</packages>
- <packages type="xen" memory="512" disk="/dev/sda">
- <package name="kernel-xen"/>
- <package name="xen"/>
- </packages>
<packages type="bootstrap">
<package name="filesystem"/>
<package name="glibc-locale"/>
Modified: branches/tmp/jsuchome/product-creator/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/dialogs.ycp?rev=49375&r1=49374&r2=49375&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/dialogs.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/dialogs.ycp Thu Jul 24 10:59:35 2008
@@ -16,6 +16,7 @@
import "SourceManager";
import "Report";
import "URL";
+ import "StorageDevices";
import "Arch";
import "Label";
import "Popup";
@@ -95,9 +96,10 @@
define symbol Configure1Dialog () ``{
/* ProductCreator configure1 dialog caption */
- string caption = _("Product Creator Configuration");
+ string caption = _("CD Creator Configuration");
+ string source = ProductCreator::Config["source"]:"";
string name = ProductCreator::Config["name"]:"";
string pkgtype = ProductCreator::Config["pkgtype"]:"package-manager";
@@ -253,9 +255,6 @@
return (symbol)ret;
}
- // remember the direction to correctly skip baseProductSelectionDialog()
- boolean going_back = false;
-
/**
* Configure2 dialog
* @return dialog result
@@ -269,6 +268,7 @@
string publisher = ProductCreator::Config["publisher"]:"";
string preparer = ProductCreator::Config["preparer"]:"";
string result = ProductCreator::Config["result"]:"iso";
+ string db = ProductCreator::Config["database"]:"original";
string isofile_path = ProductCreator::Config["isofile"]:"";
boolean savespace = ProductCreator::Config["savespace"]:false;
@@ -383,7 +383,6 @@
}
else if (ret == `back)
{
- going_back = true;
break;
}
else if(ret == `next)
@@ -451,7 +450,7 @@
y2debug("sources: %1", sources);
term table =
- `Table( `id( `table ), `opt( `keepSorting, `notify ),
+ `Table( `id( `table ), `opt( `keepSorting ),
`header(_("Selected"), _("Status"), _("Name"), _("URL") ),
sources
);
@@ -494,11 +493,6 @@
while(true) {
ret = UI::UserInput();
- if (ret == `table)
- {
- integer ID = (integer)UI::QueryWidget(`id(`table),`CurrentItem);
- ret = contains (selected_items, ID) ? `remove : `select;
- }
/* abort? */
if(ret == `abort || ret == `cancel) {
if(ProductCreator::ReallyAbort()) break;
@@ -538,17 +532,11 @@
y2milestone("Architecture %1 is supported: %2", arch, found_architecture);
- if (found_architecture)
+ if (true)
{
if (!contains(selected_items, SrcID))
{
selected_items = add (selected_items, SrcID );
-
- // enable the source
- if (general_info["enabled"]:false)
- {
- Pkg::SourceSetEnabled(SrcID, true);
- }
}
UI::ChangeWidget(`id(`table), `Item(SrcID, 0) , _("X"));
@@ -563,14 +551,6 @@
else if (ret == `remove)
{
integer SrcID = (integer)UI::QueryWidget(`id(`table), `CurrentItem);
- map general_info = Pkg::SourceGeneralData(SrcID);
-
- // disable the source
- if (general_info["enabled"]:false)
- {
- Pkg::SourceSetEnabled(SrcID, false);
- }
-
selected_items = filter(integer i, selected_items, ``(SrcID!=i ));
UI::ChangeWidget(`id(`table), `Item(SrcID, 0) , "");
}
@@ -614,9 +594,17 @@
Report::Error(_("Select at least one source."));
continue;
}
+ integer base_source = ProductCreator::checkProductDependency();
- going_back = false;
-
+ // is the base source bootable?
+ if (!ProductCreator::isBootSource(base_source))
+ {
+ if (Popup::ContinueCancel("The selected installation source doesn't contain /boot directory.
+The created medium will not be bootable.\n"))
+ {
+ break;
+ }
+ }
break;
}
else if( ret == `back) {
@@ -631,82 +619,6 @@
return (symbol)ret;
}
- define symbol baseProductSelectionDialog()
- {
- if (size(ProductCreator::Config["sources"]:[]) == 1)
- {
- // there is just one repository, we can skip this dialog
- y2milestone("Only one repository selected, skipping base repository selection");
-
- // remove the option if it exists
- if (haskey (ProductCreator::Config, "base_repo"))
- ProductCreator::Config = remove(ProductCreator::Config, "base_repo");
- return going_back ? `back : `next;
- }
-
- /* dialog caption */
- string caption = _("Base Source Selection");
-
- integer default_base = ProductCreator::Config["base_repo"]:-1;
-
- if (default_base < 0)
- {
- y2milestone("The base repository is unknown, proposing...");
- default_base = ProductCreator::checkProductDependency();
- }
-
- string default_url = Pkg::SourceGeneralData(default_base)["url"]:"";
-
- list<term> items = [];
-
- foreach(string srcurl, ProductCreator::Config["sources"]:[],
- {
- items = add(items, `item(srcurl, srcurl == default_url));
- }
- );
-
- term contents = `SelectionBox(`id(`base_selection), _("Selected Base Source"), items);
-
- Wizard::SetContentsButtons(caption, contents, HELPS["baseSelection"]:"",
- Label::BackButton(), Label::NextButton());
-
- symbol ret = `again;
- string base = "";
-
- while(!contains([`next, `back, `abort], ret))
- {
- ret = (symbol)UI::UserInput();
-
- if (ret == `next)
- {
- // get the selected source
- base = (string)UI::QueryWidget(`id(`base_selection), `CurrentItem);
- y2internal("Selected base product: %1", base);
-
- integer base_src_id = ProductCreator::UrlToId([base])[0]:-1;
-
- // is the base source bootable?
- if (!ProductCreator::isBootSource(base_src_id))
- {
- y2warning("Selected base product is not bootable");
-
- if (!Popup::ContinueCancel("The selected base repository doesn't contain /boot directory.
-The created medium will not be bootable.\n"))
- {
- ret = `again;
- }
- }
- }
- }
-
- if (ret == `next)
- {
- ProductCreator::Config["base_repo"] = base;
- }
-
- return ret;
- }
-
/**
* Configure3 dialog
* @return dialog result
@@ -714,7 +626,7 @@
define symbol isolinuxDialog () ``{
/* dialog caption */
- string caption = _("Product Creator Configuration");
+ string caption = _("CD Creator Configuration");
string isolinux = ProductCreator::Readisolinux();
@@ -857,6 +769,8 @@
**/
symbol detailedSelection( symbol mode )
{
+ Pkg::SaveState();
+
// Open empty dialog for instant feedback
UI::OpenDialog(`opt(`defaultsize),
@@ -869,14 +783,19 @@
// while the package manager is initialized
UI::ReplaceWidget(`rep,
mode == nil ?
- `PackageSelector(`id(`packages )) :
- `PackageSelector(`id(`packages ), `opt(mode))
+ `PackageSelector(`id(`packages ), StorageDevices::FloppyDevice ) :
+ `PackageSelector(`id(`packages ), `opt(mode), StorageDevices::FloppyDevice )
);
symbol result = (symbol) UI::RunPkgSelection(`id(`packages ) );
UI::CloseDialog();
y2milestone( "Package selector returned %1", result );
+ if (result == `accept)
+ Pkg::ClearSaveState();
+ else
+ Pkg::RestoreState(false);
+
return result;
}
@@ -954,9 +873,6 @@
any ret = nil;
- Pkg::ResolvableNeutral ("", `package, true);
- Pkg::ResolvableNeutral ("", `pattern, true);
-
// set a mount point - there is no use to display DU of the current system
Pkg::TargetInitDU([ $[ "name" : "/",
"free" : ProductCreator::max_size_mb * 1024,
@@ -1004,9 +920,6 @@
list<string> addons = patterns;
- // ensure that a langugage is selected
- ProductCreator::CheckLanguage();
-
if (size(addons) > 0 || ProductCreator::Config["base"]:"" != "")
{
y2milestone("base pattern: %1, addons: %2", base_pattern, addons);
@@ -1219,17 +1132,7 @@
}
else
{
- // do not return patterns selected by dependencies
- foreach (map pat, Pkg::ResolvableProperties ("", `pattern, ""),
- {
- if (pat["status"]:`none == `selected)
- {
- y2milestone ("pat %1 selected by %2" , pat["name"]:"",
- pat["transact_by"]:nil);
- if (pat["transact_by"]:nil != `solver)
- seladd = add (seladd, pat["name"]:"");
- }
- });
+ seladd = Pkg::GetPatterns(`selected, "");
selbase = Pkg::GetPatterns(`selected, "base");
}
}
@@ -1363,7 +1266,7 @@
// "validate_help" : _("Select a gpg key in the table. Create...")
"help" : _("<p><big><b>Sign</b></big><br>
To make it possible for users to verify your product, sign it with a GPG key.
-This key is checked when the product is added as a repository.</p>")
+This key is checked when the product is added as an installation source.</p>")
]
];
}
@@ -1438,24 +1341,10 @@
// summary caption
summary = Summary::AddHeader(summary,_("Output Directory"));
- if (ProductCreator::Config["result"]:"tree" == "iso")
- {
- summary = Summary::AddLine (summary,
- // summary line (%1/%2 is file path)
- sformat (_("Creating ISO image %1/%2"),
- ProductCreator::Config["iso-directory"]:"",
- ProductCreator::Config["isofile"]:"")
- );
- }
- else
- {
- summary = Summary::AddLine (summary,
- // summary line (%1/%2 is file path)
- sformat(_("Creating directory tree in <b> %1/%2 </b>"),
+ // summary line
+ summary = Summary::AddLine(summary,sformat(_("Creating directory tree in <b> %1/%2 </b>"),
ProductCreator::Config["iso-directory"]:"",
- ProductCreator::Config["name"]:"")
- );
- }
+ ProductCreator::Config["name"]:"") );
// header in the summary dialog
@@ -1487,7 +1376,7 @@
else
{
// summary text
- summary = Summary::AddLine(summary, _("The medium will not be digitally signed"));
+ summary = Summary::AddLine(summary, _("The medium will not be digitally signed."));
}
term contents =
Modified: branches/tmp/jsuchome/product-creator/src/kiwi_dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/kiwi_dialogs.ycp?rev=49375&r1=49374&r2=49375&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/kiwi_dialogs.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/kiwi_dialogs.ycp Thu Jul 24 10:59:35 2008
@@ -915,11 +915,32 @@
if (haskey (KiwiConfig, "type"))
KiwiConfig = remove (KiwiConfig, "type");
KiwiConfig = (map) union (KiwiConfig, read_config);
- // for new configuration, do not read all from the template
+ // do not read everything from the template, use the data defined in
+ // Product Creator
y2milestone ("product-creator based configuration...");
- foreach (string key, ["addons", "packages", "sources"], {
- KiwiConfig[key] = ProductCreator::Config[key]:[];
+
+ KiwiConfig["sources"] = ProductCreator::Config["sources"]:[];
+
+ // find the set with 'image' packages
+ integer index = 0;
+ integer i = -1;
+ foreach (map set, (list<map>) KiwiConfig["packages"]:[], {
+ i = i + 1;
+ if (set["type"]:"" == "image")
+ {
+ index = i;
+ break;
+ }
});
+ map sw_contents = KiwiConfig["packages",index]:$[];
+ sw_contents["opensusePattern"] = maplist (string name,
+ ProductCreator::Config["addons"]:[], ``($[ "name" : name]));
+ sw_contents["package"] = maplist (string name,
+ ProductCreator::Config["packages"]:[], ``($[ "name" : name]));
+ sw_contents["ignore"] = maplist (string name,
+ ProductCreator::Config["taboo"]:[], ``($[ "name" : name]));
+
+ KiwiConfig["packages",index] = sw_contents;
KiwiConfig["name"] = ProductCreator::Config["name"]:"";
}
else
Modified: branches/tmp/jsuchome/product-creator/src/product-creator.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/product-creator.ycp?rev=49375&r1=49374&r2=49375&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/product-creator.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/product-creator.ycp Thu Jul 24 10:59:35 2008
@@ -29,7 +29,7 @@
map cmdline_description = $[
"id" : "product-creator",
// transltors: command line help text for the Xproduct-creator module
- "help" : _("Configuration of Product creator"),
+ "help" : _("Configuration of CD creator"),
"guihandler" : ProductCreatorSequence,
"initialize" : ProductCreator::Read,
"finish" : ProductCreator::Write,
@@ -83,7 +83,7 @@
],
"configfile" : $[
// cmd line help text for the 'configfile' option, %1 is a file name
- "help" : sformat(_("Path to the configuration file (default is %1)"),
+ "help" : sformat(_("Path to the configuration file (default is %1"),
ProductCreator::ConfigFile),
"type" : "string"
],
Modified: branches/tmp/jsuchome/product-creator/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/src/wizards.ycp?rev=49375&r1=49374&r2=49375&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/src/wizards.ycp (original)
+++ branches/tmp/jsuchome/product-creator/src/wizards.ycp Thu Jul 24 10:59:35 2008
@@ -17,6 +17,7 @@
import "Package";
import "PackageCallbacksInit";
import "Sequencer";
+import "URL";
include "product-creator/complex.ycp";
include "product-creator/dialogs.ycp";
@@ -32,7 +33,6 @@
map aliases = $[
"source" : ``( sourceDialog() ),
- "base" : ``( baseProductSelectionDialog() ),
"config1" : ``( Configure1Dialog() ),
"config2" : ``( Configure2Dialog() ),
"isolinuxcheck" : [ ``( CheckBootableSrc() ), true],
@@ -48,10 +48,6 @@
"ws_start" : "config1",
"source" : $[
`abort : `abort,
- `next : "base"
- ],
- "base" : $[
- `abort : `abort,
`next : "config2"
],
"config1" : $[
@@ -138,6 +134,27 @@
symbol InitSources () {
ProductCreator::EnableSource();
+
+ // remove the source types unsupported by kiwi (#339110)
+ list<string> sources = [];
+ list<string> removed = [];
+ foreach (string url, ProductCreator::Config["sources"]:[], {
+ map parsed = URL::Parse(url);
+ if (contains (Kiwi::unsupported_schemes, parsed["scheme"]:""))
+ removed = add (removed, url);
+ else
+ sources = add (sources, url);
+ });
+ ProductCreator::Config["sources"] = sources;
+ if (removed != [])
+ {
+ // message popup, %1 is a \n separated list
+ Popup::Message (sformat (_("These installation sources are not supported by kiwi:
+
+%1.
+
+They were removed from the current configuration."), mergestring (removed, "\n")));
+ }
return `next;
}
@@ -300,17 +317,8 @@
Wizard::CreateDialog();
Wizard::SetDesktopIcon("cd-creator");
- list<string> required_packages = ["inst-source-utils", "mkisofs", "createrepo"];
-
- // add PPC specific packages
- if (Arch::architecture() == "ppc" || Arch::architecture() == "ppc64")
- {
- // /bin/objcopy - binutils
- // /bin/mkzimage - lilo
- required_packages = (list<string>)union(required_packages, ["binutils", "lilo"]);
- }
-
- if (!Package::InstallAll(required_packages))
+ // .content_file agent is in yast2-instserver package - TODO: move it to yast2.rpm
+ if (!Package::InstallAll(["inst-source-utils", "mkisofs", "yast2-instserver"]))
{
Popup::Error(_("Installation of required packages
failed."));
Modified: branches/tmp/jsuchome/product-creator/yast2-product-creator.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsuchome/product-creator/yast2-product-creator.spec.in?rev=49375&r1=49374&r2=49375&view=diff
==============================================================================
--- branches/tmp/jsuchome/product-creator/yast2-product-creator.spec.in (original)
+++ branches/tmp/jsuchome/product-creator/yast2-product-creator.spec.in Thu Jul 24 10:59:35 2008
@@ -13,9 +13,6 @@
# for ag_kiwi
Requires: perl-XML-LibXML
-# for ag_contentfile
-Requires: yast2-instserver
-
# GPG.ycp and GPGWidgets.ycp
Requires: yast2 >= 2.13.90
BuildRequires: yast2 >= 2.13.90
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org