diff options
-rw-r--r-- | MgaRepo/binrepo.py | 46 | ||||
-rw-r--r-- | MgaRepo/rpmutil.py | 2 |
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): |