diff options
Diffstat (limited to 'zarb-ml/mageia-sysadm/2011-January/002447.html')
-rw-r--r-- | zarb-ml/mageia-sysadm/2011-January/002447.html | 173 |
1 files changed, 173 insertions, 0 deletions
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 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<HTML> + <HEAD> + <TITLE> [Mageia-sysadm] [342] add binrepo remove function + </TITLE> + <LINK REL="Index" HREF="index.html" > + <LINK REL="made" HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B342%5D%20add%20binrepo%20remove%20function&In-Reply-To=%3C20110125181400.D98CF43115%40valstar.mageia.org%3E"> + <META NAME="robots" CONTENT="index,nofollow"> + <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> + <LINK REL="Previous" HREF="002446.html"> + <LINK REL="Next" HREF="002449.html"> + </HEAD> + <BODY BGCOLOR="#ffffff"> + <H1>[Mageia-sysadm] [342] add binrepo remove function</H1> + <B>root at mageia.org</B> + <A HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B342%5D%20add%20binrepo%20remove%20function&In-Reply-To=%3C20110125181400.D98CF43115%40valstar.mageia.org%3E" + TITLE="[Mageia-sysadm] [342] add binrepo remove function">root at mageia.org + </A><BR> + <I>Tue Jan 25 19:14:00 CET 2011</I> + <P><UL> + <LI>Previous message: <A HREF="002446.html">[Mageia-sysadm] [341] update description +</A></li> + <LI>Next message: <A HREF="002449.html">[Mageia-sysadm] [343] don't set uses-binrepo svn property as every package is using binrepo +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#2447">[ date ]</a> + <a href="thread.html#2447">[ thread ]</a> + <a href="subject.html#2447">[ subject ]</a> + <a href="author.html#2447">[ author ]</a> + </LI> + </UL> + <HR> +<!--beginarticle--> +<PRE>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> +</PRE> + + + + + + + + + + + + +<!--endarticle--> + <HR> + <P><UL> + <!--threads--> + <LI>Previous message: <A HREF="002446.html">[Mageia-sysadm] [341] update description +</A></li> + <LI>Next message: <A HREF="002449.html">[Mageia-sysadm] [343] don't set uses-binrepo svn property as every package is using binrepo +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#2447">[ date ]</a> + <a href="thread.html#2447">[ thread ]</a> + <a href="subject.html#2447">[ subject ]</a> + <a href="author.html#2447">[ author ]</a> + </LI> + </UL> + +<hr> +<a href="https://www.mageia.org/mailman/listinfo/mageia-sysadm">More information about the Mageia-sysadm +mailing list</a><br> +</body></html> |