From: SebastianLuther@gmx.de
To: gentoo-portage-dev@lists.gentoo.org
Subject: [gentoo-portage-dev] [PATCH] egencache: --write-timestamp to create metadata/timestamp.chk
Date: Fri, 29 Nov 2013 14:36:43 +0100 [thread overview]
Message-ID: <1385732203-11569-1-git-send-email-SebastianLuther@gmx.de> (raw)
From: Sebastian Luther <SebastianLuther@gmx.de>
This is required to sync repositories using rsnyc.
URL: https://bugs.gentoo.org/488972
---
bin/egencache | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/bin/egencache b/bin/egencache
index 54c517e..c8d41bf 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -133,6 +133,9 @@ def parse_args(args):
common.add_argument("--ignore-default-opts",
action="store_true",
help="do not use the EGENCACHE_DEFAULT_OPTS environment variable")
+ common.add_argument("--write-timestamp",
+ action="store_true",
+ help="write metdata/timestamp.chk as required for rsync repositories")
update = parser.add_argument_group('--update options')
update.add_argument("--cache-dir",
@@ -1063,6 +1066,16 @@ def egencache_main(args):
gen_clogs.run()
ret.append(gen_clogs.returncode)
+ if options.write_timestamp:
+ timestamp_path = os.path.join(repo_path, "metadata", "timestamp.chk")
+ try:
+ with open(timestamp_path, "w") as f:
+ f.write(time.strftime("%a, %d %b %Y %H:%M:%S +0000\n", time.gmtime()))
+ except IOError:
+ ret.append(1)
+ else:
+ ret.append(os.EX_OK)
+
return max(ret)
if __name__ == "__main__":
--
1.8.1.5
next reply other threads:[~2013-11-29 13:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-29 13:36 SebastianLuther [this message]
2013-11-29 14:17 ` [gentoo-portage-dev] [PATCH] egencache: --write-timestamp to create metadata/timestamp.chk Mike Frysinger
-- strict thread matches above, loose matches on Subject: below --
2013-11-27 10:31 SebastianLuther
2013-11-27 21:20 ` Mike Frysinger
2013-11-27 21:41 ` Sebastian Luther
2013-11-27 21:45 ` Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1385732203-11569-1-git-send-email-SebastianLuther@gmx.de \
--to=sebastianluther@gmx.de \
--cc=gentoo-portage-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox