public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Mike Frysinger" <vapier@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/
Date: Fri, 29 Nov 2013 23:24:55 +0000 (UTC)	[thread overview]
Message-ID: <1385767263.c145e3cfcc016694f76488c21caaae37e3f3664e.vapier@gentoo> (raw)

commit:     c145e3cfcc016694f76488c21caaae37e3f3664e
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Fri Nov 29 18:02:21 2013 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Nov 29 23:21:03 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c145e3cf

egencache: --write-timestamp to create metadata/timestamp.chk

This is required to sync repositories using rsnyc.

URL: https://bugs.gentoo.org/488972

---
 bin/egencache        | 14 ++++++++++++++
 pym/portage/const.py |  4 ++++
 2 files changed, 18 insertions(+)

diff --git a/bin/egencache b/bin/egencache
index 54c517e..915adc8 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -48,6 +48,7 @@ portage._internal_caller = True
 from portage import os, _encodings, _unicode_encode, _unicode_decode
 from _emerge.MetadataRegen import MetadataRegen
 from portage.cache.cache_errors import CacheError, StatCollision
+from portage.const import TIMESTAMP_FORMAT
 from portage.manifest import guessManifestFileType
 from portage.package.ebuild._parallel_manifest.ManifestScheduler import ManifestScheduler
 from portage.util import cmp_sort_key, writemsg_level
@@ -133,6 +134,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 +1067,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('%s\n' % TIMESTAMP_FORMAT, time.gmtime()))
+		except IOError:
+			ret.append(os.EX_IOERR)
+		else:
+			ret.append(os.EX_OK)
+
 	return max(ret)
 
 if __name__ == "__main__":

diff --git a/pym/portage/const.py b/pym/portage/const.py
index 214ede4..b2e970e 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
@@ -175,6 +175,10 @@ if "PORTAGE_OVERRIDE_EPREFIX" in os.environ:
 VCS_DIRS = ("CVS", "RCS", "SCCS", ".bzr", ".git", ".hg", ".svn")
 
 SUPPORTED_BINPKG_FORMATS = ("tar", "rpm")
+
+# Time formats used in various places like metadata.chk.
+TIMESTAMP_FORMAT = "%a, %d %b %Y %H:%M:%S +0000"	# to be used with time.gmtime()
+
 # ===========================================================================
 # END OF CONSTANTS -- END OF CONSTANTS -- END OF CONSTANTS -- END OF CONSTANT
 # ===========================================================================


             reply	other threads:[~2013-11-29 23:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-29 23:24 Mike Frysinger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-11-17 17:43 [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/ Zac Medico
2013-06-25  7:48 Zac Medico
2013-06-23 22:57 Zac Medico
2013-06-23 22:40 Zac Medico
2013-02-11  9:39 Zac Medico
2013-01-19  5:16 Zac Medico
2013-01-19  5:00 Zac Medico
2013-01-19  3:23 Zac Medico
2013-01-19  3:23 Zac Medico
2013-01-19  2:27 Zac Medico
2013-01-19  1:53 Zac Medico
2012-10-18  0:05 Zac Medico
2012-03-17 16:44 Zac Medico
2012-03-11  1:40 Mike Frysinger
2011-12-08  7:26 Zac Medico
2011-06-17 22:35 Zac Medico
2011-06-04  1:39 Zac Medico
2011-02-20  0:00 Zac Medico

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=1385767263.c145e3cfcc016694f76488c21caaae37e3f3664e.vapier@gentoo \
    --to=vapier@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-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