From: "André Erdmann" <dywi@mailerd.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/db/
Date: Thu, 5 Sep 2013 09:25:02 +0000 (UTC) [thread overview]
Message-ID: <1378372848.8b1ea2fdaa6d72828f30ae5ec487f8e27977c4ad.dywi@gentoo> (raw)
commit: 8b1ea2fdaa6d72828f30ae5ec487f8e27977c4ad
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Sep 5 09:20:48 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Sep 5 09:20:48 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=8b1ea2fd
distmap, add_distfile_owner(): ignore missing files
create a virtual entry for files that do not exist
---
roverlay/db/distmap.py | 41 +++++++++++++++++++++++++++++++++--------
1 file changed, 33 insertions(+), 8 deletions(-)
diff --git a/roverlay/db/distmap.py b/roverlay/db/distmap.py
index 584ae8c..aadb491 100644
--- a/roverlay/db/distmap.py
+++ b/roverlay/db/distmap.py
@@ -49,6 +49,16 @@ class DistMapInfo ( object ):
return instance.make_volatile ( p_info, backref=backref )
# --- end of volatile_from_package_info (...) ---
+ @classmethod
+ def volatile_from_distfile ( cls, distfile, backref=None ):
+ # COULDFIX
+ # a static instance should suffice for this entry "type"
+ instance = cls ( distfile, None, None, None, volatile=True )
+ if backref is not None:
+ instance.add_backref ( backref )
+ return instance
+ # --- end of volatile_from_distfile (...) ---
+
def __init__ (
self, distfile, repo_name, repo_file, sha256, volatile=None
):
@@ -269,12 +279,17 @@ class _DistMapBase ( roverlay.util.objects.PersistentContent ):
if entry is not None:
entry.add_backref ( backref )
else:
- entry = self.add_dummy_entry (
- distfile, distfilepath=distfilepath, log_level=True
- )
- # FIXME:
- # ^ raises: ? if distfile is missing
- entry.add_backref ( backref )
+ try:
+ entry = self.add_dummy_entry (
+ distfile, distfilepath=distfilepath, log_level=True
+ )
+ entry.add_backref ( backref )
+ except IOError as ioerr:
+ if ioerr.errno == errno.ENOENT:
+ entry = self.add_virtual_entry ( distfile, backref )
+ else:
+ raise
+
# -- end if
return entry
# --- end of add_distfile_owner (...) ---
@@ -496,11 +511,13 @@ class _DistMapBase ( roverlay.util.objects.PersistentContent ):
entry = self._distmap.get ( distfile, None )
if entry is None or entry != distmap_info:
self._distmap [distfile] = distmap_info
- self._file_added ( distfile )
+ if distmap_info.is_persistent():
+ self._file_added ( distfile )
del entry
else:
self._distmap [distfile] = distmap_info
- self._file_added ( distfile )
+ if distmap_info.is_persistent():
+ self._file_added ( distfile )
return distmap_info
# --- end of add_entry (...) ---
@@ -574,6 +591,14 @@ class _DistMapBase ( roverlay.util.objects.PersistentContent ):
)
# --- end of add_dummy_entry (...) ---
+ def add_virtual_entry ( self, distfile, backref=None ):
+ return self.add_entry (
+ distfile, DistMapInfo.volatile_from_distfile (
+ distfile, backref=backref
+ )
+ )
+ # --- end of add_virtual_entry (...) ---
+
# --- end of _DistMapBase ---
next reply other threads:[~2013-09-05 9:25 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-05 9:25 André Erdmann [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-07-07 4:19 [gentoo-commits] proj/R_overlay:master commit in: roverlay/db/ Benda XU
2014-07-16 15:14 André Erdmann
2013-09-05 14:43 André Erdmann
2013-09-05 14:43 André Erdmann
2013-09-05 14:43 André Erdmann
2013-09-05 10:24 André Erdmann
2013-09-05 9:25 André Erdmann
2013-09-05 9:25 André Erdmann
2013-09-03 15:37 André Erdmann
2013-09-03 13:15 André Erdmann
2013-09-03 12:21 André Erdmann
2013-09-03 12:21 André Erdmann
2013-09-02 8:44 André Erdmann
2013-08-30 15:25 André Erdmann
2013-08-30 15:23 André Erdmann
2013-08-30 14:49 André Erdmann
2013-08-30 14:49 André Erdmann
2013-08-22 9:01 André Erdmann
2013-08-16 14:26 André Erdmann
2013-08-16 12:42 André Erdmann
2013-08-15 9:18 André Erdmann
2013-08-14 14:56 André Erdmann
2013-08-14 14:56 André Erdmann
2013-08-13 8:56 André Erdmann
2013-07-30 18:40 André Erdmann
2013-07-10 15:10 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-07-10 16:16 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-06-22 15:14 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-06-22 15:24 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
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=1378372848.8b1ea2fdaa6d72828f30ae5ec487f8e27977c4ad.dywi@gentoo \
--to=dywi@mailerd.de \
--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