diff options
author | Bogdano Arendartchuk <bogdano@mandriva.org> | 2007-06-12 18:59:27 +0000 |
---|---|---|
committer | Bogdano Arendartchuk <bogdano@mandriva.org> | 2007-06-12 18:59:27 +0000 |
commit | f7ab5b0c279fe21bfbb65082a512eccabcad5001 (patch) | |
tree | 2b1002a040aa1ea5453a19ddb533e6bee88e7b94 | |
parent | ae42a1c062d852e928e81c81546caa80fcbf3fa2 (diff) | |
download | mgarepo-f7ab5b0c279fe21bfbb65082a512eccabcad5001.tar mgarepo-f7ab5b0c279fe21bfbb65082a512eccabcad5001.tar.gz mgarepo-f7ab5b0c279fe21bfbb65082a512eccabcad5001.tar.bz2 mgarepo-f7ab5b0c279fe21bfbb65082a512eccabcad5001.tar.xz mgarepo-f7ab5b0c279fe21bfbb65082a512eccabcad5001.zip |
Don't use mirror in 'co' when the user provides one URL
-rw-r--r-- | RepSys/commands/co.py | 2 | ||||
-rw-r--r-- | RepSys/rpmutil.py | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/RepSys/commands/co.py b/RepSys/commands/co.py index f2b4d64..693897a 100644 --- a/RepSys/commands/co.py +++ b/RepSys/commands/co.py @@ -23,7 +23,7 @@ def parse_options(): opts, args = parser.parse_args() if len(args) not in (1, 2): raise Error, "invalid arguments" - opts.pkgdirurl = default_parent(args[0]) + opts.pkgdirurl = args[0] if len(args) == 2: opts.path = args[1] else: diff --git a/RepSys/rpmutil.py b/RepSys/rpmutil.py index 671908f..fd06627 100644 --- a/RepSys/rpmutil.py +++ b/RepSys/rpmutil.py @@ -5,6 +5,7 @@ from RepSys.svn import SVN from RepSys.simplerpm import SRPM from RepSys.log import specfile_svn2rpm from RepSys.util import execcmd +from RepSys.command import default_parent import rpm import tempfile import shutil @@ -361,13 +362,17 @@ def check_changed(pkgdirurl, all=0, show=0, verbose=0): "nopristine": nopristine} def checkout(pkgdirurl, path=None, revision=None): - svn = SVN(baseurl=pkgdirurl) + o_pkgdirurl = pkgdirurl + pkgdirurl = default_parent(o_pkgdirurl) current = os.path.join(pkgdirurl, "current") if path is None: _, path = os.path.split(pkgdirurl) - if mirror.enabled(): + # if default_parent changed the URL, we can use mirrors because the + # user did not provided complete package URL + if (o_pkgdirurl != pkgdirurl) and mirror.enabled(): current = mirror.checkout_url(current) print "checking out from mirror", current + svn = SVN(baseurl=pkgdirurl) svn.checkout(current, path, rev=revision, show=1) def _getpkgtopdir(basedir=None): |