aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-08-17 20:02:58 +0000
committerNicolas Vigier <boklm@mageia.org>2011-08-17 20:02:58 +0000
commitf49e46ffa17a2fec832f341ee49cabdd0c5818ac (patch)
treeb5b916c4fcdcecc23e575ba2ae150007aa8a5602
parentbfa821f2fa82b8ad217b3f5637f70282a7ebf8ed (diff)
downloadmgarepo-f49e46ffa17a2fec832f341ee49cabdd0c5818ac.tar
mgarepo-f49e46ffa17a2fec832f341ee49cabdd0c5818ac.tar.gz
mgarepo-f49e46ffa17a2fec832f341ee49cabdd0c5818ac.tar.bz2
mgarepo-f49e46ffa17a2fec832f341ee49cabdd0c5818ac.tar.xz
mgarepo-f49e46ffa17a2fec832f341ee49cabdd0c5818ac.zip
update import_binaries for new binrepo
-rw-r--r--MgaRepo/binrepo.py46
-rw-r--r--MgaRepo/rpmutil.py2
2 files changed, 8 insertions, 40 deletions
diff --git a/MgaRepo/binrepo.py b/MgaRepo/binrepo.py
index d621f21..8af59ff 100644
--- a/MgaRepo/binrepo.py
+++ b/MgaRepo/binrepo.py
@@ -170,49 +170,15 @@ def upload_binary(topdir, filename):
def import_binaries(topdir, pkgname):
"""Import all binaries from a given package checkout
- (with pending svn adds)
-
@topdir: the path to the svn checkout
"""
- svn = SVN()
- topurl = translate_topdir(topdir)
sourcesdir = os.path.join(topdir, "SOURCES")
- bintopdir = tempfile.mktemp("repsys")
- try:
- svn.checkout(topurl, bintopdir)
- checkout = True
- except Error:
- bintopdir = tempfile.mkdtemp("repsys")
- checkout = False
- try:
- bindir = os.path.join(bintopdir, BINARIES_DIR_NAME)
- if not os.path.exists(bindir):
- if checkout:
- svn.mkdir(bindir)
- else:
- os.mkdir(bindir)
- binaries = find_binaries([sourcesdir])
- update = update_sources_threaded(topdir, added=binaries)
- for path in binaries:
- name = os.path.basename(path)
- binpath = os.path.join(bindir, name)
- os.rename(path, binpath)
- try:
- svn.remove(path)
- except Error:
- # file not tracked
- svn.revert(path)
- if checkout:
- svn.add(binpath)
- log = "imported binaries for %s" % pkgname
- if checkout:
- rev = svn.commit(bindir, log=log)
- else:
- rev = svn.import_(bintopdir, topurl, log=log)
- update.join()
- svn.add(sources_path(topdir))
- finally:
- shutil.rmtree(bintopdir)
+ binaries = find_binaries([sourcesdir])
+ for path in binaries:
+ upload_binary(topdir, os.path.basename(path))
+ update_sources(topdir, added=binaries)
+ svn = SVN()
+ svn.add(sources_path(topdir))
def parse_sources(path):
entries = {}
diff --git a/MgaRepo/rpmutil.py b/MgaRepo/rpmutil.py
index 2442efb..a05511a 100644
--- a/MgaRepo/rpmutil.py
+++ b/MgaRepo/rpmutil.py
@@ -258,6 +258,8 @@ def put_srpm(srpmfile, markrelease=False, striplog=True, branch=None,
for entry in [x for x in usourcesentries
if x not in sourcesentries]:
entrypath = os.path.join(sourcesdir, entry)
+ if binrepo.is_binary(entrypath):
+ continue
svn.add(entrypath)
finally:
if os.path.isdir(unpackdir):