Add --url option
authorRob Cakebread <pythonhead@gentoo.org>
Fri, 22 Aug 2008 18:34:14 +0000 (18:34 +0000)
committerRob Cakebread <pythonhead@gentoo.org>
Fri, 22 Aug 2008 18:34:14 +0000 (18:34 +0000)
git-svn-id: http://g-pypi.googlecode.com/svn/trunk@25 118783bc-b352-0410-bbc3-0f610f6f7ae8

g_pypi/cli.py

index f9e0da3ea97923ff07f897d59c1d55a50db2ec2c..38c06d8d3927557e1c68542453f6ef02ade00c27 100755 (executable)
@@ -144,7 +144,9 @@ class GPyPI(object):
                             self.logger.info("Skipping dependency (exists): %s" % req.project_name)
                     else:
                         self.add_dep(req.project_name)
+            #Only force overwriting and category on first ebuild created, not dependencies
             self.options.overwrite = False
+            self.options.category = None
 
     def add_dep(self, project_name):
         '''Add dependency'''
@@ -248,7 +250,10 @@ class GPyPI(object):
         else:
             self.version = get_highest_version(versions)
 
-        download_url = self.get_uri()
+        if self.options.uri:
+            download_url = self.options.uri
+        else:
+            download_url = self.get_uri()
         try:
             ebuild = Ebuild(self.package_name, self.version, download_url)
         except portage_exception.InvalidVersionString:
@@ -354,6 +359,10 @@ def main():
                          "my_p", default=False, help=
                          "Specify MY_P")
 
+    opt_parser.add_option("-u", "--uri", action='store', dest=
+                         "uri", default=False, help=
+                         "Specify URI of package if PyPI doesn't have it.")
+
     opt_parser.add_option("-l", "--overlay", action='store', dest=
                          'overlay', metavar='OVERLAY_NAME', default=None, help=
                          'Specify overy to use by name ($OVERLAY/profiles/repo_name)')