X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=febootstrap_yum_rpm.ml;h=075e4e0def7a47e27e6e7c76479e98849b5bf23c;hb=155b6952bb3fde46cee675c353e2462a09172c50;hp=43021ccee7c127f13d582e4d47a5452b0534383e;hpb=66a9d53e48f14d7fe1d9f4b801a1c5582d83efa6;p=febootstrap.git diff --git a/febootstrap_yum_rpm.ml b/febootstrap_yum_rpm.ml index 43021cc..075e4e0 100644 --- a/febootstrap_yum_rpm.ml +++ b/febootstrap_yum_rpm.ml @@ -34,13 +34,14 @@ let yum_rpm_detect () = let yum_rpm_resolve_dependencies_and_download names = (* Liberate this data from python. *) - let py = " + let py = sprintf " import yum import yum.misc import sys yb = yum.YumBase () -#yum.logginglevels.setDebugLevel(0) -- doesn't work? +yb.preconf.debuglevel = %d +yb.preconf.errorlevel = %d # Look up the base packages from the command line. deps = dict () @@ -68,10 +69,10 @@ while not stable: # Write it to a file because yum spews garbage on stdout. f = open (sys.argv[1], \"w\") for pkg in deps.keys (): - f.write (\"%s %s %s %s %s\\n\" % + f.write (\"%%s %%s %%s %%s %%s\\n\" %% (pkg.name, pkg.epoch, pkg.version, pkg.release, pkg.arch)) f.close () -" in +" (if verbose then 1 else 0) (if verbose then 1 else 0) in let tmpfile = tmpdir // "names.tmp" in run_python py (tmpfile :: names); let chan = open_in tmpfile in @@ -136,7 +137,8 @@ f.close () exit 1 ); - let cmd = sprintf "yumdownloader --destdir %s %s" + let cmd = sprintf "yumdownloader%s --destdir %s %s" + (if verbose then "" else " --quiet") (Filename.quote tmpdir) (String.concat " " (List.map Filename.quote pkgnames)) in run_command cmd;