[yum-cvs] yum-utils yumdownloader.py,1.2,1.3
Seth Vidal
skvidal at login.linux.duke.edu
Sun Apr 10 06:13:22 UTC 2005
Update of /home/groups/yum/cvs/yum-utils
In directory login:/tmp/cvs-serv10743
Modified Files:
yumdownloader.py
Log Message:
added --urls option to yumdownloader to just print out the urls it would
download
Index: yumdownloader.py
===================================================================
RCS file: /home/groups/yum/cvs/yum-utils/yumdownloader.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- yumdownloader.py 1 Apr 2005 10:19:50 -0000 1.2
+++ yumdownloader.py 10 Apr 2005 06:13:20 -0000 1.3
@@ -23,6 +23,7 @@
from yum.logger import Logger
from yum.packages import parsePackages, returnBestPackages
from optparse import OptionParser
+from urlparse import urljoin
def initYum():
my = yum.YumBase()
@@ -44,6 +45,8 @@
parser = OptionParser(usage=usage)
parser.add_option("--destdir", default=".", dest="destdir",
help='destination directory (defaults to current directory)')
+ parser.add_option("--urls", default=False, dest="urls", action="store_true",
+ help='just list the urls it would download instead of downloading')
(opts, args) = parser.parse_args()
if len(args) < 1:
parser.print_help()
@@ -74,6 +77,10 @@
for download in packages:
repo = my.repos.getRepo(download.repoid)
remote = download.returnSimple('relativepath')
+ if opts.urls:
+ url = urljoin(repo.urls[0],remote)
+ my.log(0, '%s' % url)
+ continue
local = os.path.basename(remote)
local = os.path.join(opts.destdir, local)
if (os.path.exists(local) and
More information about the Yum-cvs-commits
mailing list