aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdano Arendartchuk <bogdano@mandriva.org>2007-06-12 18:17:48 +0000
committerBogdano Arendartchuk <bogdano@mandriva.org>2007-06-12 18:17:48 +0000
commit20e7ded57ec45a0c2bbe942b5234814aea275217 (patch)
tree7833766ce97e2ae77f5300dd580bfa8ec47bc315
parent56082bc3c339c8273260449baf880096fa2375ba (diff)
downloadmgarepo-20e7ded57ec45a0c2bbe942b5234814aea275217.tar
mgarepo-20e7ded57ec45a0c2bbe942b5234814aea275217.tar.gz
mgarepo-20e7ded57ec45a0c2bbe942b5234814aea275217.tar.bz2
mgarepo-20e7ded57ec45a0c2bbe942b5234814aea275217.tar.xz
mgarepo-20e7ded57ec45a0c2bbe942b5234814aea275217.zip
Don't use mirror in 'co' when the user provides one URL
(unintended bonus: fixed typo in RepSys/svn.py)
-rw-r--r--RepSys/commands/co.py2
-rw-r--r--RepSys/rpmutil.py9
-rw-r--r--RepSys/svn.py2
3 files changed, 9 insertions, 4 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 40aa4fe..a74f266 100644
--- a/RepSys/rpmutil.py
+++ b/RepSys/rpmutil.py
@@ -6,6 +6,7 @@ from RepSys.simplerpm import SRPM
from RepSys.log import specfile_svn2rpm
from RepSys.util import execcmd
import pysvn
+from RepSys.command import default_parent
import rpm
import tempfile
import shutil
@@ -360,13 +361,17 @@ def check_changed(pkgdirurl, all=0, show=0, verbose=0):
"nopristine": nopristine}
def checkout(pkgdirurl, path=None, revision=None):
- svn = SVN()
+ 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()
svn.checkout(current, path, revision=SVN.makerev(revision), show=1)
def _getpkgtopdir(basedir=None):
diff --git a/RepSys/svn.py b/RepSys/svn.py
index 575651f..8589c4a 100644
--- a/RepSys/svn.py
+++ b/RepSys/svn.py
@@ -161,7 +161,7 @@ class SVN:
# add one keywork "silent" that workaround the strange behavior of
# pysvn's get_all, which seems to be broken, this way we also have
# the same interface of svn.py from repsys 1.6.x
- meth = self._cllient_wrap("status")
+ meth = self._client_wrap("status")
silent = kwargs.pop("silent", None)
st = meth(*args, **kwargs)
if silent: