[yast-commit] r44537 - in /trunk/add-on-creator: ./ package/ src/
![](https://seccdn.libravatar.org/avatar/ccabc6c04379b11d036b089b67199614.jpg?s=120&d=mm&r=g)
Author: jsuchome Date: Fri Feb 15 16:27:21 2008 New Revision: 44537 URL: http://svn.opensuse.org/viewcvs/yast?rev=44537&view=rev Log: - new summary screen with the list of already configured add-ons - CLI support for handling of saved configurations - removed add-on-creator_auto.ycp and add-on-creator_proposal.ycp - 2.16.4 Removed: trunk/add-on-creator/src/add-on-creator_auto.ycp trunk/add-on-creator/src/add-on-creator_proposal.ycp Modified: trunk/add-on-creator/VERSION trunk/add-on-creator/package/yast2-add-on-creator.changes trunk/add-on-creator/src/AddOnCreator.ycp trunk/add-on-creator/src/Makefile.am trunk/add-on-creator/src/add-on-creator.ycp trunk/add-on-creator/src/complex.ycp trunk/add-on-creator/src/dialogs.ycp trunk/add-on-creator/src/helps.ycp trunk/add-on-creator/src/patterns.ycp trunk/add-on-creator/src/wizards.ycp Modified: trunk/add-on-creator/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/VERSION?rev=44537&r1=44536&r2=44537&view=diff ============================================================================== --- trunk/add-on-creator/VERSION (original) +++ trunk/add-on-creator/VERSION Fri Feb 15 16:27:21 2008 @@ -1 +1 @@ -2.16.3 +2.16.4 Modified: trunk/add-on-creator/package/yast2-add-on-creator.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/package/yast2-add-on-creator.changes?rev=44537&r1=44536&r2=44537&view=diff ============================================================================== --- trunk/add-on-creator/package/yast2-add-on-creator.changes (original) +++ trunk/add-on-creator/package/yast2-add-on-creator.changes Fri Feb 15 16:27:21 2008 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Wed Feb 13 16:16:08 CET 2008 - jsuchome@suse.cz + +- new summary screen with the list of already configured add-ons +- CLI support for handling of saved configurations +- removed add-on-creator_auto.ycp and add-on-creator_proposal.ycp +- 2.16.4 + +------------------------------------------------------------------- Tue Dec 11 10:30:10 CET 2007 - jsuchome@suse.cz - added suport for PATTERNS and SHORTLABEL tags in content (F302398) Modified: trunk/add-on-creator/src/AddOnCreator.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/src/AddOnCreator.ycp?rev=44537&r1=44536&r2=44537&view=diff ============================================================================== --- trunk/add-on-creator/src/AddOnCreator.ycp (original) +++ trunk/add-on-creator/src/AddOnCreator.ycp Fri Feb 15 16:27:21 2008 @@ -48,8 +48,85 @@ import "Report"; import "String"; +/** + * where the configurations are stored + */ +string add_on_products_file = Directory::vardir +"/add_on_products.ycp"; + +/** + * list of all configured AddOn products + */ +global list<map> add_on_products = []; + +/** + * map of the Add-On product currently in use + */ +global map current_product = $[ + // path to output directory + "base_output_path" : "", + // path to directory with RPM's + "rpm_path" : nil, + // path to directory with RPM's, used only for building patterns + // and not present on AddOn + "required_rpm_path" : "", + // map of patterns for current product + "patterns" : $[], + // description of packages (initially generated by create_package_descr + "packages_descr" : $[], + // the contents of products files + "products_files" : [], + // the contents of media files + "media_files" : [], + // the contents of patches files + "patches_files" : [], + // the contents of info.txt file + "info" : "", + // content of readme files + "readme_files" : $[ + "README" : "" + ], + // content of license files (in media.1 dir) + "license_files" : $[ + "license" : "" + ], + "copying_files" : $[ + "COPYING" : "" + ], + "copyright_files" : $[ + "COPYRIGHT" : "" + ], + // the contents of EXTRA_PROV file + "extra_prov" : "", + // path to the file with EXTRA_PROV data + "extra_prov_file" : "", + // the contents of nextmedia file + "nextmedia" : "", + // paths with packages to be archived in y2update.tgz + "y2update_packages" : [], + // path with y2update.tgz (alternative to y2update_packages) + "y2update_path" : "", + // path to file with installation workflow (installation.xml) + "workflow_path" : "", + // if iso image should be created from the final Add-On + "iso" : false, + // where the iso image should be put + "iso_path" : "", + // name of the iso image file + "iso_name" : "", + // also sign all rpm's (see bug #287447) + "resign_packages" : false, + // current GPG key + "gpg_key" : "", +]; + +// skeleton for current_product map (with keys and default values) +map current_product_skel = current_product; + +global integer selected_product = -1; -// variables from content file, + their description +/** + * variables from content file + their description + */ global list<map> content = []; global list<string> allowed_archs = [ "ppc", "ppc64", "ia64", "x86_64", "i686", "i586", "i486", "i386","noarch"]; @@ -452,9 +529,6 @@ // TODO add some key for sorting, so output file is readable ]; -// description of packages (initially generated by create_package_descr -global map<string,map> packages_descr = $[]; - // description of keys in package description files global map<string,map> description_descr = $[ "Pkg" : $[ @@ -526,46 +600,68 @@ } exit $stat"; -// just key:value mapping +// description of packages (initially generated by create_package_descr +//global map<string,map> packages_descr = $[]; + +// just key:value mapping based on content list global map<string,string> content_map = $[]; -global map<string,map> patterns = $[]; +//global map<string,map> patterns = $[]; // path to directory with RPM's -global string rpm_path = nil; +//global string rpm_path = nil; // path to directory with RPM's, used only for building patterns // and not present on AddOn -global string required_rpm_path = ""; +//global string required_rpm_path = ""; + +/** + * if we have 'source add-on' to base the new one on + */ +global boolean clone = false; -// path to directory with existing product +/** + * path to directory with existing product (which is being cloned) + */ global string import_path = ""; +/** + * if the descriptions of packages should be generated + * (false have only sense when cloning where they could be read from + * description files of cloned product) + */ +global boolean generate_descriptions = false; + +/** + * if final Add-On should be bootable (feature not implemented) + */ +global boolean bootable = false; + // text with license (in the root dir) -global string license = ""; +//global string license = ""; // the contents of products files -global list<string> products_files = []; +//global list<string> products_files = []; // the contents of media files -global list<string> media_files = []; +//global list<string> media_files = []; // the contents of patches files -global list<string> patches_files = []; +//global list<string> patches_files = []; // the contents of info.txt file -global string info = ""; +//global string info = ""; // the contents of EXTRA_PROV file -global string extra_prov = ""; +//global string extra_prov = ""; // path to the file with EXTRA_PROV data -global string extra_prov_file = ""; +//global string extra_prov_file = ""; // the contents of nextmedia file -global string nextmedia = ""; +//global string nextmedia = ""; -// content of readme files +/* content of readme files global map<string,string> readme_files = $[ "README" : "" ]; @@ -582,28 +678,26 @@ global map<string,string> copyright_files = $[ "COPYRIGHT" : "" ]; +*/ // paths with packages to be archived in y2update.tgz -global list<string> y2update_packages = []; +//global list<string> y2update_packages = []; // path with y2update.tgz (alternative to y2update_packages) -global string y2update_path = ""; +//global string y2update_path = ""; // path to file with installation workflow (installation.xml) -global string workflow_path = ""; - -// if the descriptions of packages should be generated -// (false have only sense when cloning) -global boolean generate_descriptions = false; +//global string workflow_path = ""; // if iso image should be created from the final Add-On -global boolean iso = false; +//global boolean iso = false; -// if final Add-On should be bootable -global boolean bootable = false; +// where the iso image should be put +//global string iso_path = ""; + +// name of the iso image file +//global string iso_name = ""; -// if we have 'source add-on' to base the target one on -global boolean clone = false; // tmp directory string tmpdir = ""; @@ -620,19 +714,11 @@ // full path to data directory string full_data_path = ""; -// path to output directory -global string base_output_path = ""; - -// where the iso image should be put -global string iso_path = ""; - -// name of the iso image file -global string iso_name = ""; - -global string gpg_key = ""; +// current GPG key +//global string gpg_key = ""; -// passphrase to unlock secret key -global string passphrase = ""; +// passphrases to unlock secret key (mapping GPG key:pass) +global map passphrases = $[]; global list<string> gpg_keys = []; @@ -649,7 +735,7 @@ global boolean only_sign_product = false; // also sign all rpm's (see bug #287447) -global boolean resign_packages = false; +//global boolean resign_packages = false; /** * Data was modified? @@ -678,6 +764,22 @@ "with_country" : nil, ]; +/** + * Take list of content-file data and update global content_map. + * If argument is empty, global 'content' list is used as an input. + */ +global map<string,string> UpdateContentMap (list<map> content_list) { + + if (content_list == nil || content_list == []) + content_list = content; + foreach (map entry, content_list, { + if (entry["value"]:"" != "") + content_map[entry["key"]:""] = entry["value"]:""; + }); + return content_map; +} + + // return list of language codes, optionally together with country code global list<string> GetLangCodes (boolean country) { @@ -757,7 +859,23 @@ return false; gpg_keys = read_secret_keys (); - gpg_key = gpg_keys[0]:""; + + // Read the info of configured AddOns + if (FileUtils::Exists (add_on_products_file)) + { + list<map> all_products = (list<map>) + SCR::Read (.target.ycp, add_on_products_file); + if (all_products != nil) + { + add_on_products = maplist (map product, all_products, { + return product; + }); + } + } + else + { + current_product["gpg_key"] = gpg_keys[0]:""; + } // fill uninitialized values in content descriptions integer i = 0; @@ -914,13 +1032,15 @@ content = ReadContentFile (dir_path + "/content"); - rpm_path = sformat("%1/%2", dir_path, content_map["DATADIR"]:""); + current_product["rpm_path"] = + sformat("%1/%2", dir_path, content_map["DATADIR"]:""); // - read patterns string descr_path = sformat ("%1/%2", dir_path, content_map["DESCRDIR"]:""); map out = (map) SCR::Execute (.target.bash_output, sformat ("ls -A1 %1/*.pat %1/*.pat.gz 2>/dev/null", descr_path)); + map patterns = $[]; foreach (string f, splitstring(out["stdout"]:"", "\n"), { if (f == "") return; map pat = ReadPatternFile (f); @@ -938,6 +1058,7 @@ } } }); + current_product["patterns"] = patterns; if (!generate_descriptions) { @@ -946,6 +1067,16 @@ SCR::Execute (.target.bash, sformat ("/bin/cp %1/packages* %2", descr_path, tmpdir)); } + string extra = descr_path + "/EXTRA_PROV"; + if (FileUtils::Exists (extra)) + { + string cont = (string) SCR::Read (.target.string, extra); + if (cont != nil) + { + current_product["extra_prov"] = cont; + current_product["extra_prov_file"] = extra; + } + } // read README foreach (string readme, ["README", "README.DOS", "LIESMICH","LIESMICH.DOS"], @@ -954,7 +1085,9 @@ if (FileUtils::Exists (readme_path)) { y2milestone ("Importing readme file '%1'", readme_path); - readme_files[readme]=(string)SCR::Read(.target.string, readme_path); + string cont = (string) SCR::Read(.target.string, readme_path); + if (cont != nil) + current_product["readme_files", readme] = cont; } }); @@ -999,7 +1132,9 @@ if (issubstring (name, ".txt")) name = regexpsub (name, "^(.*)\.txt$", "\\1"); y2milestone ("Importing license file '%1'", f); - license_files[name] = (string) SCR::Read (.target.string, f); + string cont = (string) SCR::Read (.target.string, f); + if (cont != nil) + current_product["license_files", name] = cont; }); } @@ -1009,7 +1144,9 @@ if (f == "") return; string name = substring (f, findlastof (f, "/") + 1); y2milestone ("Importing COPYING file '%1'", f); - copying_files[name] = (string) SCR::Read (.target.string, f); + string cont = (string) SCR::Read (.target.string, f); + if (cont != nil) + current_product["copying_files",name] = cont; }); out = (map) SCR::Execute (.target.bash_output, @@ -1018,7 +1155,9 @@ if (f == "") return; string name = substring (f, findlastof (f, "/") + 1); y2milestone ("Importing COPYRIGHT file '%1'", f); - copyright_files[name] = (string) SCR::Read (.target.string, f); + string cont = (string) SCR::Read (.target.string, f); + if (cont != nil) + current_product["copyright_files",name] = cont; }); // FIXME autorun @@ -1027,8 +1166,9 @@ string info_path = dir_path + "/media.1/info.txt"; if (FileUtils::Exists (info_path)) { - info = (string) SCR::Read (.target.string, info_path); + string info = (string) SCR::Read (.target.string, info_path); if (info == nil) info = ""; + current_product["info"] = info; } // read the content of media.n dirs @@ -1036,9 +1176,9 @@ sformat ("ls -A1 -d %1/media.* 2>/dev/null", dir_path)); if (out["stdout"]:"" != "") { - products_files = []; - media_files = []; - patches_files = []; + list<string> products_files = []; + list<string> media_files = []; + list<string> patches_files = []; foreach (string d, splitstring(out["stdout"]:"", "\n"), { if (d == "") return; string products_path = d + "/products"; @@ -1066,18 +1206,21 @@ } else patches_files = add (patches_files, ""); }); + current_product["products_files"] = products_files; + current_product["media_files"] = media_files; + current_product["patches_files"] = patches_files; } string desc_path = dir_path + "/installation.xml"; if (FileUtils::Exists (desc_path)) { - workflow_path = desc_path; + current_product["workflow_path"] = desc_path; } string workflow_packages_path = dir_path + "/y2update.tgz"; if (FileUtils::Exists (workflow_packages_path)) { - y2update_path = workflow_packages_path; + current_product["y2update_path"] = workflow_packages_path; } return true; @@ -1118,7 +1261,50 @@ // TODO change name... global void FillContentDefaults () { + // AddOnCreator Build dialog caption + string caption = _("Generating Product Data"); + + list stages = [ + // Progress stage + _("Find package directories"), + ]; + list steps = [ + // Progress step + _("Looking for package directories..."), + ]; + if (!clone) + { + stages = union (stages, [ + // Progress stage + _("Check package architectures"), + // Progress stage + _("Generate content file defaults"), + ]); + steps = union (steps, [ + // Progress step + _("Checking package architectures..."), + // Progress step + _("Generating content file defaults..."), + ]); + } + stages = union (stages, [ + // Progress stage + _("Generate package descriptions"), + ]); + steps = union (steps, [ + // Progress step + _("Generate package descriptions"), + ]); + + Progress::New (caption, " ", size (stages), + (list<string>) stages, (list<string>) steps, + // help text + _("<b>Generating data for Add-On</b><br> +Please wait...")); + + Progress::NextStage(); map<string,string> arch_map = $[]; + string rpm_path = current_product["rpm_path"]:""; // 1. set the values for ARCH.* string cmd = sformat ("cd %1; find -maxdepth 1 -type d", rpm_path); @@ -1136,6 +1322,8 @@ arch_directories = add (arch_directories, arch_dir); } }); + Progress::NextStage(); + if (!clone) { // 2. get the list of architectures from RPM's @@ -1169,6 +1357,7 @@ } }); y2milestone ("... done"); + Progress::NextStage(); // 3. add 'guessed' ARCH.base values to the content file if (content_map != $[] || arch_map != $[]) @@ -1186,7 +1375,7 @@ content = add (content, arch_skel); }); } - + string required_rpm_path = current_product["required_rpm_path"]:""; // 4. read the list of packages, not present on AddOn if (required_rpm_path != "" && required_rpm_path != rpm_path) { @@ -1206,8 +1395,13 @@ string name, splitstring (output, "\n"), ``(name != ""))); y2milestone ("... done"); } + Progress::NextStage(); + } + if (rpm_path == "") + { + Progress::Finish (); + return; } - if (rpm_path == "") return; // generate tmp package descriptions... // TODO move to other function? @@ -1223,6 +1417,7 @@ out = (map) SCR::Execute (.target.bash_output, sformat ("ls -A1 %1/packages.* 2>/dev/null", tmpdir)); string lang = "en"; + map packages_descr = current_product["packages_descr"]:$[]; foreach (string file, splitstring (out["stdout"]:"", "\n"), { list f = splitstring (file, "."); lang = f[size(f)-1]:"en"; @@ -1233,8 +1428,22 @@ else return; } if (file == "" || lang == "DU") return; - packages_descr[lang] = ReadPackagesFile (file); + if (packages_descr[lang]:$[] == $[]) + { + packages_descr[lang] = ReadPackagesFile (file); + return; + } + // now, we need to merge old data from packages_descr with currently + // generated ones (TODO this works only for packages.en) + foreach (string p, map d, (map<string,map>) ReadPackagesFile (file), { + if (!haskey (packages_descr[lang]:$[], p)) + { + y2debug ("new package %1", d); + packages_descr[lang,p] = d; + } + }); }); + current_product["packages_descr"] = packages_descr; // we need the list of packages (for patterns), but asking // rpm would be slow, so let's get it from (already existing) descriptions @@ -1248,19 +1457,7 @@ available_packages[arch] = add (available_packages[arch]:[], p); }); } - -} - -/** - * Update content_map with current value of 'content' list - */ -global map<string,string> UpdateContentMap () { - - foreach (map entry, content, { - if (entry["value"]:"" != "") - content_map[entry["key"]:""] = entry["value"]:""; - }); - return content_map; + Progress::NextStage(); } /** @@ -1398,10 +1595,11 @@ SCR::Execute (.target.bash, cmd, $["LANG":"C"]); } - + /* 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); @@ -1511,6 +1709,15 @@ return true; } +// write info.txt file +global boolean WriteInfoFile (string info_dir, string info) { + + if (info != "" && info != nil) + SCR::Write (.target.string, info_dir + "/info.txt", info); + return true; +} + + /** * Write the text of available licenses to correct places * @path descr_path full path to directory with package descriptions (DESCRDIR) @@ -1583,7 +1790,7 @@ boolean ret = true; list<string> names = []; - foreach (string name, map pattern, patterns, { + foreach (string name, map pattern, current_product["patterns"]:$[], { string filename = CreatePatternFullName (pattern, true); if (filename == "") return; @@ -1771,9 +1978,10 @@ SCR::Execute (.target.bash, sformat("cp %1/* '%2/'", full_descr_path, descr_path)); - if (workflow_path != "") + if (current_product["workflow_path"]:"" != "") SCR::Execute (.target.bash, sformat("cp '%1/installation.xml' '%2/'", base_path, spdir)); + if (FileUtils::Exists (base_path + "/y2update.tgz")) SCR::Execute (.target.bash, sformat("cp '%1/y2update.tgz' '%2'", base_path, spdir)); @@ -1861,29 +2069,39 @@ /** * Report the error with failed gpg and ask for possible new * entering of pw - * @string error message from gpg + * @param string message from gpg + * @param boolean if we are asking because of signing failure */ -string AskForPassphrase (string error) { +string AskForPassphrase (string message, boolean failure) { string pw = nil; - UI::OpenDialog (`opt(`decorated), `HBox (`HSpacing (0.5), - `VBox ( - `HSpacing (70), - // error label - `Label (_("Signing of the product failed.")), - error == "" ? `VSpacing (0) : `RichText (mergestring (splitstring ( - String::EscapeTags (error),"\n"),"<br>")), - `HBox ( + term info_term = failure ? `VBox ( + `HSpacing (70), + // error label + `Label (_("Signing of the product failed.")), + message == "" ? + `VSpacing (0) : + `RichText (mergestring (splitstring ( + String::EscapeTags (message),"\n"),"<br>") + ) + ) : `VSpacing (); + term input_term = failure ? `HBox ( `CheckBox (`id (`again), `opt (`notify), // checkbox label _("Try again with different passphrase")), `Password (`id (`pw1), "") - ), + ) : `VBox ( + `Password (`id (`pw1), message) + ); + UI::OpenDialog (`opt(`decorated), `HBox (`HSpacing (0.5), + `VBox ( + info_term, + input_term, `PushButton (`id(`ok),`opt(`key_F10), Label::OKButton()), `VSpacing (0.5) ), `HSpacing (0.5)) ); - UI::ChangeWidget (`id (`pw1), `Enabled, false); + UI::ChangeWidget (`id (`pw1), `Enabled, !failure); any ret = `cancel; repeat @@ -1912,9 +2130,10 @@ */ global boolean SignAddOn (string base_path, string key) { + string passphrase = passphrases[key]:""; if (key == "" || passphrase == "") { - y2warning ("No GPG key provided - signing skipped"); + y2warning ("No GPG key or passphrase provided - signing skipped"); return true; } @@ -1961,7 +2180,7 @@ Report::Error (out["stderr"]:""); else { - passphrase = AskForPassphrase (out["stderr"]:""); + passphrase = AskForPassphrase (out["stderr"]:"", true); if (passphrase != nil) { SCR::Write (.target.string, pw_path, passphrase); @@ -1978,7 +2197,7 @@ sformat("gpg --export -a %1 > '%2/content.key'",local_key, base_path)); // sign the packages - if (resign_packages) + if (current_product["resign_packages"]:false) { string expect = tmpdir + "/sign.ex"; SCR::Write (.target.string, expect, @@ -2033,7 +2252,7 @@ */ global boolean CreateISOImage (string dir_path, string iso_p, string name) { - if (!iso) return true; + if (!current_product["iso"]:false) return true; if (!FileUtils::Exists (dir_path) || !FileUtils::Exists (iso_p)) return false; @@ -2043,7 +2262,7 @@ content_map["DISTVERSION"]:"", content_map["DEFAULTBASE"]:""); if (!issubstring (name, ".iso")) name = name + ".iso"; - iso_name = name; + current_product["iso_name"] = name; // ?? // possible options -allow-leading-dots string cmd = sformat("mkisofs -r -J -l -o '%1/%2' '%3'",iso_p, name, dir_path); @@ -2055,14 +2274,120 @@ return true; } +/** + * Reset all settings related to current product + */ +global void ResetCurrentProduct () { + + current_product = current_product_skel; + generate_descriptions = false; + clone = false; + + available_packages = $[]; + package2filename = $[]; + srcpackage2filename = $[]; + + // TODO move into current_product as well? + content = []; + content_map = $[]; + + // reset global variables, that are generated for each product + full_media_paths = []; + full_descr_path = ""; + full_data_path = ""; +} + +// save the data with current configuration into global list +global void CommitCurrentProduct () { + + map modified_product = union (current_product, $[ + "content_map" : content_map, + "available_packages" : available_packages, + "arch_directories" : arch_directories, + "package2filename" : package2filename, + "srcpackage2filename" : srcpackage2filename, + "generated" : true,// Commit is after everything was entered + ]); + if (selected_product == -1) + add_on_products = add (add_on_products, modified_product); + else + { + integer i = -1; + add_on_products = maplist (map product, add_on_products, { + i = i + 1; + return (i == selected_product) ? modified_product : product; + }); + } + ResetCurrentProduct (); + modified = true; +} + +global void SelectProduct (map product) { + + current_product = product; + content_map = product["content_map"]:$[]; + + // generate content from content_map + content = []; + foreach (string key, map entry, content_descr, { + if (content_map[key]:"" != "") + entry["value"] = content_map[key]:""; + content = add (content, entry); + }); + available_packages = product["available_packages"]:$[]; + arch_directories = product["arch_directories"]:[]; + package2filename = product["package2filename"]:$[]; + srcpackage2filename = product["srcpackage2filename"]:$[]; +} + +/** + * Write all AddOn products configurations + */ +global boolean Write () { + + add_on_products = maplist (map product, add_on_products, { + // these could be generated, no need to save... + foreach (string key, ["available_packages", "arch_directories", + "package2filename", "srcpackage2filename", "generated"], { + if (haskey (product, key)) + product = remove (product, key); + }); + return product; + }); + return SCR::Write (.target.ycp, add_on_products_file, add_on_products); +} + + +/** + * prepare the data of current product for a build + * (neccessary because input packages could get changed) + */ +global boolean PrepareBuild () { + + if (!current_product["generated"]:false) + { + FillContentDefaults (); + // TODO not everything generated by FillContentDefaults is needed? + } + string key = current_product["gpg_key"]:""; + if (current_product["ask_for_passphrase"]:false && + key != "" && passphrases[key]:"" == "" && !Mode::commandline ()) + { + // ask for pw now + passphrases[key] = AskForPassphrase ( + sformat (_("Passphrase for GPG key %1"), key), false); + } +} /** * Write all add-on-creator settings * @return true on success */ -global boolean Write() { +global boolean BuildAddOn () { - /* AddOnCreator read dialog caption */ + string base_output_path = current_product["base_output_path"]:""; + + // AddOnCreator Build dialog caption string caption = _("Creating the Add-On"); list<string> stages = [ @@ -2094,7 +2419,7 @@ _("Signing resulting product..."), ]; - if (iso) + if (current_product["iso"]:false) { // Progress stage stages = add (stages, _("Create ISO image")); @@ -2108,11 +2433,12 @@ Progress::NextStage(); - if (iso) + if (current_product["iso"]:false) { + string iso_path = current_product["iso_path"]:""; if (iso_path == "") { - iso_path = base_output_path; + current_product["iso_path"] = base_output_path; if (!only_sign_product) { base_output_path= tmpdir + "/output"; @@ -2139,9 +2465,12 @@ 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, + current_product["readme_files"]:$[]); + WriteStringFiles (base_output_path, + current_product["copying_files"]:$[]); + WriteStringFiles (base_output_path, + current_product["copyright_files"]:$[]); Progress::NextStage(); @@ -2151,14 +2480,18 @@ Report::Error (_("Cannot create the output directory structure.")); } - WritePatchesFiles (base_output_path, patches_files); + WritePatchesFiles (base_output_path, + current_product["patches_files"]:[]); - WriteProductsFiles (base_output_path, products_files); + WriteProductsFiles (base_output_path, + current_product["products_files"]:[]); - WriteMediaFiles (base_output_path, media_files, nextmedia); + WriteMediaFiles (base_output_path, + current_product["media_files"]:[], + current_product["nextmedia"]:""); - if (info != "" && info != nil) - SCR::Write (.target.string, full_media_paths[0]:"" + "/info.txt", info); + WriteInfoFile (full_media_paths[0]:"", + current_product["info"]:""); Progress::NextStage(); @@ -2166,13 +2499,19 @@ Progress::NextStage(); - CopyRPMs (rpm_path, base_output_path); - - WritePackageDescriptions (full_descr_path, packages_descr); + CopyRPMs (current_product["rpm_path"]:"", base_output_path); - WriteLicensesFiles (full_descr_path, base_output_path, license_files); - - WriteWorkflow (base_output_path, workflow_path, y2update_packages, y2update_path); + WritePackageDescriptions ( + full_descr_path, + current_product["packages_descr"]:$[]); + + WriteLicensesFiles (full_descr_path, base_output_path, + current_product["license_files"]:$[]); + + WriteWorkflow (base_output_path, + current_product["workflow_path"]:"", + current_product["y2update_packages"]:[], + current_product["y2update_path"]:""); Progress::NextStage(); @@ -2183,21 +2522,25 @@ Progress::NextStage(); - if (!SignAddOn (base_output_path, gpg_key)) + if (!SignAddOn (base_output_path, current_product["gpg_key"]:"")) return false; WriteServicepackArchive (base_output_path); CreateDirectoryYaSTFiles (base_output_path); - if (iso) + if (current_product["iso"]:false) { Progress::NextStage(); - CreateISOImage (base_output_path, iso_path, iso_name); + CreateISOImage (base_output_path, + current_product["iso_path"]:"", + current_product["iso_name"]:""); } Progress::NextStage(); + ResetCurrentProduct (); + return true; } @@ -2206,13 +2549,8 @@ */ global map Export () { - return $[ - "base_output_path" : base_output_path, - "iso" : iso, - "iso_name" : iso_name, - "iso_path" : iso_path, - "product_path" : iso ? (iso_path + "/" + iso_name) : base_output_path, - ]; + y2warning ("not implemented"); + return $[]; } global boolean Import (map settings) { Modified: trunk/add-on-creator/src/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/src/Makefile.am?rev=44537&r1=44536&r2=44537&view=diff ============================================================================== --- trunk/add-on-creator/src/Makefile.am (original) +++ trunk/add-on-creator/src/Makefile.am Fri Feb 15 16:27:21 2008 @@ -3,8 +3,7 @@ yncludedir = @yncludedir@/add-on-creator client_DATA = \ - add-on-creator.ycp \ - add-on-creator_auto.ycp + add-on-creator.ycp ynclude_DATA = \ helps.ycp \ Modified: trunk/add-on-creator/src/add-on-creator.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/src/add-on-creator.ycp?rev=44537&r1=44536&r2=44537&view=diff ============================================================================== --- trunk/add-on-creator/src/add-on-creator.ycp (original) +++ trunk/add-on-creator/src/add-on-creator.ycp Fri Feb 15 16:27:21 2008 @@ -59,46 +59,56 @@ } // helper for parsing command line data regarding iso creation -void ParseISOData (map<string,any> options) { +map ParseISOData (map<string,any> options) { - AddOnCreator::iso = haskey (options, "create_iso"); + map current_product = $[]; + current_product["iso"] = haskey (options, "create_iso"); if (haskey (options, "iso_name")) { - AddOnCreator::iso = true; - AddOnCreator::iso_name = options["iso_name"]:""; + current_product["iso"] = true; + current_product["iso_name"] = options["iso_name"]:""; } if (haskey (options, "iso_output_dir")) { - AddOnCreator::iso = true; - AddOnCreator::iso_path = options["iso_output_dir"]:""; + current_product["iso"] = true; + current_product["iso_path"] = options["iso_output_dir"]:""; } + return current_product; } // helper for parsing command line data regarding product signing -void ParseGPGData (map<string,any> options) { +map ParseGPGData (map<string,any> 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")) + map current_product = $[]; + string key = options["gpg_key"]:""; + if (key != "") + current_product["gpg_key"] = key; + string passphrase = options["passphrase"]:""; + if (passphrase == "" && 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; + string pass = (string) SCR::Read (.target.string, file); + if (pass != nil) + passphrase = pass; } else { ReportMissingFile (file); } } - else - AddOnCreator::passphrase = + else if (passphrase == "" && key != "") + { + passphrase = // question on command line - CommandLine::PasswordInput(sformat (_("Passphrase for key %1:"),AddOnCreator::gpg_key)); - AddOnCreator::resign_packages = haskey (options, "resign_packages"); + CommandLine::PasswordInput (sformat (_("Passphrase for key %1:"), + current_product["gpg_key"]:"")); + } + AddOnCreator::passphrases[key] = passphrase; + current_product["ask_for_passphrase"] = true; + current_product["resign_packages"] = haskey (options, "resign_packages"); + return current_product; } /** @@ -106,6 +116,7 @@ */ boolean Create (map<string,any> options ) { + map current_product = AddOnCreator::current_product; if (!haskey (options, "output_dir")) { // error message @@ -113,7 +124,7 @@ return false; } else - AddOnCreator::base_output_path = options["output_dir"]:""; + current_product["base_output_path"] = options["output_dir"]:""; // now we can import different content file if it was provided if (haskey (options, "content")) @@ -125,7 +136,7 @@ if (content != nil) { AddOnCreator::content = content; - AddOnCreator::UpdateContentMap (); + AddOnCreator::UpdateContentMap (content); } } else @@ -143,6 +154,7 @@ // find all packages.langcode in dir and import them map out = (map) SCR::Execute (.target.bash_output, sformat ("ls -A1 %1/packages.* 2>/dev/null", dir)); + map packages_descr = current_product["packages_descr"]:$[]; foreach (string file, splitstring (out["stdout"]:"", "\n"), { list f = splitstring (file, "."); string lang = f[size(f)-1]:"en"; @@ -152,9 +164,9 @@ else return; } if (file == "" || lang == "DU") return; - AddOnCreator::packages_descr[lang] = - AddOnCreator::ReadPackagesFile (file); + packages_descr[lang] = AddOnCreator::ReadPackagesFile (file); }); + current_product["packages_descr"] = packages_descr; } else { @@ -169,6 +181,7 @@ // find all packages.langcode in dir and import them map out = (map) SCR::Execute (.target.bash_output, sformat ("ls -A1 %1/*.pat 2>/dev/null", dir)); + map patterns = $[]; foreach (string f, splitstring(out["stdout"]:"", "\n"), { if (f == "") return; map pat = AddOnCreator::ReadPatternFile (f); @@ -182,17 +195,18 @@ pat["version"] = pt[1]:""; pat["release"] = pt[2]:""; pat["arch"] = pt[3]:""; - AddOnCreator::patterns[name] = pat; + patterns[name] = pat; } } }); + current_product["patterns"] = patterns; } else { ReportMissingDir (dir); } } - ParseISOData (options); + current_product = union (current_product, ParseISOData (options)); if (haskey (options, "info")) { @@ -201,7 +215,7 @@ { string info = (string) SCR::Read (.target.string, file); if (info != nil) - AddOnCreator::info = info; + current_product["info"] = info; } else ReportMissingFile (file); @@ -213,7 +227,7 @@ { string extra = (string) SCR::Read (.target.string, file); if (extra != nil) - AddOnCreator::extra_prov = extra; + current_product["extra_prov"] = extra; } else ReportMissingFile (file); @@ -251,7 +265,9 @@ if (issubstring (name, ".txt")) name = regexpsub (name, "^(.*)\.txt$", "\\1"); y2milestone ("Importing license file '%1'", f); - AddOnCreator::license_files[name] = (string) SCR::Read (.target.string, f); + string cont = (string) SCR::Read (.target.string, f); + if (cont != nil) + current_product["license_files",name] = cont; }); } else @@ -265,7 +281,7 @@ string file = options["workflow"]:""; if (FileUtils::Exists (file)) { - AddOnCreator::workflow_path = file; + current_product["workflow_path"] = file; } else { @@ -278,7 +294,7 @@ string file = options["y2update"]:""; if (FileUtils::Exists (file)) { - AddOnCreator::y2update_path = file; + current_product["y2update_path"] = file; } else { @@ -292,8 +308,9 @@ { map out = (map) SCR::Execute (.target.bash_output, sformat ("ls -A1 %1/*.rpm 2>/dev/null", dir)); - AddOnCreator::y2update_packages = filter (string f, splitstring(out["stdout"]:"", "\n"), - ``(f != "")); + current_product["y2update_packages"] = filter ( + string f, splitstring(out["stdout"]:"", "\n"), ``(f != "") + ); } else { @@ -303,12 +320,16 @@ if (!haskey (options, "do_not_sign")) { - ParseGPGData (options); + current_product = union (current_product, ParseGPGData (options)); } - if (!FileUtils::Exists (AddOnCreator::base_output_path)) { - SCR::Execute (.target.mkdir, AddOnCreator::base_output_path); + if (!FileUtils::Exists (current_product["base_output_path"]:"")) { + SCR::Execute (.target.mkdir, current_product["base_output_path"]:""); } - return true; + AddOnCreator::current_product = current_product; + AddOnCreator::CommitCurrentProduct (); + if (haskey (options, "do_not_build")) + return true; + return AddOnCreator::BuildAddOn (); } /** @@ -326,7 +347,9 @@ } if (substring (rpm_dir, size (rpm_dir) - 1, 1) != "/") rpm_dir = rpm_dir + "/"; - AddOnCreator::rpm_path = rpm_dir; + AddOnCreator::current_product = $[ + "rpm_path" : rpm_dir + ]; if (!haskey (options, "content")) { // error message @@ -350,7 +373,8 @@ Report::Error (_("Path to existing Add-On is missing.")); return false; } - AddOnCreator::generate_descriptions = options["generate_descriptions"]:false; + AddOnCreator::generate_descriptions = + haskey (options, "generate_descriptions"); AddOnCreator::ImportExistingProduct (AddOnCreator::import_path); AddOnCreator::FillContentDefaults (); // TODO not necessary when content is provided? return Create (options); @@ -361,6 +385,7 @@ */ boolean SignAddOn (map<string,any> options) { + map current_product = AddOnCreator::current_product; AddOnCreator::only_sign_product = false; if (!haskey (options, "addon_dir")) { @@ -369,15 +394,112 @@ return false; } else - AddOnCreator::base_output_path = options["addon_dir"]:""; + current_product["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::ImportExistingProduct(current_product["base_output_path"]:""); AddOnCreator::FillContentDefaults (); - ParseGPGData (options); - ParseISOData (options); + current_product = union (current_product, ParseGPGData (options)); + current_product = union (current_product, ParseISOData (options)); AddOnCreator::only_sign_product = true; + AddOnCreator::current_product = current_product; + AddOnCreator::CommitCurrentProduct (); + return AddOnCreator::BuildAddOn (); +} + +/** + * Command line handler for listing existing Add-On configurations + */ +boolean ListAddOns (map<string,any> options) { + + list<map> add_on_products = AddOnCreator::add_on_products; + + integer i = 1; + foreach (map add_on, add_on_products, { + map cont = add_on["content_map"]:$[]; + // command line summary, %1 is order, %2 product name + CommandLine::Print (sformat (_("(%1) Product Name: %2"), + i, cont["PRODUCT"]:"")); + // command line summary + CommandLine::Print (sformat (_("\tVersion : %1"), cont["VERSION"]:"")); + // command line summary + CommandLine::Print (sformat (_("\tInput directory: %1"), + add_on["rpm_path"]:"")); + CommandLine::Print (sformat (_("\tOutput directory: %1"), + add_on["base_output_path"]:"")); + if (add_on["patterns"]:$[] != $[]) + // command line summary, %1 is comma-separated list + CommandLine::Print (sformat (_("\tPatterns: %1"), mergestring ( + maplist (string pat, map p, add_on["patterns"]:$[],``(pat)), + ", ")) + ); + i = i + 1; + }); + return false; // no write needed +} + +/** + * Command line handler for building new addon + */ +boolean BuildAddOnHandler (map<string,any> options) { + + list<map> add_on_products = AddOnCreator::add_on_products; + if (size (add_on_products) == 0) + { + // command line message, do not translate 'create', 'clone' + Report::Error (_("There is no Add-On Product configuration present. Create a new one using 'create' or 'clone' command.")); + return false; + } + integer number = options["number"]:0; + if (number < 1) + { + if (size (add_on_products) == 1) + number = 0; + else + { + // error message + Report::Error (_("Specify Add-On Product that should be built.")); + return false; + } + } + // !!! numbers are shown starting from 1, list is indexed from 0 !!! + map product = add_on_products[number - 1]:$[]; + + product = union (product, ParseISOData (options)); + // if the product should be signed (based on config) ParseGPGData should + // take care of asking for password + if (product["ask_for_passphrase"]:false && !haskey (options, "gpg_key")) + options["gpg_key"] = product["gpg_key"]:""; + product = union (product, ParseGPGData (options)); + + AddOnCreator::SelectProduct (product); + AddOnCreator::PrepareBuild (); + AddOnCreator::BuildAddOn (); + return false; // no write needed (configs were not modified) +} + +/** + * Command line handler for deleting addon config + */ +boolean DeleteAddOn (map<string,any> options) { + + list<map> add_on_products = AddOnCreator::add_on_products; + if (size (add_on_products) == 0) + { + // command line message + Report::Error (_("There is no Add-On Product configuration present.")); + return false; + } + integer number = options["number"]:0; + if (number < 1) + { + // error message + Report::Error (_("Specify Add-On Product configuration that should be deleted.")); + return false; + } + // !!! numbers are shown starting from 1, list is indexed from 0 !!! + AddOnCreator::add_on_products = remove (add_on_products, number - 1); return true; } @@ -392,18 +514,33 @@ "create" : $[ "handler" : CreateAddOn, // command line help text for 'create' action - "help" : _("Create new Add-On Product"), + "help" : _("Create and build new Add-On Product"), ], "clone" : $[ "handler" : CloneAddOn, - // command line help text for 'create' action - "help" : _("Create an Add-On Product based on an existing one"), + // command line help text for 'clone' action + "help" : _("Create and build new Add-On Product based on an existing one"), ], "sign" : $[ "handler" : SignAddOn, - // command line help text for 'create' action + // command line help text for 'sign' action "help" : _("Sign unsigned Add-On Product"), ], + "list" : $[ + "handler" : ListAddOns, + // command line help text for 'list' action + "help" : _("List available Add-On Product configurations"), + ], + "build" : $[ + "handler" : BuildAddOnHandler, + // command line help text for 'create' action + "help" : _("Build Add-On Product from selected configuration"), + ], + "delete" : $[ + "handler" : DeleteAddOn, + // command line help text for 'create' action + "help" : _("Delete selected Add-On Product configuration"), + ], ], "options" : $[ "rpm_dir" : $[ @@ -512,25 +649,43 @@ "help" : _("Path to directory with Add-On Product"), "type" : "string" ], + "do_not_build" : $[ + // command line help text for 'do_not_build' option + "help" : _("Do not build the product, only save new configuration"), + ], + "number" : $[ + // help text for 'number' option; do not translate 'list' + "help" : _("Number of selected Add-On (see 'list' command for product numbers)"), + "type" : "integer" + ], ], "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", "do_not_sign", "iso_output_dir", - "resign_packages", "info", "extra_prov" + "resign_packages", "info", "extra_prov", "do_not_build", ], "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", "do_not_sign", "iso_output_dir", - "resign_packages", "info", "extra_prov", + "resign_packages", "info", "extra_prov", "do_not_build", ], "sign" : [ "addon_dir", "gpg_key", "passphrase", "passphrase_file", "create_iso", "iso_name", "iso_output_dir", "resign_packages" ], + "build" : [ + "number", "gpg_key", "passphrase", "passphrase_file", + "resign_packages", "create_iso", "iso_name", "iso_output_dir", + ], + "delete" : [ + "number" + ], + "list" : [ + ], ] ]; Modified: trunk/add-on-creator/src/complex.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/src/complex.ycp?rev=44537&r1=44536&r2=44537&view=diff ============================================================================== --- trunk/add-on-creator/src/complex.ycp (original) +++ trunk/add-on-creator/src/complex.ycp Fri Feb 15 16:27:21 2008 @@ -41,6 +41,7 @@ import "String"; import "Summary"; import "Wizard"; +import "Wizard_hw"; include "add-on-creator/helps.ycp"; @@ -87,16 +88,166 @@ */ symbol WriteDialog() { Wizard::RestoreHelp(HELPS["write"]:""); - // AddOnCreator::AbortFunction = PollAbort; boolean ret = AddOnCreator::Write(); return ret ? `next : `abort; } /** - * The first dialog in the Add-On creating wizard + * Write settings dialog + * @return `abort if aborted and `next otherwise + */ +symbol BuildDialog() { + Wizard::RestoreHelp(HELPS["build"]:""); + boolean ret = AddOnCreator::BuildAddOn (); + return ret ? `next : `abort; +} + +/** + * Summary dialog with the list of all configured AddOn Products + */ +any SummaryDialog () { + + // dialog caption + string caption = _("Add-On Creator Configuration Overview"); + + list<map> add_on_products = AddOnCreator::add_on_products; + + list get_summary_items () { + integer i = -1; + return maplist (map add_on, add_on_products, { + map content_map = add_on["content_map"]:$[]; + i = i + 1; + return `item (`id (i), + content_map["PRODUCT"]:"", content_map["VERSION"]:""); + }); + } + list summary_items = get_summary_items (); + + // generate description of selected product + string get_description (map add_on) { + map content_map = add_on["content_map"]:$[]; + string ret = + // summary item + sformat (_("Input directory: %1<br>"), add_on["rpm_path"]:"") + + // summary item + sformat (_("Output directory: %1<br>"), + add_on["base_output_path"]:""); + if (add_on["patterns"]:$[] != $[]) + // summary item, %1 is comma-separated list + ret = ret + sformat (_("Patterns: %1"), mergestring ( + maplist (string pat, map p, add_on["patterns"]:$[],``(pat)), + ", ")); + return ret; + } + + // help text + string help_text = _("<p>Start the creating of new Add-On Product configuration with <b>Add</b>.</p>") + + + // help text + _("<p>Use <b>Edit</b> to modify selected Add-On Product configuration.</p>") + + + // help text + _("<p>Delete the selected configuration using <b>Delete</b>.</p>") + + + // help text + _("<p>Build the fresh Add On Product based on selected configuration with <b>Build</b>.</p>"); + + term contents = `VBox ( + `VWeight (3, `Table (`id (`table), `opt (`notify, `immediate), + // table header item + `header (_("Product Name"), + // table header item + _("Version") + ), + summary_items + )), + `VWeight (1, `RichText (`id (`descr), "")), + `HBox ( + `PushButton (`id (`new), `opt (`key_F3), Label::AddButton ()), + `PushButton (`id (`edit), `opt (`key_F4), Label::EditButton ()), + `PushButton (`id (`delete), `opt (`key_F5), Label::DeleteButton ()), + `HStretch (), + // push button label + `PushButton (`id (`build), `opt (`key_F6), _("&Build")) + ) + ); + + contents = Wizard_hw::SpacingAround (contents, 1.5, 1.5, 1.0, 1.0); + + Wizard::SetContentsButtons(caption, contents, help_text, + Label::AbortButton(), Label::FinishButton()); + Wizard::HideAbortButton(); + + if (AddOnCreator::selected_product != -1) + UI::ChangeWidget (`id (`table), `CurrentItem, AddOnCreator::selected_product); + integer current = (integer) UI::QueryWidget(`id(`table), `CurrentItem); + map current_product = add_on_products[current]:$[]; + UI::ChangeWidget (`id (`descr), `Value, get_description (current_product)); + UI::SetFocus (`id (`table)); + + any ret = nil; + while (true) { + + ret = UI::UserInput(); + current = (integer) UI::QueryWidget(`id(`table), `CurrentItem ); + + if (ret == `abort || ret == `cancel || ret == `back) { + if (ReallyAbort ()) + { + ret = `abort; + break; + } + continue; + } + if (ret == `new) + { + break; + } + if(ret == `delete) + { + // yes/no popup + if (Popup::YesNo (sformat (_("Really delete configuration \"%1\"?"), + current_product["content_map","PRODUCT"]:""))) + { + add_on_products = remove (add_on_products, current); + summary_items = get_summary_items (); + current_product = $[]; + UI::ChangeWidget (`id (`table), `Items, get_summary_items ()); + UI::ChangeWidget (`id (`edit), `Enabled, summary_items != []); + UI::ChangeWidget (`id (`delete), `Enabled, summary_items != []); + if (summary_items != []) + ret = `table; + } + } + if (ret == `table) + { + current_product = add_on_products[current]:$[]; + UI::ChangeWidget (`id (`descr), `Value, + get_description (current_product)); + + } + if (ret == `edit || ret == `build) + { + AddOnCreator::SelectProduct (current_product); + if (ret == `build) + AddOnCreator::PrepareBuild (); + break; + } + if (ret == `next) { + AddOnCreator::add_on_products = add_on_products; + break; + } + } + AddOnCreator::selected_product = (ret == `new) ? -1 : current; + Wizard::RestoreAbortButton(); + return (symbol)ret; +} + +/** + * The first dialog in the sequence for creating new Add-On product * (select either creating new product or cloning existing one) */ -any StartDialog () { +any NewProductDialog () { // dialog caption string caption = _("Add-On Product Creator"); @@ -140,7 +291,6 @@ Wizard::SetContentsButtons(caption, contents, HELPS["start"]:"", Label::BackButton(), Label::NextButton()); - Wizard::HideBackButton(); foreach (symbol w, [ `path, `descr_ch, `browse ], { UI::ChangeWidget (`id(w), `Enabled, AddOnCreator::clone); @@ -180,52 +330,15 @@ break; // FIXME checks... } - else if (ret == `abort || ret == `cancel) { + else if (ret == `abort || ret == `cancel || ret == `back) { if(ReallyAbort()) break; else continue; } - else if (ret == `back) { - break; - } } - Wizard::RestoreBackButton(); if (ret != `copy) { // reset possible previous settings - AddOnCreator::content = []; - AddOnCreator::content_map = $[]; - AddOnCreator::rpm_path = ""; - AddOnCreator::required_rpm_path = ""; - AddOnCreator::patterns = $[]; - AddOnCreator::packages_descr = $[]; - AddOnCreator::license = ""; - AddOnCreator::products_files = []; - AddOnCreator::media_files = []; - AddOnCreator::patches_files = []; - AddOnCreator::info = ""; - AddOnCreator::extra_prov = ""; - AddOnCreator::extra_prov_file = ""; - AddOnCreator::nextmedia = ""; - AddOnCreator::readme_files = $[ "README" : "" ]; - AddOnCreator::license_files = $[ "license" : "" ]; - AddOnCreator::copying_files = $[ "COPYING" : "" ]; - AddOnCreator::copyright_files = $[ "COPYRIGHT": "" ]; - AddOnCreator::y2update_packages = []; - AddOnCreator::y2update_path = ""; - AddOnCreator::workflow_path = ""; - AddOnCreator::generate_descriptions = false; - AddOnCreator::iso = false; - AddOnCreator::iso_path = ""; - AddOnCreator::iso_name = ""; - AddOnCreator::bootable = false; - AddOnCreator::clone = false; - AddOnCreator::import_path = ""; - AddOnCreator::base_output_path = ""; - AddOnCreator::passphrase = ""; - AddOnCreator::available_packages = $[]; - AddOnCreator::package2filename = $[]; - AddOnCreator::srcpackage2filename = $[]; - AddOnCreator::resign_packages = false; + AddOnCreator::ResetCurrentProduct (); } return ret; } @@ -235,12 +348,15 @@ */ any SourcesDialog() { + map current_product = AddOnCreator::current_product; + string requires = AddOnCreator::content_map["REQUIRES"]:""; if (requires == "") requires = "sles-release-10"; - string old_dir = AddOnCreator::rpm_path; - if (AddOnCreator::rpm_path == nil) - AddOnCreator::rpm_path = ""; + + string old_dir = current_product["rpm_path"]:""; + if (old_dir == nil) + current_product["rpm_path"] = ""; string old_requires = requires; string product = AddOnCreator::content_map["PRODUCT"]:""; @@ -303,7 +419,7 @@ `TextEntry (`id(`rpm_path), // text entry label _("&Path to Directory with Add-On Packages"), - AddOnCreator::rpm_path), + current_product["rpm_path"]:""), `VBox ( `Label (""), `PushButton (`id(`browse_rpm), Label::BrowseButton ()) @@ -313,7 +429,7 @@ `TextEntry (`id(`required_rpm_path), // text entry label _("Path to Directory with Re&quired Product Packages"), - AddOnCreator::required_rpm_path), + current_product["required_rpm_path"]:""), `VBox ( `Label (""), `PushButton (`id(`browse_req_rpm), Label::BrowseButton ()) @@ -414,10 +530,10 @@ } if (dir != "" && substring (dir, size (dir) - 1, 1) != "/") dir = dir + "/"; - AddOnCreator::rpm_path = dir; + AddOnCreator::current_product["rpm_path"] = dir; if (req_dir != "" && substring (req_dir, size (req_dir) - 1, 1) != "/") req_dir = req_dir + "/"; - AddOnCreator::required_rpm_path = req_dir; + AddOnCreator::current_product["required_rpm_path"] = req_dir; if (requires == "") requires = (string) UI::QueryWidget (`id(`other_val), `Value); AddOnCreator::content_map["REQUIRES"] = requires; @@ -430,9 +546,17 @@ AddOnCreator::content_map["DISTVERSION"]:"" == "") AddOnCreator::content_map["DISTVERSION"] = version; + /* FIXME does this make a sense??? + we need to generate again when editing previous project if (requires == old_requires && dir == old_dir && product == old_product && version == old_version) ret = `skip_gen; + */ + + // if rpm_path is different, reset packages_descr + // (otherwise current values settings are merged into generated) + if (dir != old_dir) + AddOnCreator::current_product["packages_descr"] = $[]; break; } else if (ret == `abort || ret == `cancel) { @@ -575,7 +699,8 @@ // dialog caption - 'content' is file name string caption = _("Product Definition (content File)"); - list<map> content = AddOnCreator::content; + map current_product = AddOnCreator::current_product; + list<map> content = AddOnCreator::content; integer linguas_entry = -1; @@ -668,7 +793,7 @@ } else if (ret == `import) { string file = UI::AskForExistingFile ( - AddOnCreator::base_output_path, "", + current_product["base_output_path"]:"", "", // popup for file selection dialog _("Choose the Existing Content File") ); @@ -730,7 +855,7 @@ if (index != -1) content[index,"value"] = distproduct; AddOnCreator::content = content; - AddOnCreator::UpdateContentMap (); + AddOnCreator::UpdateContentMap (content); break; } else if(ret == `abort || ret == `cancel) { @@ -1018,7 +1143,7 @@ if (result == `import) { string file = UI::AskForExistingFile ( - AddOnCreator::base_output_path, "", + AddOnCreator::current_product["base_output_path"]:"", "", // popup for file selection dialog _("Choose the file with the text to be imported") ); @@ -1048,9 +1173,11 @@ */ any PackagesDialog() { + map current_product = AddOnCreator::current_product; + // dialog caption string caption = _("Package Descriptions"); - map<string,map> descr = AddOnCreator::packages_descr; + map<string,map> descr = current_product["packages_descr"]:$[]; list descr_files = maplist (string l, map d, descr, ``(l)); @@ -1082,8 +1209,8 @@ list<string> allowed_langs = sort ( splitstring (AddOnCreator::content_map["LINGUAS"]:""," \t")); if (allowed_langs == []) allowed_langs = [ "en", "de"]; - string def_lang = "en"; //FIXME other default? - // FIXME Addon for 10.1 has more languages, although only en, de in LINGUAS + string def_lang = "en"; + // Addon for 10.1 has more languages, although only en, de in LINGUAS... // lang is language that should be active in the combo box void replace_language_widgets (string lang) { @@ -1151,7 +1278,7 @@ `VSpacing (0.4), `HBox ( // textentry label - `TextEntry (`id (`extra_prov), _("Location of the File with Additional &Dependencies"), AddOnCreator::extra_prov_file), + `TextEntry (`id (`extra_prov), _("Location of the File with Additional &Dependencies"), current_product["extra_prov_file"]:""), `VBox ( `Label (""), `PushButton (`id (`browse), Label::BrowseButton ()) @@ -1215,7 +1342,7 @@ if (ret == `import_lang) { string file = UI::AskForExistingFile ( - AddOnCreator::rpm_path, "packages.*", + current_product["rpm_path"]:"", "packages.*", // popup for file selection dialog _("Choose the New Package Description File") ); @@ -1312,7 +1439,7 @@ else if (ret == `browse) { string file = UI::AskForExistingFile ( - AddOnCreator::rpm_path, "", + current_product["rpm_path"]:"", "", // popup for file selection dialog _("Choose the Path to EXTRA_PROV File") ); @@ -1320,7 +1447,7 @@ UI::ChangeWidget (`id (`extra_prov), `Value, file); } else if(ret == `next) { - AddOnCreator::packages_descr = descr; + AddOnCreator::current_product["packages_descr"] = descr; string extra = (string) UI::QueryWidget (`id (`extra_prov), `Value); if (extra != "" && !FileUtils::Exists (extra)) { @@ -1331,7 +1458,16 @@ continue; } else - AddOnCreator::extra_prov_file = extra; + { + string cont = ""; + if (extra != "") + cont = (string) SCR::Read (.target.string, extra); + if (cont != nil) + { + AddOnCreator::current_product["extra_prov"] = cont; + AddOnCreator::current_product["extra_prov_file"] = extra; + } + } break; } else if (ret == `back) { @@ -1439,13 +1575,18 @@ */ any SigningDialog() { + map current_product = AddOnCreator::current_product; + string gpg_key = current_product["gpg_key"]:""; // dialog caption string caption = _("Signing the Add-On Product"); list gpg_keys = maplist (string key, AddOnCreator::gpg_keys, { map out = (map) SCR::Execute (.target.bash_output, sformat ("gpg --list-secret-keys %1 | grep uid | sed -e 's/^uid[ ]*//'", key)); string name = deletechars (out["stdout"]:"", "\n"); - return `item (`id (key), name != "" ? sformat ("%1 (%2)", key, name) : key); + return `item (`id (key), + name != "" ? sformat ("%1 (%2)", key, name) : key, + key == gpg_key + ); }); term contents = `HBox (`HSpacing (), `VBox ( @@ -1462,18 +1603,19 @@ ) ), // password entry label - `Password (`id(`pw), _("&Passphrase"), AddOnCreator::passphrase), + `Password (`id(`pw), _("&Passphrase"), + AddOnCreator::passphrases[gpg_key]:""), // password entry label (verification) `Password (`id(`pw2), _("&Passphrase Verification"), - AddOnCreator::passphrase), + AddOnCreator::passphrases[gpg_key]:""), // checkbox label `Left (`CheckBox (`id (`resign), _("Re&sign all packages with selected key"), - AddOnCreator::resign_packages) + current_product["resign_packages"]:false) ), `VSpacing (0.7) ), `HSpacing ()); - +// FIXME checkbox (so there's a chance not to sign...) Wizard::SetContentsButtons(caption, contents, HELPS["signing"]:"", Label::BackButton(), Label::NextButton()); @@ -1512,9 +1654,10 @@ UI::ChangeWidget (`id (`resign), `Value, false); continue; } - AddOnCreator::gpg_key = key; - AddOnCreator::passphrase = pw; - AddOnCreator::resign_packages = resign; + AddOnCreator::passphrases[key] = pw; + AddOnCreator::current_product["ask_for_passphrase"] = (pw != ""); + AddOnCreator::current_product["gpg_key"] = key; + AddOnCreator::current_product["resign_packages"] = resign; break; } else if (ret == `abort || ret == `cancel) { @@ -1536,12 +1679,12 @@ // dialog caption string caption = _("Output Settings"); - boolean iso = AddOnCreator::iso; - boolean bootable = AddOnCreator::bootable; + map current_product = AddOnCreator::current_product; + boolean iso = current_product["iso"]:false; boolean autorun = false; map<string,string> content_map = AddOnCreator::content_map; - string iso_name = AddOnCreator::iso_name; + string iso_name = current_product["iso_name"]:""; if (iso_name == "") iso_name = sformat ("%1-%2-%3", tolower (content_map["DISTPRODUCT"]:""), @@ -1551,15 +1694,13 @@ `HBox ( // text entry label `TextEntry (`id(`output_path), _("P&ath to Output Directory"), - AddOnCreator::base_output_path), + current_product["base_output_path"]:""), `VBox ( `Label (""), `PushButton (`id(`browse), Label::BrowseButton ()) ) ), // check box label -//FIXME `Left (`CheckBox (`id(`boot), _("Create B&ootable Add-On"), bootable)), - // check box label //FIXME `Left (`CheckBox (`id(`autorun), _("&Autorun"), autorun)), @@ -1593,7 +1734,6 @@ boolean iso = (boolean)UI::QueryWidget (`id(`iso), `Value); iso_name = (string)UI::QueryWidget (`id(`iso_name), `Value); UI::ChangeWidget (`id(`iso_name), `Enabled, iso); -// boolean bootable= (boolean)UI::QueryWidget (`id(`boot), `Value); if (ret == `browse) { dir = UI::AskForExistingDirectory (dir, ""); if (dir != nil) @@ -1604,10 +1744,9 @@ } } else if (ret == `expert || ret == `workflow) { - AddOnCreator::base_output_path = dir; - AddOnCreator::iso = iso; - AddOnCreator::iso_name = iso_name; -// AddOnCreator::bootable = bootable; + AddOnCreator::current_product["base_output_path"] = dir; + AddOnCreator::current_product["iso"] = iso; + AddOnCreator::current_product["iso_name"] = iso_name; break; } else if (ret == `next) { @@ -1628,10 +1767,9 @@ continue; } } - AddOnCreator::base_output_path = dir; - AddOnCreator::iso = iso; - AddOnCreator::iso_name = iso_name; -// AddOnCreator::bootable = bootable; + AddOnCreator::current_product["base_output_path"] = dir; + AddOnCreator::current_product["iso"] = iso; + AddOnCreator::current_product["iso_name"] = iso_name; if (iso && !Package::Install ("mkisofs")) { UI::ChangeWidget (`id(`iso), `Value, false); @@ -1661,6 +1799,8 @@ // dialog caption string caption = _("Overview"); + map current_product = AddOnCreator::current_product; + string sum = ""; // summary header @@ -1670,20 +1810,20 @@ // summary header sum = Summary::AddHeader (sum, _("Patterns")); sum = Summary::OpenList (sum); - foreach (string name, map p, AddOnCreator::patterns, { + foreach (string name, map p, current_product["patterns"]:$[], { sum = Summary::AddListItem (sum, p["Pat"]:name); }); sum = Summary::CloseList (sum); // summary header sum = Summary::AddHeader (sum, _("Input Directory")); - sum = Summary::AddLine (sum, AddOnCreator::rpm_path); + sum = Summary::AddLine (sum, current_product["rpm_path"]:""); // summary header sum = Summary::AddHeader (sum, _("Output Directory")); - sum = Summary::AddLine (sum, AddOnCreator::base_output_path); + sum = Summary::AddLine (sum, current_product["base_output_path"]:""); - if (AddOnCreator::iso) + if (current_product["iso"]:false) { sum = Summary::AddLine (sum, // summary line Modified: trunk/add-on-creator/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/src/dialogs.ycp?rev=44537&r1=44536&r2=44537&view=diff ============================================================================== --- trunk/add-on-creator/src/dialogs.ycp (original) +++ trunk/add-on-creator/src/dialogs.ycp Fri Feb 15 16:27:21 2008 @@ -88,13 +88,14 @@ */ any ExpertSettingsDialog () { + map current_product = AddOnCreator::current_product; + // dialog caption string caption = _("Expert Settings"); - string info = AddOnCreator::info; - - map<string,string> license_files = AddOnCreator::license_files; - map<string,string> readme_files = AddOnCreator::readme_files; + string info = current_product["info"]:""; + map<string,string> license_files = current_product["license_files"]:$[]; + map<string,string> readme_files = current_product["readme_files"]:$[]; void replace_readme_widgets (string active) { UI::ReplaceWidget (`id(`rpfiles), @@ -187,7 +188,7 @@ if (ret == `import_readme) { string file = UI::AskForExistingFile ( - AddOnCreator::rpm_path, "", + current_product["rpm_path"]:"", "", // popup for file selection dialog _("Choose the New README File") ); @@ -249,7 +250,7 @@ if (ret == `import_license) { string file = UI::AskForExistingFile ( - AddOnCreator::rpm_path, "license*", + current_product["rpm_path"]:"", "license*", // popup for file selection dialog _("Choose the New License File") ); @@ -300,9 +301,10 @@ AddOnCreator::media = (string) UI::QueryWidget (`id(`media),`Value); */ - AddOnCreator::info = (string) UI::QueryWidget (`id(`info),`Value); - AddOnCreator::readme_files = readme_files; - AddOnCreator::license_files = license_files; + AddOnCreator::current_product["info"] = + UI::QueryWidget (`id(`info),`Value); + AddOnCreator::current_product["readme_files"] = readme_files; + AddOnCreator::current_product["license_files"] = license_files; break; } else if (ret == `abort || ret == `cancel) { @@ -323,12 +325,12 @@ */ any ExpertSettingsDialog2 () { - // dialog caption string caption = _("Expert Settings, Part 2"); - map<string,string> copying_files = AddOnCreator::copying_files; - map<string,string> copyright_files = AddOnCreator::copyright_files; + map current_product = AddOnCreator::current_product; + map<string,string> copying_files = current_product["copying_files"]:$[]; + map<string,string> copyright_files = current_product["copyright_files"]:$[]; void replace_copyright_widgets (string active) { UI::ReplaceWidget (`id(`rpfiles), @@ -423,7 +425,7 @@ if (ret == `import_copyright) { string file = UI::AskForExistingFile ( - AddOnCreator::rpm_path, "COPYRIGHT*", + current_product["rpm_path"]:"", "COPYRIGHT*", // popup for file selection dialog _("Choose the New COPYRIGHT File") ); @@ -482,7 +484,7 @@ if (ret == `import_copying) { string file = UI::AskForExistingFile ( - AddOnCreator::rpm_path, "copying*", + current_product["rpm_path"]:"", "copying*", // popup for file selection dialog _("Choose the New COPYING File") ); @@ -527,8 +529,8 @@ (string)UI::QueryWidget(`id(`copyright),`Value); copying_files[current_copying] = (string)UI::QueryWidget(`id(`copying),`Value); - AddOnCreator::copyright_files = copyright_files; - AddOnCreator::copying_files = copying_files; + AddOnCreator::current_product["copyright_files"] = copyright_files; + AddOnCreator::current_product["copying_files"] = copying_files; Wizard::RestoreAbortButton(); break; } @@ -553,9 +555,10 @@ // dialog caption string caption = _("Expert Settings, Part 3"); - list<string> products_files = AddOnCreator::products_files; - list<string> patches_files = AddOnCreator::patches_files; - list<string> media_files = AddOnCreator::media_files; + map current_product = AddOnCreator::current_product; + list<string> products_files = current_product["products_files"]:[]; + list<string> patches_files = current_product["patches_files"]:[]; + list<string> media_files = current_product["media_files"]:[]; string products = products_files[0]:""; string patches = patches_files[0]:""; @@ -613,9 +616,10 @@ // dialog caption string caption = _("Workflow Configuration"); - string workflow_path = AddOnCreator::workflow_path; - string y2update_path = AddOnCreator::y2update_path; - list<string> y2update_packages = AddOnCreator::y2update_packages; + map current_product = AddOnCreator::current_product; + string workflow_path = current_product["workflow_path"]:""; + string y2update_path = current_product["y2update_path"]:""; + list<string> y2update_packages = current_product["y2update_packages"]:[]; // helper for updating table contents void update_table () { UI::ChangeWidget (`id(`y2update_packages), `Items, @@ -692,7 +696,7 @@ if (ret == `browse) { string file = UI::AskForExistingFile ( - AddOnCreator::rpm_path, "*.xml", + current_product["rpm_path"]:"", "*.xml", // popup for file selection dialog _("Choose the installation.xml File") ); @@ -714,7 +718,7 @@ if (ret == `br_y2update) { string file = UI::AskForExistingFile ( - AddOnCreator::rpm_path, "y2update.tgz", + current_product["rpm_path"]:"", "y2update.tgz", // popup for file selection dialog _("Choose the Path to the y2update.tgz File") ); @@ -727,7 +731,7 @@ else if (ret == `add) { string file = UI::AskForExistingFile ( - AddOnCreator::rpm_path, "*.rpm", + current_product["rpm_path"]:"", "*.rpm", // popup for file selection dialog _("Choose the YaST Module Package") ); @@ -748,10 +752,11 @@ UI::ChangeWidget (`id(`delete), `Enabled, y2update_packages != []); } else if (ret == `next) { - AddOnCreator::y2update_packages = y2update_packages; - AddOnCreator::y2update_path = + AddOnCreator::current_product["y2update_packages"] = + y2update_packages; + AddOnCreator::current_product["y2update_path"] = (string)UI::QueryWidget (`id(`y2update_path), `Value); - AddOnCreator::workflow_path = + AddOnCreator::current_product["workflow_path"] = (string)UI::QueryWidget (`id(`workflow_path), `Value); break; } Modified: trunk/add-on-creator/src/helps.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/src/helps.ycp?rev=44537&r1=44536&r2=44537&view=diff ============================================================================== --- trunk/add-on-creator/src/helps.ycp (original) +++ trunk/add-on-creator/src/helps.ycp Fri Feb 15 16:27:21 2008 @@ -36,16 +36,14 @@ */ map HELPS = $[ - /* Write dialog help 1/2 */ - "write" : _("<p><b><big>Creating the Add-On</big></b><br> + // Build dialog help + "build" : _("<p><b><big>Creating the Add-On</big></b><br> Please wait...<br></p> -") + +"), - /* Write dialog help 2/2 */ -_("<p><b><big>Aborting Saving</big></b><br> -Abort the save procedure by pressing <b>Abort</b>. -An additional dialog informs whether it is safe to do so. -</p> + // Write dialog help + "write" : _("<p><b>Writing Add-On configurations</b><br> +Please wait...<br></p> "), // help text for start menu Modified: trunk/add-on-creator/src/patterns.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/src/patterns.ycp?rev=44537&r1=44536&r2=44537&view=diff ============================================================================== --- trunk/add-on-creator/src/patterns.ycp (original) +++ trunk/add-on-creator/src/patterns.ycp Fri Feb 15 16:27:21 2008 @@ -177,9 +177,10 @@ */ any PatternsDialog() { - map<string,map> patterns = AddOnCreator::patterns; + map current_product = AddOnCreator::current_product; string requires = AddOnCreator::content_map["REQUIRES"]:""; - string import_path = AddOnCreator::rpm_path; + string import_path = current_product["rpm_path"]:""; + map<string,map> patterns = current_product["patterns"]:$[]; // helper for generation of table items list get_pattern_items (map pattern) { @@ -327,7 +328,9 @@ current_pattern = sel; UI::ChangeWidget (`id(`pattern), `Items, get_pattern_items (patterns[current_pattern]:$[])); - UI::ChangeWidget (`id(`required), `Value, issubstring (requires, "pattern:" + sel)); + UI::ChangeWidget (`id(`required), `Value, + size (patterns) > 0 && + issubstring (requires, "pattern:" + sel)); } } else if (ret == `add) { @@ -393,7 +396,7 @@ } } else if (ret == `next) { - AddOnCreator::patterns = patterns; + AddOnCreator::current_product["patterns"] = patterns; if (AddOnCreator::content_map["REQUIRES"]:"" != requires) { integer i = 0; Modified: trunk/add-on-creator/src/wizards.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/add-on-creator/src/wizards.ycp?rev=44537&r1=44536&r2=44537&view=diff ============================================================================== --- trunk/add-on-creator/src/wizards.ycp (original) +++ trunk/add-on-creator/src/wizards.ycp Fri Feb 15 16:27:21 2008 @@ -39,18 +39,14 @@ include "add-on-creator/dialogs.ycp"; include "add-on-creator/patterns.ycp"; +// fill the defaults for content file any GenerateContent () { - // busy message - Popup::ShowFeedback ("", _("Generating content file...")); - //FIXME logview.., not only content - AddOnCreator::FillContentDefaults (); - - Popup::ClearFeedback (); return `next; } +// import data from existing product any CopyExisting () { // busy message @@ -62,16 +58,31 @@ return `next; } +// save the data with current configuration into global list +any Commit () { + AddOnCreator::CommitCurrentProduct (); + return `next; +} + +// if there are no Add-On products configured, open creation sequence +any FirstDialog () { + if (size (AddOnCreator::add_on_products) > 0) + { + return `summary; + } + AddOnCreator::selected_product = -1; + return `new; +} /** - * Main workflow of the add-on-creator configuration + * Main workflow of the add-on-creator configuration: create or edit Add-On * @return sequence result */ any MainSequence() { map aliases = $[ - "start" : ``( StartDialog() ), + "new" : ``( NewProductDialog() ), "content" : ``( ContentFileDialog() ), "sources" : ``( SourcesDialog() ), "expert1" : ``( ExpertSettingsDialog() ), @@ -84,14 +95,15 @@ "workflow" : ``( WorkflowConfigurationDialog() ), "copy" : [ ``(CopyExisting ()), true ], "generate" : [ ``(GenerateContent ()), true ], + "commit" : ``( Commit ()), ]; - + string start_dialog = (AddOnCreator::selected_product == -1) ? + "new" : "sources"; map sequence = $[ - "ws_start" : "start", - "start" : $[ + "ws_start" : start_dialog, + "new" : $[ `abort : `abort, `next : "sources", -// `copy : "content", `copy : "copy", ], "sources" : $[ @@ -100,7 +112,7 @@ `skip_gen : "content", ], "copy" : $[ - `next : "generate", // FIXME in fact, it only reads the data.. + `next : "generate", ], "generate" : $[ `next : "content", @@ -116,7 +128,6 @@ "patterns" : $[ `abort : `abort, `next : "output", -// `next : "overview", ], "output" : $[ `abort : `abort, @@ -134,7 +145,12 @@ ], "overview" : $[ `abort : `abort, +// `next : `next, + `next : "commit", + ], + "commit" : $[ `next : `next, +// `next : "summary", ], "expert1" : $[ `abort : `abort, @@ -158,20 +174,39 @@ any AddOnCreatorSequence() { map aliases = $[ - "read" : [ ``( ReadDialog() ), true ], - "main" : ``( MainSequence() ), - "write" : [ ``( WriteDialog() ), true ] + "read" : [ ``( ReadDialog() ), true ], + "start" : [ ``( FirstDialog ()), true ], + "summary" : ``( SummaryDialog() ), + "build" : ``( BuildDialog ()), + "main" : ``( MainSequence() ), + "write" : [ ``( WriteDialog() ), true ] ]; map sequence = $[ "ws_start" : "read", "read" : $[ `abort : `abort, - `next : "main" + `next : "start" ], - "main" : $[ + "start" : $[ + `summary : "summary", + `new : "main", + ], + "summary" : $[ `abort : `abort, - `next : "write" + `next : `next, + `new : "main", + `edit : "main", + `build : "build", + `next : "write", + ], + "build" : $[ + `next : "summary", + `abort : "summary", + ], + "main" : $[ + `abort : "summary", + `next : "summary", ], "write" : $[ `abort : `abort, -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jsuchome@svn.opensuse.org