From 1be510f9529cb082f802408b472a77d074b394c0 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Sun, 14 Apr 2013 13:46:12 +0000 Subject: Add zarb MLs html archives --- zarb-ml/mageia-sysadm/2011-January/002447.html | 173 +++++++++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 zarb-ml/mageia-sysadm/2011-January/002447.html (limited to 'zarb-ml/mageia-sysadm/2011-January/002447.html') diff --git a/zarb-ml/mageia-sysadm/2011-January/002447.html b/zarb-ml/mageia-sysadm/2011-January/002447.html new file mode 100644 index 000000000..8198432b5 --- /dev/null +++ b/zarb-ml/mageia-sysadm/2011-January/002447.html @@ -0,0 +1,173 @@ + + + + [Mageia-sysadm] [342] add binrepo remove function + + + + + + + + + +

[Mageia-sysadm] [342] add binrepo remove function

+ root at mageia.org + root at mageia.org +
+ Tue Jan 25 19:14:00 CET 2011 +

+
+ +
Revision: 342
+Author:   boklm
+Date:     2011-01-25 19:14:00 +0100 (Tue, 25 Jan 2011)
+Log Message:
+-----------
+add binrepo remove function
+
+Modified Paths:
+--------------
+    build_system/mgarepo/trunk/MgaRepo/binrepo.py
+    build_system/mgarepo/trunk/MgaRepo/commands/del.py
+    build_system/mgarepo/trunk/MgaRepo/rpmutil.py
+
+Modified: build_system/mgarepo/trunk/MgaRepo/binrepo.py
+===================================================================
+--- build_system/mgarepo/trunk/MgaRepo/binrepo.py	2011-01-25 17:00:15 UTC (rev 341)
++++ build_system/mgarepo/trunk/MgaRepo/binrepo.py	2011-01-25 18:14:00 UTC (rev 342)
+@@ -287,7 +287,8 @@
+         entries = parse_sources(path)
+     f = open(path, "w") # open before calculating hashes
+     for name in removed:
+-        entries.pop(removed)
++	if name in entries:
++           del entries[name]
+     for added_path in added:
+         name = os.path.basename(added_path)
+         entries[name] = file_hash(added_path)
+@@ -301,6 +302,29 @@
+     t.join()
+     return t
+ 
++def remove(path, message=None, commit=True):
++    from MgaRepo.rpmutil import getpkgtopdir
++    svn = SVN()
++    if not os.path.exists(path):
++        raise Error, "not found: %s" % path
++    bpath = os.path.basename(path)
++    topdir = getpkgtopdir()
++    bintopdir = translate_topdir(topdir)
++    update = update_sources_threaded(topdir, removed=[bpath])
++    sources = sources_path(topdir)
++    silent = config.get("log", "ignore-string", "SILENT")
++    if not message:
++        message = "%s: delete binary file %s" % (silent, bpath)
++    if commit:
++        svn.commit(topdir + " " + sources, log=message, nonrecursive=True)
++    binlink = os.path.join(topdir, "SOURCES", bpath)
++    if os.path.islink(binlink):
++        os.unlink(binlink)
++    binpath = os.path.join(topdir, BINARIES_CHECKOUT_NAME, bpath)
++    svn.remove(binpath)
++    if commit:
++       svn.commit(binpath, log=message)
++
+ def upload(path, message=None):
+     from MgaRepo.rpmutil import getpkgtopdir
+     svn = SVN()
+
+Modified: build_system/mgarepo/trunk/MgaRepo/commands/del.py
+===================================================================
+--- build_system/mgarepo/trunk/MgaRepo/commands/del.py	2011-01-25 17:00:15 UTC (rev 341)
++++ build_system/mgarepo/trunk/MgaRepo/commands/del.py	2011-01-25 18:14:00 UTC (rev 342)
+@@ -7,18 +7,13 @@
+ 
+ Remove a given file from the binary sources repository.
+ 
+-Changes in the sources file will be left uncommited.
+-
+ Options:
+-    -c      automatically commit the 'sources' file
+     -h      help
+ 
+ """
+ 
+ def parse_options():
+     parser = OptionParser(help=HELP)
+-    parser.add_option("-c", dest="commit", default=False,
+-            action="store_true")
+     opts, args = parser.parse_args()
+     if len(args):
+         opts.paths = args
+
+Modified: build_system/mgarepo/trunk/MgaRepo/rpmutil.py
+===================================================================
+--- build_system/mgarepo/trunk/MgaRepo/rpmutil.py	2011-01-25 17:00:15 UTC (rev 341)
++++ build_system/mgarepo/trunk/MgaRepo/rpmutil.py	2011-01-25 18:14:00 UTC (rev 342)
+@@ -666,16 +666,10 @@
+         binrepo.upload(path)
+ 
+ def binrepo_delete(paths, commit=False):
+-    #TODO handle files tracked by svn
+     refurl = binrepo.svn_root(paths[0])
+     if not binrepo.enabled(refurl):
+         raise Error, "binary repository is not enabled for %s" % refurl
+-    added, deleted = binrepo.remove(paths)
+-    if commit:
+-        svn = SVN()
+-        spath = binrepo.sources_path(paths[0])
+-        log = _sources_log(added, deleted)
+-        svn.commit(spath, log=log)
++    binrepo.remove(paths[0])
+ 
+ def switch(mirrorurl=None):
+     svn  = SVN()
+-------------- next part --------------
+An HTML attachment was scrubbed...
+URL: </pipermail/mageia-sysadm/attachments/20110125/7a91e184/attachment-0001.html>
+
+ + + + + + + + + + + + + +
+

+ +
+More information about the Mageia-sysadm +mailing list
+ -- cgit v1.2.1