Author: lslezak Date: Fri Nov 9 12:18:47 2007 New Revision: 41912 URL: http://svn.opensuse.org/viewcvs/yast?rev=41912&view=rev Log: - compress metadata if needed, replace the old one, support compressed patter files, generate packages.DU only up to the 3rd directory level (#335183) Modified: trunk/product-creator/package/yast2-product-creator.changes trunk/product-creator/src/ProductCreator.ycp Modified: trunk/product-creator/package/yast2-product-creator.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/package/yast2-product-creator.changes?rev=41912&r1=41911&r2=41912&view=diff ============================================================================== --- trunk/product-creator/package/yast2-product-creator.changes (original) +++ trunk/product-creator/package/yast2-product-creator.changes Fri Nov 9 12:18:47 2007 @@ -2,6 +2,9 @@ Fri Nov 9 10:36:55 CET 2007 - lslezak@suse.cz - properly download /boot, /docu and slideshow files (#338625) +- compress metadata if needed, replace the old one, support + compressed patter files, generate packages.DU only up to + the 3rd directory level (#335183) - copy PPC boot files in /suseboot, /ppc and /PS3 (#335177) - install required package createrepo (#331530), install additional packages on PPC Modified: trunk/product-creator/src/ProductCreator.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/product-creator/src/ProductCreator.ycp?rev=41912&r1=41911&r2=41912&view=diff ============================================================================== --- trunk/product-creator/src/ProductCreator.ycp (original) +++ trunk/product-creator/src/ProductCreator.ycp Fri Nov 9 12:18:47 2007 @@ -32,6 +32,7 @@ import "GPGWidgets"; import "Mode"; import "CommandLine"; +import "FileUtils"; global define void enableSources(); @@ -1685,12 +1686,14 @@ files = []; } - files = filter(string f, files, {return regexpmatch(f, "\\.pat$");}); + files = filter(string f, files, {return regexpmatch(f, "\\.pat$") || regexpmatch(f, "\\.pat.gz$");}); y2milestone("found pattern files: %1", files); - list<string> used_files_regexps = maplist(string p, used_patterns, {return sformat("^%1-.*\\.pat$", p);}); - y2debug("used_files_regexps: %1", used_files_regexps); + 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);})); + + y2internal("used_files_regexps: %1", used_files_regexps); boolean refresh_diryast = false; foreach(string f, files, @@ -1726,9 +1729,8 @@ success = success && Exec(cmd); y2debug("success: %1", success); - 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); + cmd = sformat("cd '%1/%2'; ls *.pat *.pat.gz > '%1/%2/patterns'", String::Quote(skel_root), String::Quote(descrDir)); + Exec(cmd); } } @@ -2402,8 +2404,18 @@ 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", + ret = ret && Exec(sformat("cd '%1/%2/%3' && /usr/bin/create_package_descr -x setup/descr/EXTRA_PROV -M 3", 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)); + y2internal("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))); + } } } ); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org