aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-01-27 22:04:38 +0000
committerNicolas Vigier <boklm@mageia.org>2011-01-27 22:04:38 +0000
commit997ebea7a09b1390e4a202429b4bfa1e0ff2db96 (patch)
tree9e3b0d0eb62d984b93b726d65795d103048e1088
parentf81735f238927eface0fb987bb062163bdc8dc68 (diff)
downloadmgarepo-997ebea7a09b1390e4a202429b4bfa1e0ff2db96.tar
mgarepo-997ebea7a09b1390e4a202429b4bfa1e0ff2db96.tar.gz
mgarepo-997ebea7a09b1390e4a202429b4bfa1e0ff2db96.tar.bz2
mgarepo-997ebea7a09b1390e4a202429b4bfa1e0ff2db96.tar.xz
mgarepo-997ebea7a09b1390e4a202429b4bfa1e0ff2db96.zip
make upload and binrepo_delete functions work on text files too
-rw-r--r--MgaRepo/rpmutil.py24
1 files changed, 20 insertions, 4 deletions
diff --git a/MgaRepo/rpmutil.py b/MgaRepo/rpmutil.py
index 1515183..14789f3 100644
--- a/MgaRepo/rpmutil.py
+++ b/MgaRepo/rpmutil.py
@@ -661,16 +661,32 @@ def update(target=None):
url = info["URL"]
download_binaries(br_target, url)
-def upload(paths):
+def upload(paths, commit=True):
for path in paths:
- binrepo.upload(path)
+ if os.path.isdir(path) or binrepo.is_binary(path):
+ binrepo.upload(path, commit=commit)
+ else:
+ svn = SVN()
+ svn.add(path, local=True)
+ if commit:
+ silent = config.get("log", "ignore-string", "SILENT")
+ message = "%s: new file %s" % (silent, path)
+ svn.commit(path, log=message)
-def binrepo_delete(paths, commit=False):
+def binrepo_delete(paths, commit=True):
refurl = binrepo.svn_root(paths[0])
if not binrepo.enabled(refurl):
raise Error, "binary repository is not enabled for %s" % refurl
for path in paths:
- binrepo.remove(path)
+ if binrepo.is_binary(path):
+ binrepo.remove(path, commit=commit)
+ else:
+ svn = SVN()
+ svn.remove(path, local=True)
+ if commit:
+ silent = config.get("log", "ignore-string", "SILENT")
+ message = "%s: delete file %s" % (silent, path)
+ svn.commit(path, log=message)
def switch(mirrorurl=None):
svn = SVN()