public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "André Erdmann" <dywi@mailerd.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/distroot/
Date: Thu, 29 Aug 2013 12:36:34 +0000 (UTC)	[thread overview]
Message-ID: <1377779486.dc32952a22c40f03be7f25ba1be425f8faf5dfa7.dywi@gentoo> (raw)

commit:     dc32952a22c40f03be7f25ba1be425f8faf5dfa7
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Aug 29 12:31:26 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Aug 29 12:31:26 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=dc32952a

mirror directory: set_distfile_owner() (TODO)

method stub for declaring distfile "owners" (=PackageDir objects owning a
distfile).

---
 roverlay/overlay/pkgdir/distroot/distroot.py | 40 +++++++++++++++++++++-------
 1 file changed, 31 insertions(+), 9 deletions(-)

diff --git a/roverlay/overlay/pkgdir/distroot/distroot.py b/roverlay/overlay/pkgdir/distroot/distroot.py
index 650ea15..86a4d76 100644
--- a/roverlay/overlay/pkgdir/distroot/distroot.py
+++ b/roverlay/overlay/pkgdir/distroot/distroot.py
@@ -19,6 +19,7 @@ import tempfile
 import roverlay.db.distmap
 import roverlay.overlay.pkgdir.distroot.distdir
 import roverlay.util.hashpool
+import roverlay.util.objects
 
 
 class DistrootBase ( object ):
@@ -91,6 +92,7 @@ class DistrootBase ( object ):
             self.distmap.write ( force=False )
    # --- end of finalize (...) ---
 
+   @roverlay.util.objects.abstractmethod
    def _add ( self, src, dest ):
       """Adds src to the distroot.
 
@@ -100,8 +102,7 @@ class DistrootBase ( object ):
       * src --
       * dest --
       """
-      # derived classes have to implement this
-      raise NotImplementedError()
+      pass
    # --- end of _add (...) ---
 
    def _add_symlink ( self, src, dest, filter_exceptions=False ):
@@ -355,6 +356,11 @@ class DistrootBase ( object ):
          raise Exception ( "check_integrity() needs a distmap." )
    # --- end of check_integrity (...) ---
 
+   @roverlay.util.objects.abstractmethod
+   def set_distfile_owner ( self, backref, distfile ):
+      pass
+   # --- end of set_distfile_owner (...) ---
+
 # --- end of DistrootBase ---
 
 
@@ -379,6 +385,10 @@ class TemporaryDistroot ( DistrootBase ):
       shutil.rmtree ( self._root )
    # --- end of _cleanup (...) ---
 
+   def set_distfile_owner ( self, *args, **kwargs ):
+      return True
+   # --- end of set_distfile_owner (...) ---
+
 # --- end of TemporaryDistroot ---
 
 
@@ -440,15 +450,27 @@ class PersistentDistroot ( DistrootBase ):
          self.USE_COPY     : self._add_file,
       }
 
-
-      if verify and self.distmap is not None:
-         # expensive task, print a message
-         print (
-            "Checking distroot file integrity, this may take some time ... "
-         )
-         self.check_integrity()
+      if self.distmap is not None:
+         self.set_distfile_owner = self._set_distfile_owner_distmap
+         if verify:
+            # expensive task, print a message
+            print (
+               "Checking distroot file integrity, this may take some time ... "
+            )
+            self.check_integrity()
+      else:
+         self.set_distfile_owner = self._set_distfile_owner_nop
    # --- end of __init__ (...) ---
 
+   def _set_distfile_owner_nop ( self, backref, distfile ):
+      return True
+   # --- end of _set_distfile_owner_nop (...) ---
+
+   @roverlay.util.objects.not_implemented
+   def _set_distfile_owner_distmap ( self, backref, distfile ):
+      pass
+   # --- end of _set_distfile_owner_distmap (...) ---
+
    def _add ( self, src, dest ):
       # race condition when accessing self._supported_modes
       #  * this can result in repeated log messages


             reply	other threads:[~2013-08-29 12:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-29 12:36 André Erdmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-06-25 16:41 [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/distroot/ André Erdmann
2014-03-25 22:48 André Erdmann
2013-09-03 15:51 André Erdmann
2013-09-03 12:21 André Erdmann
2013-09-02 12:27 André Erdmann
2013-09-02  8:44 André Erdmann
2013-08-30 14:49 André Erdmann
     [not found] <1377779578.666baeaec44ee25a6ab2f355f3556a41587f5440.dywi@gentoo>
2013-08-29 12:36 ` André Erdmann
2013-08-22  9:01 André Erdmann
2013-02-09 20:45 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=1377779486.dc32952a22c40f03be7f25ba1be425f8faf5dfa7.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