aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdano Arendartchuk <bogdano@mandriva.org>2007-11-13 03:55:10 +0000
committerBogdano Arendartchuk <bogdano@mandriva.org>2007-11-13 03:55:10 +0000
commit5ec755581655de76a2ce21fdc9ae5ac502db5f9d (patch)
tree741aba61e568b49203ac2d26192a4025210a476b
parentcc444f69b7afc33401ff8eaa2f6c8b14a4e9b46e (diff)
downloadmgarepo-5ec755581655de76a2ce21fdc9ae5ac502db5f9d.tar
mgarepo-5ec755581655de76a2ce21fdc9ae5ac502db5f9d.tar.gz
mgarepo-5ec755581655de76a2ce21fdc9ae5ac502db5f9d.tar.bz2
mgarepo-5ec755581655de76a2ce21fdc9ae5ac502db5f9d.tar.xz
mgarepo-5ec755581655de76a2ce21fdc9ae5ac502db5f9d.zip
Fixed get_submit_info to use the new SVN code.
-Esta linha, e as abaixo, serĂ£o ignoradas-- M RepSys/rpmutil.py
-rw-r--r--RepSys/rpmutil.py33
1 files changed, 15 insertions, 18 deletions
diff --git a/RepSys/rpmutil.py b/RepSys/rpmutil.py
index 86fb890..4cbba62 100644
--- a/RepSys/rpmutil.py
+++ b/RepSys/rpmutil.py
@@ -483,33 +483,30 @@ def get_submit_info(path):
if not os.path.isdir(os.path.join(path, ".svn")):
raise Error, "subversion directory not found"
+ # Now, extract the package name.
svn = SVN()
+ info = svn.info(path)
-
- # Now, extract the package name.
- for line in svn.info(path):
- if line.startswith("URL: "):
- url = line.split()[1]
- toks = url.split("/")
- if len(toks) < 2 or toks[-1] != "current":
- raise Error, "unexpected URL received from 'svn info'"
- name = toks[-2]
- break
- else:
- raise Error, "URL tag not found in 'svn info' output"
+ url = info.url
+ toks = url.split("/")
+ if len(toks) < 2 or toks[-1] != "current":
+ raise Error, "invalid package URL %s, needs current/" % url
+ name = toks[-2]
# Finally, guess revision.
max = -1
files = []
files.extend(glob.glob("%s/*" % specsdir))
files.extend(glob.glob("%s/*" % sourcesdir))
- for line in svn.info(" ".join(files)):
- if line.startswith("Revision: "):
- rev = int(line.split()[1])
- if rev > max:
- max = rev
+ for file in files:
+ info = svn.info(file)
+ if info is None: # not in working copy
+ continue
+ rev = info.commit_revision.number
+ if rev > max:
+ max = rev
if max == -1:
- raise Error, "revision tag not found in 'svn info' output"
+ raise Error, "unable to find the latest revision"
return name, max