diff --git a/handlers/enzyme b/handlers/enzyme index ab340974c..eca20cf21 100644 --- a/handlers/enzyme +++ b/handlers/enzyme @@ -71,7 +71,7 @@ if (options[0] == "world"): sys.exit(0) # sync tool elif (options[0] == "sync"): - enzymeTools.sync() + enzymeTools.sync(options) sys.exit(0) # add other options here diff --git a/libraries/enzymeTools.py b/libraries/enzymeTools.py index ceba36ad7..8970f3a0c 100644 --- a/libraries/enzymeTools.py +++ b/libraries/enzymeTools.py @@ -52,7 +52,14 @@ def getSyncTime(): # fetch the latest updates from Gentoo rsync mirrors -def sync(): +def sync(options): + syncMiscRedirect = "/dev/null" + for i in options: + if i.startswith("--verbose") or i.startswith("-v"): + syncMiscRedirect = None print_info(green("syncing the Portage tree at: "+etpConst['portagetreedir'])) - rc = spawnCommand(vdbPORTDIR+"="+etpConst['portagetreedir']+" "+cdbEMERGE+" --sync", redirect = "/dev/null") + rc = spawnCommand(vdbPORTDIR+"="+etpConst['portagetreedir']+" "+cdbEMERGE+" --sync ", redirect = syncMiscRedirect) # redirect = "/dev/null" + if (rc != 0): + print_error(red("an error occoured while syncing the Portage tree. Are you sure that your Internet connection works?")) + sys.exit(101) \ No newline at end of file