Author: lslezak Date: Mon May 28 11:11:35 2007 New Revision: 38157 URL: http://svn.opensuse.org/viewcvs/yast?rev=38157&view=rev Log: - install "yast2-instserver" package (.content_file agent) - fixed signing of addon products - allow spaces in the file names (#275918) Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/package/yast2-product-creator.changes branches/SuSE-SLE-10-SP1-Branch/product-creator/scripts/y2mkiso branches/SuSE-SLE-10-SP1-Branch/product-creator/src/ProductCreator.ycp branches/SuSE-SLE-10-SP1-Branch/product-creator/src/complex.ycp branches/SuSE-SLE-10-SP1-Branch/product-creator/src/wizards.ycp Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/package/yast2-product-creator.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/product-creator/package/yast2-product-creator.changes?rev=38157&r1=38156&r2=38157&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/product-creator/package/yast2-product-creator.changes (original) +++ branches/SuSE-SLE-10-SP1-Branch/product-creator/package/yast2-product-creator.changes Mon May 28 11:11:35 2007 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon May 28 09:01:06 CEST 2007 - lslezak@suse.cz + +- install "yast2-instserver" package (.content_file agent) +- fixed signing of addon products +- allow spaces in the file names (#275918) + +------------------------------------------------------------------- Wed May 23 15:59:07 CEST 2007 - lslezak@suse.cz - 2.13.1 Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/scripts/y2mkiso URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/product-creator/scripts/y2mkiso?rev=38157&r1=38156&r2=38157&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/product-creator/scripts/y2mkiso (original) +++ branches/SuSE-SLE-10-SP1-Branch/product-creator/scripts/y2mkiso Mon May 28 11:11:35 2007 @@ -55,7 +55,7 @@ fi # set it later in pmac branch PPC_HFS_APPID="" -if [ -f $SOURCE/content ] ; then +if [ -f "$SOURCE/content" ] ; then BOOT_BASE_DIR=boot BOOT_IMAGE=$BOOT_BASE_DIR/image BOOT_ISOLINUX=$BOOT_BASE_DIR/$BOOT_ARCH/loader @@ -85,18 +85,18 @@ esac ;; esac - done < $SOURCE/content + done < "$SOURCE/content" DISTVERSION=`echo $DISTVERSION | tr '-' '#'` DISTIDENT="$DISTPRODUCT-$DISTVERSION" - for i in $SOURCE/media.? ; do - test -d $i || continue + for i in "$SOURCE/media.?" ; do + test -d "$i" || continue { read VENDOR read CREATIONDATE - } < $i/media + } < "$i"/media done else - if [ -d $SOURCE/boot/$BOOT_ARCH/loader -a -d $SOURCE/i386/update ]; then + if [ -d "$SOURCE/boot/$BOOT_ARCH/loader" -a -d "$SOURCE/i386/update" ]; then # We have a bootable Patch-CD BOOT_BASE_DIR=boot BOOT_IMAGE=$BOOT_BASE_DIR/image @@ -105,30 +105,30 @@ fi -TMP_LS=`/bin/ls -d $SOURCE/*/update 2> /dev/null` -if [ -d $SOURCE/$BOOT_BASE_DIR -o -d $SOURCE/$ROOT_ON_CD -o ! -z "$TMP_LS" ] ; then +TMP_LS=`/bin/ls -d "$SOURCE/*/update" 2> /dev/null` +if [ -d "$SOURCE/$BOOT_BASE_DIR" -o -d "$SOURCE/$ROOT_ON_CD" -o ! -z "$TMP_LS" ] ; then - if test -e $SOURCE/$ROOT_ON_CD/inst-sys-test ; then + if test -e "$SOURCE/$ROOT_ON_CD/inst-sys-test" ; then echo $SOURCE/$ROOT_ON_CD/inst-sys-test exist. Please remove it. exit fi - if test -f $SOURCE/$BOOT_IMAGE -o -f $SOURCE/.boot \ - -o -d $SOURCE/$BOOT_ISOLINUX \ - -o -f $SOURCE/ppc/bootinfo.txt -o -d $SOURCE/suseboot \ - -o -d $SOURCE/etc -o -f $SOURCE/boot/silo.conf ; then + if test -f "$SOURCE/$BOOT_IMAGE" -o -f "$SOURCE/.boot" \ + -o -d "$SOURCE/$BOOT_ISOLINUX" \ + -o -f "$SOURCE/ppc/bootinfo.txt" -o -d "$SOURCE/suseboot" \ + -o -d "$SOURCE/etc" -o -f "$SOURCE/boot/silo.conf" ; then #test -d $SOURCE2 && { echo "tmpdir $SOURCE2 already exists" ; exit 1 ; } mkdir -p $SOURCE2 || { echo "can't create tmpdir $SOURCE2" ; exit 1 ; } - chmod 755 $SOURCE2 - if [ -f $SOURCE/.boot ] ; then + chmod 755 "$SOURCE2" + if [ -f "$SOURCE/.boot" ] ; then PARAMS="$PARAMS -b .boot -c boot.catalog" echo found boot image. Making CD bootable. - mkdir -p $SOURCE2/$BOOT_BASE_DIR || exit 1 - elif [ -f $SOURCE/$BOOT_IMAGE ] ; then + mkdir -p "$SOURCE2/$BOOT_BASE_DIR" || exit 1 + elif [ -f "$SOURCE/$BOOT_IMAGE" ] ; then # needed for ia64 - xx=`filesize $SOURCE/$BOOT_IMAGE` + xx=`filesize "$SOURCE/$BOOT_IMAGE"` if [ \( "$xx" -ne 1474560 \) -a \( "$xx" -ne 2949120 \) ] ; then - if head -c 200 $SOURCE/$BOOT_IMAGE | grep -a -q 'Sorry, didn.t find boot loader, stopped.' ; then + if head -c 200 "$SOURCE/$BOOT_IMAGE" | grep -a -q 'Sorry, didn.t find boot loader, stopped.' ; then PARAMS="$PARAMS -hard-disk-boot" else PARAMS="$PARAMS -no-emul-boot" @@ -139,12 +139,12 @@ PARAMS="$PARAMS -sort $SORTFILE -b $BOOT_IMAGE -c $BOOT_BASE_DIR/boot.catalog \ -hide $BOOT_BASE_DIR/boot.catalog -hide-joliet $BOOT_BASE_DIR/boot.catalog" echo found boot image. Making CD bootable. - mkdir -p $SOURCE2/$BOOT_BASE_DIR || exit 1 - elif [ -d $SOURCE/$BOOT_ISOLINUX ] ; then + mkdir -p "$SOURCE2/$BOOT_BASE_DIR" || exit 1 + elif [ -d "$SOURCE/$BOOT_ISOLINUX" ] ; then echo "$SOURCE2/$BOOT_BASE_DIR/boot.catalog 3" >$SORTFILE echo "$BOOT_BASE_DIR/boot.catalog 3" >>$SORTFILE echo "$SOURCE/$BOOT_BASE_DIR/boot.catalog 3" >>$SORTFILE - find $SOURCE/$BOOT_ISOLINUX -printf "%p 1\n" >>$SORTFILE + find "$SOURCE/$BOOT_ISOLINUX" -printf "%p 1\n" >>$SORTFILE # last priority wins echo "$SOURCE/$BOOT_ISOLINUX/isolinux.bin 2" >>$SORTFILE echo "sortfile has" @@ -155,8 +155,8 @@ -b $BOOT_ISOLINUX/isolinux.bin -c $BOOT_BASE_DIR/boot.catalog \ -hide $BOOT_BASE_DIR/boot.catalog -hide-joliet $BOOT_BASE_DIR/boot.catalog" echo found boot image. Making CD bootable. - mkdir -p $SOURCE2/$BOOT_BASE_DIR || exit 1 - elif [ -f $SOURCE/ppc/bootinfo.txt -o -d $SOURCE/suseboot ] ; then + mkdir -p "$SOURCE2/$BOOT_BASE_DIR" || exit 1 + elif [ -f "$SOURCE/ppc/bootinfo.txt" -o -d "$SOURCE/suseboot" ] ; then # various ppc boards, no -J option echo removing follow-symlinks and joilet from mkisofs options echo adding long filenames, translation table, Untranslated filenames @@ -191,7 +191,7 @@ fi # check now for CHRP/iSeries vs PReP/pmac if the above is false if [ "$PPC_MKISOFS_CHRPBOOT" = "no" ] ; then - if [ -f $SOURCE/ppc/bootinfo.txt ] ; then + if [ -f "$SOURCE/ppc/bootinfo.txt" ] ; then # assume thats a pSeries/iSeries CD echo generic chrp bootblock missing echo upgrade mkisofs @@ -199,15 +199,15 @@ else # assume thats a PReP/Pmac CD # check if a PReP install file is available - if [ -f $SOURCE/boot/zImage.prep.initrd ] ; then + if [ -f "$SOURCE/boot/zImage.prep.initrd" ] ; then PARAMS="$PARAMS -prep-boot boot/zImage.prep.initrd" echo using boot/zImage.prep.initrd for PReP boot - elif [ -f $SOURCE/suse/images/zImage.prep.initrd ] ; then + elif [ -f "$SOURCE/suse/images/zImage.prep.initrd" ] ; then PARAMS="$PARAMS -prep-boot suse/images/zImage.prep.initrd" echo using suse/images/zImage.prep.initrd for PReP boot fi # check if a pmac kernel is available - if [ -d $SOURCE/suseboot ] ; then + if [ -d "$SOURCE/suseboot" ] ; then # create a mac partition table # use netatalk and macbinary filename translation # bless a directory named suseboot, mark it bootable @@ -227,21 +227,21 @@ fi else # new mkisofs with -chrp-boot option - if [ -f $SOURCE/ppc/bootinfo.txt ] ; then + if [ -f "$SOURCE/ppc/bootinfo.txt" ] ; then # assume thats a pSeries/iSeries CD echo "adding -chrp-boot for CHRP boot" PARAMS="$PARAMS -chrp-boot" fi # check if a PReP install file is available - if [ -f $SOURCE/boot/zImage.prep.initrd ] ; then + if [ -f "$SOURCE/boot/zImage.prep.initrd" ] ; then PARAMS="$PARAMS -prep-boot boot/zImage.prep.initrd" echo using boot/zImage.prep.initrd for PReP boot - elif [ -f $SOURCE/suse/images/zImage.prep.initrd ] ; then + elif [ -f "$SOURCE/suse/images/zImage.prep.initrd" ] ; then PARAMS="$PARAMS -prep-boot suse/images/zImage.prep.initrd" echo using suse/images/zImage.prep.initrd for PReP boot fi # check if a pmac kernel is available - if [ -d $SOURCE/suseboot ] ; then + if [ -d "$SOURCE/suseboot" ] ; then # create a mac partition table # use netatalk and macbinary filename translation # bless a directory named suseboot, mark it bootable @@ -260,11 +260,11 @@ fi # end ppc boards else - if [ -d $SOURCE/etc ] ; then + if [ -d "$SOURCE/etc" ] ; then echo found $SOURCE/etc. making sure, it is at the beginning of iso image. mkdir -p $SOURCE2/etc || exit 1 else - if [ -f $SOURCE/boot/silo.conf ] ; then + if [ -f "$SOURCE/boot/silo.conf" ] ; then PARAMS="$PARAMS -silo-boot boot/second.b -s /boot/silo.conf" echo found SPARC boot config. Making CD bootable. mkdir -p $SOURCE2/boot || exit 1 @@ -276,17 +276,17 @@ echo found no boot image. No bootable CD. fi - if test -f $SOURCE/content -a -z "$TMP_LS" ; then + if test -f "$SOURCE/content" -a -z "$TMP_LS" ; then # we already collected this above APPID=$DISTIDENT - elif test -f $SOURCE/$DESCRDIR/info ; then - set -- `fgrep DIST_IDENT $SOURCE/$DESCRDIR/info` + elif test -f "$SOURCE/$DESCRDIR/info" ; then + set -- `fgrep DIST_IDENT "$SOURCE/$DESCRDIR/info"` APPID=$2 else # If we have directory "update" in the second level, we assume # this is a Patch-CD if test ! -z "$TMP_LS" ; then - if test -f $SOURCE/media.1/patches ; then + if test -f "$SOURCE/media.1/patches" ; then APPID="`cat $SOURCE/media.1/patches | sed -e "s|/ ||g" | tr " " _`" else APPID="`cat $SOURCE/.S.u.S.E-disk-* | tr " " _`" @@ -294,23 +294,23 @@ fi fi if test -z "$APPID" \ - -a -f $SOURCE/$ROOT_ON_CD/MD5SUMS -a -f $SOURCE/.S.u.S.E-disk-* ; then - APPID=`cat $SOURCE/.S.u.S.E-disk-* | tr " " - | sed -e "s@-Version-@-@"` + -a -f "$SOURCE/$ROOT_ON_CD/MD5SUMS" -a -f "$SOURCE/.S.u.S.E-disk-*" ; then + APPID=`cat "$SOURCE/.S.u.S.E-disk-*" | tr " " - | sed -e "s@-Version-@-@"` APPID="$APPID.0#0" fi APPID=`echo $APPID | tr " " -` test -n "$APPID" && PARAMS="$PARAMS -A $APPID" - if test -f $SOURCE/content ; then + if test -f "$SOURCE/content" ; then MEDIANUMBER=1 - for i in $SOURCE/media.? ; do - test -d $i || continue - MEDIADIR=`ls -d $SOURCE/media.?` + for i in "$SOURCE/media.?" ; do + test -d "$i" || continue + MEDIADIR=`ls -d "$SOURCE/media.?"` MEDIANUMBER=${MEDIADIR##$SOURCE/media.} done VOL="0$MEDIANUMBER" - elif test -f $SOURCE/.S.u.S.E-disk-* ; then - BASE=`basename $SOURCE/.S.u.S.E-disk-*` + elif test -f "$SOURCE/.S.u.S.E-disk-*" ; then + BASE=`basename "$SOURCE/.S.u.S.E-disk-*"` VOL=`echo $BASE | cut -c 16-17` fi if test -n "$VOL" ; then @@ -344,7 +344,7 @@ mkisofs \ -p "$CD_PREPARER" \ $PUB_OPT "$CD_PUBLISHER" \ - $PARAMS -o $DEST $XPARAMS $SOURCE + $PARAMS -o "$DEST" $XPARAMS "$SOURCE" set +x Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/src/ProductCreator.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/product-creator/src/ProductCreator.ycp?rev=38157&r1=38156&r2=38157&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/product-creator/src/ProductCreator.ycp (original) +++ branches/SuSE-SLE-10-SP1-Branch/product-creator/src/ProductCreator.ycp Mon May 28 11:11:35 2007 @@ -390,8 +390,6 @@ } ); - y2internal("Escaped sources: %1", sources); - v["sources"] = sources; } @@ -623,6 +621,7 @@ boolean ExportPublicKey(string keyid, string dir) { + y2debug("ExportPublicKey: %1 to %2", keyid, dir); // export the public key boolean ret = GPG::ExportAsciiPublicKey(keyid, dir + "/content.key"); @@ -687,7 +686,7 @@ string meta_sha1 = SHA1Meta(dir, prod_dir); string key_sha1 = SHA1Key(dir); - string command = sformat("/usr/bin/grep -v -e '^KEY ' -e '^META ' %1/content", dir); + string command = sformat("/usr/bin/grep -v -e '^KEY ' -e '^META ' '%1/content'", String::Quote(dir)); map out = (map)SCR::Execute(.target.bash_output, command); if (out["exit"]:-1 != 0) { @@ -1029,7 +1028,7 @@ skel_root = sformat("%1/%2", Config["iso-directory"]:"", Config["name"]:""); SCR::Execute(.target.mkdir, skel_root); - Exec(sformat("/bin/mkdir -p %1/boot/%2", skel_root, arch)); + Exec(sformat("/bin/mkdir -p '%1/boot/%2'", String::Quote(skel_root), String::Quote(arch))); list<integer> enabled = Pkg::SourceGetCurrent(true); if (size(enabled) == 0 ) @@ -1043,18 +1042,18 @@ { if (Config["code10"]:false) { - Exec(sformat("/bin/mkdir -p %1/boot/%2/loader", skel_root, arch)); + Exec(sformat("/bin/mkdir -p '%1/boot/%2/loader'", String::Quote(skel_root), String::Quote(arch))); } else { - Exec(sformat("/bin/mkdir -p %1/boot/loader", skel_root)); + Exec(sformat("/bin/mkdir -p '%1/boot/loader'", String::Quote(skel_root))); } } else if (Arch::ppc() || Arch::ppc64()) { - Exec(sformat("/bin/mkdir -p %1/etc", skel_root)); - Exec(sformat("/bin/mkdir -p %1/ppc", skel_root)); - Exec(sformat("/bin/mkdir -p %1/suseboot", 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))); } // detect the base source @@ -1065,7 +1064,7 @@ foreach(integer srcid, string dir, product_map, { if (dir != "/") { - Exec(sformat("/bin/mkdir -p %1/%2", skel_root, dir)); + Exec(sformat("/bin/mkdir -p '%1/%2'", String::Quote(skel_root), String::Quote(dir))); } } ); @@ -1159,7 +1158,7 @@ // copy the descr directory - Exec(sformat("/bin/mkdir -p %1/%2", skel_root, descrDir)); + Exec(sformat("/bin/mkdir -p '%1/%2'", String::Quote(skel_root), String::Quote(descrDir))); CopyDirectoryRec(id, 1, descrDir, sformat("%1/%2", skel_root, UpDir(descrDir))); sp = true; @@ -1175,14 +1174,14 @@ descrDir = this_source["productData","descrdir"]:"suse/setup/descr"; dataDir = this_source["productData", "datadir"]:"suse"; y2debug("source data: %1", this_source["sourceData", "url"]:"" ); - success = (boolean)SCR::Execute(.target.mkdir, sformat("%1/%2", skel_root, dataDir)); + success = (boolean)SCR::Execute(.target.mkdir, sformat("'%1/%2'", String::Quote(skel_root), String::Quote(dataDir))); if (!success) { - y2error("Cannot create directory: %1", sformat("%1/%2", skel_root, dataDir)); + y2error("Cannot create directory: %1", sformat("'%1/%2'", String::Quote(skel_root), String::Quote(dataDir))); return false; } - Exec(sformat("/bin/mkdir -p %1/%2", skel_root, descrDir)); + Exec(sformat("/bin/mkdir -p '%1/%2'", String::Quote(skel_root), String::Quote(descrDir))); if (savespace) { @@ -1226,7 +1225,7 @@ // Prepare media files CopyDirectoryRec(id, 1, "media.1", skel_root); - Exec(sformat("/usr/bin/head -n 2 %1/media.1/media > %2/media.1/media.tmp && mv %2/media.1/media.tmp %2/media.1/media", skel_root, skel_root)); + Exec(sformat("/usr/bin/head -n 2 %1/media.1/media > %1/media.1/media.tmp && mv %1/media.1/media.tmp %1/media.1/media", String::Quote(skel_root))); } else { @@ -1326,7 +1325,7 @@ // copy descriptions string descrdir = meta[source_id, "productData","descrdir"]:"suse/setup/descr"; - Exec(sformat("/bin/mkdir -p %1/%2", skel_root, descrdir)); + Exec(sformat("/bin/mkdir -p '%1/%2'", String::Quote(skel_root), String::Quote(descrdir))); CopyDirectoryRec(source_id, 1, descrdir, sformat("%1/%2", skel_root, UpDir(descrdir))); string datadir = meta[source_id, "productData", "datadir"]:"suse"; @@ -1345,22 +1344,22 @@ if (l_slidedir != nil && l_slidedir != "") { // copy slide show - Exec(sformat("/bin/mkdir -p %1/%2", skel_root, slidedir)); - Exec(sformat("/bin/cp -a %1/* %2/%3", l_slidedir, skel_root, slidedir)); + 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(slidedir))); } } else { y2milestone("Slideshow is missing"); - Exec(sformat("/bin/mkdir -p %1/%2", skel_root, slidedir)); - Exec(sformat("> %1/%2/directory.yast", skel_root, slidedir)); + Exec(sformat("/bin/mkdir -p '%1/%2'", String::Quote(skel_root), String::Quote(slidedir))); + Exec(sformat("> '%1/%2/directory.yast'", String::Quote(skel_root), String::Quote(slidedir))); } } else { y2milestone("Save space - do not copy the slideshow"); - Exec(sformat("/bin/mkdir -p %1/%2", skel_root, slidedir)); - Exec(sformat("> %1/%2/directory.yast", skel_root, slidedir)); + Exec(sformat("/bin/mkdir -p '%1/%2'", String::Quote(skel_root), String::Quote(slidedir))); + Exec(sformat("> '%1/%2/directory.yast'", String::Quote(skel_root), String::Quote(slidedir))); } y2milestone("source: %1, descrDir: %2, skel_root: %3", source, descrDir, skel_root); @@ -1368,7 +1367,7 @@ // copy media.1 directory CopyDirectoryRec(source_id, 1, "media.1", skel_root); - Exec(sformat("/usr/bin/head -n 2 %1/media.1/media > %2/media.1/media.tmp && mv %2/media.1/media.tmp %2/media.1/media", skel_root, skel_root)); + Exec(sformat("/usr/bin/head -n 2 '%1/media.1/media' > '%1/media.1/media.tmp' && mv '%1/media.1/media.tmp' '%1/media.1/media'", String::Quote(skel_root))); // create a copy of the autoyast profile (the new profile accepts even unsigned source) string autoyast_copy = ""; @@ -1429,32 +1428,34 @@ if (autoyast_copy != "") { // save the original file and the copy - Exec(sformat("/bin/cp %1 %2/autoinst.xml", autoyast_copy, skel_root)); - Exec(sformat("/bin/cp %1 %2/autoinst.orig.xml", Config["profile"]:"", skel_root)); + Exec(sformat("/bin/cp -- '%1' '%2/autoinst.xml'", String::Quote(autoyast_copy), String::Quote(skel_root))); + Exec(sformat("/bin/cp -- '%1' '%2/autoinst.orig.xml'", String::Quote(Config["profile"]:""), String::Quote(skel_root))); } else { // save the original file (a copy is not available) - Exec(sformat("/bin/cp %1 %2/autoinst.xml", Config["profile"]:"", skel_root)); + Exec(sformat("/bin/cp '%1' '%2/autoinst.xml'", String::Quote(Config["profile"]:""), String::Quote(skel_root))); } } // Media nr. integer count = 1; - Exec(sformat("/bin/echo %1 >> %2/media.1/media ", count, skel_root)); + Exec(sformat("/bin/echo %1 >> '%2/media.1/media'", count, String::Quote(skel_root))); // make the source digitally unsigned (because signed descr/packages file has been modified) if (Config["code10"]:false) { // remove the key and the checksum - Exec(sformat("/bin/rm %1/content.asc %1/content.key", skel_root)); + Exec(sformat("/bin/rm '%1/content.asc' '%1/content.key'", String::Quote(skel_root))); // remove the meta information from content file - Exec(sformat("/usr/bin/grep -v -e '^KEY ' -e '^META ' %1/content > %1/content.new", skel_root)); - Exec(sformat("/bin/mv %1/content.new %1/content", skel_root)); + 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))); // recreate the index file - Exec(sformat("/bin/rm -f %1/directory.yast && /usr/bin/create_directory.yast %1", skel_root)); +// FIXME: use create_directory when it supports parameter with spaces +// Exec(sformat("/bin/rm -f '%1/directory.yast' && /usr/bin/create_directory.yast '%1'", String::Quote(skel_root))); + Exec(sformat("/bin/rm -f '%1/directory.yast'; cd '%1'; ls | grep -v -e '^\\.$' -e '^\\.\\.$' > '%1/directory.yast'", String::Quote(skel_root))); } @@ -1498,7 +1499,7 @@ if (!match) { // remove the pattern - string cmd = sformat("/bin/rm %1/%2/%3", skel_root, descrDir, f); + 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); y2debug("success: %1", success); @@ -1510,11 +1511,12 @@ if (refresh_diryast) { // regenerate directory.yast and patterns file - string cmd = sformat("/bin/rm -f '%1/%2/directory.yast' && /usr/bin/create_directory.yast '%1/%2'", String::Quote(skel_root), String::Quote(descrDir)); + // FIXME: string cmd = sformat("/bin/rm -f -- '%1/%2/directory.yast' && /usr/bin/create_directory.yast '%1/%2'", String::Quote(skel_root), String::Quote(descrDir)); + string cmd = sformat("/bin/rm -f '%1/%2/directory.yast'; cd '%1/%2'; ls | grep -v -e '^\\.$' -e '^\\.\\.$' > '%1/%2/directory.yast'", String::Quote(skel_root), String::Quote(descrDir)); success = success && Exec(cmd); y2debug("success: %1", success); - cmd = sformat("cd %1/%2; ls *.pat > %1/%2/patterns", skel_root, descrDir); + 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); } @@ -1525,6 +1527,8 @@ y2debug("success: %1", success); }); + skel_root = main_skel_root; + string addon_file = CreateAddonFile(product_map); if (size(addon_file) > 0) { @@ -1636,7 +1640,8 @@ if (success) { // update directory.yast file - string command = sformat("/bin/rm -f '%1/directory.yast' && /usr/bin/create_directory.yast '%1'", String::Quote(dir)); + // FIXME string command = sformat("/bin/rm -f '%1/directory.yast' && /usr/bin/create_directory.yast '%1'", String::Quote(dir)); + string command = sformat("/bin/rm -f '%1/directory.yast'; cd '%1'; ls | grep -v -e '^\\.$' -e '^\\.\\.$' > '%1/directory.yast'", String::Quote(dir)); y2milestone("Updating %1/directory.yast ...", dir); integer updated = (integer)SCR::Execute(.target.bash, command); y2milestone("Updated: %1", updated == 0); @@ -1739,13 +1744,13 @@ SCR::Write(.target.string, fname, Config["bootconfig"]:"" ); } cpCmd = (Config["code10"]:false) - ? sformat("cp %1/product-creator/message %2/boot/%3/loader", Directory::datadir, skel_root, arch) - : sformat("cp %1/product-creator/message %2/boot/loader", Directory::datadir, skel_root); + ? sformat("cp -- '%1/product-creator/message' '%2/boot/%3/loader'", String::Quote(Directory::datadir), String::Quote(skel_root), arch) + : sformat("cp -- '%1/product-creator/message' '%2/boot/loader'", String::Quote(Directory::datadir), String::Quote(skel_root)); SCR::Execute (.target.bash, cpCmd); cpCmd = (Config["code10"]:false) - ? sformat("cp %1/product-creator/options.msg %2/boot/%3/loader", Directory::datadir, skel_root, arch) - : sformat("cp %1/product-creator/options.msg %2/boot/loader", Directory::datadir, skel_root); + ? sformat("cp -- '%1/product-creator/options.msg' '%2/boot/%3/loader'", String::Quote(Directory::datadir), String::Quote(skel_root), arch) + : sformat("cp -- '%1/product-creator/options.msg' '%2/boot/loader'", String::Quote(Directory::datadir), String::Quote(skel_root)); SCR::Execute (.target.bash, cpCmd); @@ -1917,7 +1922,7 @@ global boolean removeDestination() { string isodir = Config["iso-directory"]:"" + "/" + Config["name"]:""; - return (integer)SCR::Execute(.target.bash, "rm -rf " + isodir ) == 0; + return (integer)SCR::Execute(.target.bash, sformat("rm -rf -- '%1'", String::Quote(isodir)) ) == 0; } global boolean confirmDestinationRemoving() @@ -2100,7 +2105,7 @@ break; } - string cpCmd = sformat("cp -a %1 %2", l_packge, dir ); + string cpCmd = sformat("cp -a '%1' '%2'", String::Quote(l_packge), String::Quote(dir) ); y2debug("%1", cpCmd); @@ -2126,13 +2131,13 @@ // regenerate the metadata if (general_info["type"]:"" == "YUM") { - ret = ret && Exec(sformat("/usr/bin/createrepo %1/%2", basedir, subdir)); + ret = ret && Exec(sformat("/usr/bin/createrepo '%1/%2'", String::Quote(basedir), String::Quote(subdir))); } 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", - basedir, subdir, datadir)); + 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))); } } ); Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/src/complex.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/product-creator/src/complex.ycp?rev=38157&r1=38156&r2=38157&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/product-creator/src/complex.ycp (original) +++ branches/SuSE-SLE-10-SP1-Branch/product-creator/src/complex.ycp Mon May 28 11:11:35 2007 @@ -16,6 +16,7 @@ import "Wizard_hw"; import "Report"; import "Arch"; + import "String"; import "ProductCreator"; @@ -107,7 +108,7 @@ contents = Wizard_hw::SpacingAround(contents2, 1.5, 1.5, 1.0, 1.0); Wizard::SetContentsButtons(caption, contents, HELPS["overview"]:"", - Label::BackButton(), Label::FinishButton()); + Label::BackButton(), Label::CloseButton()); if (size(overview) == 0 ) { @@ -334,7 +335,7 @@ string pub = ProductCreator::Config["publisher"]:"anon"; string prep = ProductCreator::Config["preparer"]:"anon"; - map output = (map)SCR::Execute(.target.bash_output, sformat("du -s -b %1 | awk -F' ' ' { printf $1 }'", isodir )); + map output = (map)SCR::Execute(.target.bash_output, sformat("du -s -b '%1' | awk -F' ' ' { printf $1 }'", String::Quote(isodir) )); string du = output["stdout"]:""; y2milestone("Expected size: %1", du); @@ -343,7 +344,7 @@ Popup::ShowFeedback(_("Creating CD Image..."), _("This may take a while")); } - string command = sformat("/usr/lib/YaST2/bin/y2mkiso %1 %2 %3", isodir, isofile, (ProductCreator::Config["code10"]:false) ? Arch::architecture() : ""); + 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 ]); Modified: branches/SuSE-SLE-10-SP1-Branch/product-creator/src/wizards.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/product-creator/src/wizards.ycp?rev=38157&r1=38156&r2=38157&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/product-creator/src/wizards.ycp (original) +++ branches/SuSE-SLE-10-SP1-Branch/product-creator/src/wizards.ycp Mon May 28 11:11:35 2007 @@ -239,7 +239,8 @@ Wizard::CreateDialog(); Wizard::SetDesktopIcon("cd-creator"); - if (!Package::InstallAll(["inst-source-utils", "mkisofs"])) + // .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.")); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org