diff options
Diffstat (limited to 'zarb-ml/mageia-sysadm/2011-January/002475.html')
-rw-r--r-- | zarb-ml/mageia-sysadm/2011-January/002475.html | 173 |
1 files changed, 173 insertions, 0 deletions
diff --git a/zarb-ml/mageia-sysadm/2011-January/002475.html b/zarb-ml/mageia-sysadm/2011-January/002475.html new file mode 100644 index 000000000..b9dd8f5d1 --- /dev/null +++ b/zarb-ml/mageia-sysadm/2011-January/002475.html @@ -0,0 +1,173 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<HTML> + <HEAD> + <TITLE> [Mageia-sysadm] [362] fix sync + </TITLE> + <LINK REL="Index" HREF="index.html" > + <LINK REL="made" HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B362%5D%20fix%20sync&In-Reply-To=%3C20110127224745.0CD3D4331F%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="002474.html"> + <LINK REL="Next" HREF="002476.html"> + </HEAD> + <BODY BGCOLOR="#ffffff"> + <H1>[Mageia-sysadm] [362] fix sync</H1> + <B>root at mageia.org</B> + <A HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B362%5D%20fix%20sync&In-Reply-To=%3C20110127224745.0CD3D4331F%40valstar.mageia.org%3E" + TITLE="[Mageia-sysadm] [362] fix sync">root at mageia.org + </A><BR> + <I>Thu Jan 27 23:47:45 CET 2011</I> + <P><UL> + <LI>Previous message: <A HREF="002474.html">[Mageia-sysadm] [361] rename binrepo_delete as it is not only for binrepo +</A></li> + <LI>Next message: <A HREF="002476.html">[Mageia-sysadm] [363] rename ci option to commit +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#2475">[ date ]</a> + <a href="thread.html#2475">[ thread ]</a> + <a href="subject.html#2475">[ subject ]</a> + <a href="author.html#2475">[ author ]</a> + </LI> + </UL> + <HR> +<!--beginarticle--> +<PRE>Revision: 362 +Author: boklm +Date: 2011-01-27 23:47:44 +0100 (Thu, 27 Jan 2011) +Log Message: +----------- +fix sync + +Modified Paths: +-------------- + build_system/mgarepo/trunk/MgaRepo/rpmutil.py + +Modified: build_system/mgarepo/trunk/MgaRepo/rpmutil.py +=================================================================== +--- build_system/mgarepo/trunk/MgaRepo/rpmutil.py 2011-01-27 22:06:10 UTC (rev 361) ++++ build_system/mgarepo/trunk/MgaRepo/rpmutil.py 2011-01-27 22:47:44 UTC (rev 362) +@@ -499,9 +499,7 @@ + names = os.listdir(path) + return (".svn" in names and "SPECS" in names and "SOURCES" in names) + +-def sync(dryrun=False, ci=False, download=False): +- # TODO FIXME XXX fix it! +- raise Error, "sync is not expected to work these days" ++def sync(dryrun=False, commit=False, download=False): + svn = SVN() + topdir = getpkgtopdir() + # run svn info because svn st does not complain when topdir is not an +@@ -525,28 +523,22 @@ + for name, no, flags in spec.sources()) + sourcesst = dict((os.path.basename(path), (path, st)) + for st, path in svn.status(sourcesdir, noignore=True)) +- toadd_br = [] +- toadd_svn = [] +- toremove_svn = [] +- toremove_br = [] ++ toadd = [] ++ toremove = [] + # add the spec file itself, in case of a new package + specstl = svn.status(specpath, noignore=True) + if specstl: + specst, _ = specstl[0] + if specst == "?": +- toadd_svn.append(specpath) ++ toadd.append(specpath) + # add source files: + for source, url in sources.iteritems(): + sourcepath = os.path.join(sourcesdir, source) + if sourcesst.get(source): + if not os.path.islink(sourcepath): +- if not binrepo.is_tracked(sourcepath): +- if binrepo.is_binary(sourcepath): +- toadd_br.append(sourcepath) +- else: +- toadd_svn.append(sourcepath) +- else: +- sys.stderr.write("warning: %s not found\n" % sourcepath) ++ toadd.append(sourcepath) ++ elif not download and not os.path.isfile(sourcepath): ++ sys.stderr.write("warning: %s not found\n" % sourcepath) + elif download and not os.path.isfile(sourcepath): + print "%s not found, downloading from %s" % (sourcepath, url) + fmt = config.get("global", "download-command", +@@ -559,42 +551,26 @@ + "configuration option" % e + execcmd(cmd, show=True) + if os.path.isfile(sourcepath): +- if binrepo.is_binary(sourcepath): +- toadd_br.append(sourcepath) +- else: +- toadd_svn.append(sourcepath) ++ toadd.append(sourcepath) + else: + raise Error, "file not found: %s" % sourcepath + # rm entries not found in sources and still in svn + found = os.listdir(sourcesdir) + for entry in found: +- if entry == ".svn" or entry == "sources": ++ if entry == ".svn" or entry == binrepo.SOURCES_FILE: + continue + status = sourcesst.get(entry) + path = os.path.join(sourcesdir, entry) + if entry not in sources: +- if status is None: # file is tracked by svn +- toremove_svn.append(path) +- elif binrepo.is_tracked(path): +- toremove_br.append(path) +- for path in toremove_svn: ++ toremove.append(path) ++ for path in toremove: + print "D\t%s" % path + if not dryrun: +- svn.remove(path, local=True) +- for path in toremove_br: +- print "DB\t%s" % path +- if not dryrun: +- binrepo.delete_pending(path) +- for path in toadd_svn: ++ delete(path, commit=commit) ++ for path in toadd: + print "A\t%s" % path + if not dryrun: +- svn.add(path, local=True) +- for path in toadd_br: +- print "AB\t%s" % path +- if not dryrun: +- binrepo.upload_pending(path) +- if commit: +- commit(topdir) ++ upload(path, commit=commit) + + def commit(target=".", message=None, logfile=None): + svn = SVN() +-------------- next part -------------- +An HTML attachment was scrubbed... +URL: </pipermail/mageia-sysadm/attachments/20110127/5fba0d53/attachment.html> +</PRE> + + + + + +<!--endarticle--> + <HR> + <P><UL> + <!--threads--> + <LI>Previous message: <A HREF="002474.html">[Mageia-sysadm] [361] rename binrepo_delete as it is not only for binrepo +</A></li> + <LI>Next message: <A HREF="002476.html">[Mageia-sysadm] [363] rename ci option to commit +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#2475">[ date ]</a> + <a href="thread.html#2475">[ thread ]</a> + <a href="subject.html#2475">[ subject ]</a> + <a href="author.html#2475">[ 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> |