public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/distroot/
@ 2013-02-09 20:45 André Erdmann
  0 siblings, 0 replies; 11+ messages in thread
From: André Erdmann @ 2013-02-09 20:45 UTC (permalink / raw
  To: gentoo-commits

commit:     da37d0550a1bacf82b42354c144752573779f1d1
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Sat Feb  9 20:38:51 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Sat Feb  9 20:38:51 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=da37d055

overlay/pkgdir/distroot: fix _add()

in _add():
* fixed the log message that is printed when a specific mode is not supported
* also added a comment concerning a race condition when using distroot with
  threads

---
 roverlay/overlay/pkgdir/distroot/distroot.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/roverlay/overlay/pkgdir/distroot/distroot.py b/roverlay/overlay/pkgdir/distroot/distroot.py
index bc97b08..0415955 100644
--- a/roverlay/overlay/pkgdir/distroot/distroot.py
+++ b/roverlay/overlay/pkgdir/distroot/distroot.py
@@ -297,6 +297,8 @@ class PersistentDistroot ( DistrootBase ):
 	# --- end of __init__ (...) ---
 
 	def _add ( self, src, dest ):
+		# race condition when accessing self._supported_modes
+		#  * this can result in repeated log messages
 		for mode in self._strategy:
 			if self._supported_modes & mode:
 				if self._add_functions [mode] (
@@ -305,7 +307,7 @@ class PersistentDistroot ( DistrootBase ):
 					return True
 				else:
 					self.logger.warning (
-						"mode {m} is not supported!".format ( m )
+						"mode {} is not supported!".format ( mode )
 					)
 					# the _add function returned False, which means that the
 					# operation is not supported


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/distroot/
@ 2013-08-22  9:01 André Erdmann
  0 siblings, 0 replies; 11+ messages in thread
From: André Erdmann @ 2013-08-22  9:01 UTC (permalink / raw
  To: gentoo-commits

commit:     fe1d5ddb27f4937e6dfc7a42334d84af0f291de6
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Aug 22 09:00:14 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Aug 22 09:00:14 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=fe1d5ddb

distroot: calculate distmap digests in a hashpool

---
 roverlay/overlay/pkgdir/distroot/distroot.py | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/roverlay/overlay/pkgdir/distroot/distroot.py b/roverlay/overlay/pkgdir/distroot/distroot.py
index 609dea3..650ea15 100644
--- a/roverlay/overlay/pkgdir/distroot/distroot.py
+++ b/roverlay/overlay/pkgdir/distroot/distroot.py
@@ -18,11 +18,14 @@ import tempfile
 
 import roverlay.db.distmap
 import roverlay.overlay.pkgdir.distroot.distdir
+import roverlay.util.hashpool
 
 
 class DistrootBase ( object ):
    """Base class for distroots."""
 
+   HASHPOOL_JOB_COUNT = 2
+
    def __repr__ ( self ):
       return "{name}<root={root}>".format (
          name = self.__class__.__name__,
@@ -295,10 +298,20 @@ class DistrootBase ( object ):
       if self.distmap is not None:
          root      = self.get_root()
          distfiles = set()
-         checkfile = self.distmap.check_integrity
+         distmap_hashtype = self.distmap.get_hash_type()
+         checkfile = self.distmap.check_digest_integrity
+
+         self.logger.info ( "calculating file hashes" )
+
+         hash_pool = roverlay.util.hashpool.HashPool (
+            ( distmap_hashtype, ), self.HASHPOOL_JOB_COUNT, use_threads=True
+         )
 
          for abspath, relpath in self.iter_distfiles ( False ):
-            status = checkfile ( relpath, abspath )
+            hash_pool.add ( relpath, abspath, None )
+
+         for relpath, hashdict in hash_pool.run_as_completed():
+            status = checkfile ( relpath, hashdict[distmap_hashtype] )
 
             if status == 0:
                self.logger.debug (
@@ -310,7 +323,7 @@ class DistrootBase ( object ):
                self.logger.info (
                   "file not in distmap, creating dummy entry: {!r}".format ( relpath )
                )
-               self.distmap.add_dummy_entry ( relpath, abspath )
+               self.distmap.add_dummy_entry ( relpath, hashdict=hashdict )
                distfiles.add ( relpath )
             elif status == 2:
                # file in distmap, but not valid - remove it from distmap


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/distroot/
@ 2013-08-29 12:36 André Erdmann
  0 siblings, 0 replies; 11+ messages in thread
From: André Erdmann @ 2013-08-29 12:36 UTC (permalink / raw
  To: gentoo-commits

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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/distroot/
       [not found] <1377779578.666baeaec44ee25a6ab2f355f3556a41587f5440.dywi@gentoo>
@ 2013-08-29 12:36 ` André Erdmann
  0 siblings, 0 replies; 11+ messages in thread
From: André Erdmann @ 2013-08-29 12:36 UTC (permalink / raw
  To: gentoo-commits

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

distroot, set_distfile_owner(): print "method stub"

---
 roverlay/overlay/pkgdir/distroot/distroot.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/roverlay/overlay/pkgdir/distroot/distroot.py b/roverlay/overlay/pkgdir/distroot/distroot.py
index 86a4d76..34f61d9 100644
--- a/roverlay/overlay/pkgdir/distroot/distroot.py
+++ b/roverlay/overlay/pkgdir/distroot/distroot.py
@@ -466,9 +466,8 @@ class PersistentDistroot ( DistrootBase ):
       return True
    # --- end of _set_distfile_owner_nop (...) ---
 
-   @roverlay.util.objects.not_implemented
    def _set_distfile_owner_distmap ( self, backref, distfile ):
-      pass
+      print ( "_set_distfile_owner_distmap(): method stub" )
    # --- end of _set_distfile_owner_distmap (...) ---
 
    def _add ( self, src, dest ):


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/distroot/
@ 2013-08-30 14:49 André Erdmann
  0 siblings, 0 replies; 11+ messages in thread
From: André Erdmann @ 2013-08-30 14:49 UTC (permalink / raw
  To: gentoo-commits

commit:     771754c749e09f8722324304a9399e67bbf9aafa
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Fri Aug 30 14:46:41 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Fri Aug 30 14:46:41 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=771754c7

distroot: handle_file_collision()

This commit adds initial support for handling file collisions by simply ignoring
subsequent files with the same name (and screaming to stdout).

TODO notes:
* re-use volatile entries when creating manifest files
* (could) resolve file collisions with automatic renaming

---
 roverlay/overlay/pkgdir/distroot/distroot.py | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/roverlay/overlay/pkgdir/distroot/distroot.py b/roverlay/overlay/pkgdir/distroot/distroot.py
index 6deb06f..96c6894 100644
--- a/roverlay/overlay/pkgdir/distroot/distroot.py
+++ b/roverlay/overlay/pkgdir/distroot/distroot.py
@@ -608,4 +608,25 @@ class PersistentDistroot ( DistrootBase ):
       return tuple ( get_int ( s ) for s in strategy )
    # --- end of _get_int_strategy (...) ---
 
+   def handle_file_collision ( self, package_dir, package_info ):
+      if self.distmap.get_distfile_slot ( package_dir, package_info ):
+         return True
+      else:
+         # TODO/COULDFIX:
+         #  resolve conflict instead of ignoring filtering
+         #
+
+         # *** DEBUG CODE ***
+         vartable = package_info.create_vartable ( package_dir.get_upper().name )
+         print (
+            "dropping {P} from {CATEGORY}/{PN}".format ( **vartable )
+         )
+         self.logger.info (
+            "dropping {!r}: distmap file collision.".format ( package_info )
+         )
+         # *** END DEBUG CODE ***
+
+         return False
+   # --- end of handle_file_collision (...) ---
+
 # --- end of PersistentDistroot ---


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/distroot/
@ 2013-09-02  8:44 André Erdmann
  0 siblings, 0 replies; 11+ messages in thread
From: André Erdmann @ 2013-09-02  8:44 UTC (permalink / raw
  To: gentoo-commits

commit:     441fcf253606e593a7e3b253278a75cfd1ae9d1c
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Mon Sep  2 08:43:24 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Mon Sep  2 08:43:24 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=441fcf25

distroot, file collisions: rename distfiles

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

diff --git a/roverlay/overlay/pkgdir/distroot/distroot.py b/roverlay/overlay/pkgdir/distroot/distroot.py
index 2ec43ec..c866bea 100644
--- a/roverlay/overlay/pkgdir/distroot/distroot.py
+++ b/roverlay/overlay/pkgdir/distroot/distroot.py
@@ -612,22 +612,23 @@ class PersistentDistroot ( DistrootBase ):
       if self.distmap.get_distfile_slot ( package_dir, package_info ):
          return True
       else:
-         # TODO/COULDFIX:
-         #  resolve conflict instead of simply ignoring files
-         #  (-> e.g. rename files)
-         #
+         distfile      = package_info.get_src_uri_dest().rpartition ( os.sep )
+         rename_prefix = package_info ['repo_name'].lower() + '_'
 
-         # *** DEBUG CODE ***
-         vartable = package_info.create_vartable ( package_dir.get_upper().name )
-         print (
-            "dropping {P} from {CATEGORY}/{PN}".format ( **vartable )
-         )
-         self.logger.info (
-            "dropping {!r}: distmap file collision.".format ( package_info )
-         )
-         # *** END DEBUG CODE ***
-
-         return False
+         if distfile[2][:len(rename_prefix)] == rename_prefix:
+            # already prefixed with the repo name
+            return False
+         else:
+            package_info.update (
+               src_uri_dest=(
+                  distfile[0] + distfile[1] + rename_prefix + distfile[2]
+               )
+            )
+            #return self.distmap.get_distfile_slot(...)
+            if self.distmap.get_distfile_slot ( package_dir, package_info ):
+               return True
+            else:
+               return False
    # --- end of handle_file_collision (...) ---
 
 # --- end of PersistentDistroot ---


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/distroot/
@ 2013-09-02 12:27 André Erdmann
  0 siblings, 0 replies; 11+ messages in thread
From: André Erdmann @ 2013-09-02 12:27 UTC (permalink / raw
  To: gentoo-commits

commit:     69486861f0c339d3b3f8c859c725aed7299fc409
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Mon Sep  2 12:24:15 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Mon Sep  2 12:24:15 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=69486861

distroot, _add(): create directories if necessary

---
 roverlay/overlay/pkgdir/distroot/distroot.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/roverlay/overlay/pkgdir/distroot/distroot.py b/roverlay/overlay/pkgdir/distroot/distroot.py
index c866bea..d5f6768 100644
--- a/roverlay/overlay/pkgdir/distroot/distroot.py
+++ b/roverlay/overlay/pkgdir/distroot/distroot.py
@@ -18,6 +18,7 @@ import tempfile
 
 import roverlay.db.distmap
 import roverlay.overlay.pkgdir.distroot.distdir
+import roverlay.util.common
 import roverlay.util.hashpool
 import roverlay.util.objects
 
@@ -132,7 +133,6 @@ class DistrootBase ( object ):
       * dest --
       * filter_exceptions --
       """
-
       if os.path.lexists ( dest ):
          # safe removal
          os.unlink ( dest )
@@ -548,6 +548,7 @@ class PersistentDistroot ( DistrootBase ):
    def _add ( self, src, dest ):
       # race condition when accessing self._supported_modes
       #  * this can result in repeated log messages
+      roverlay.util.common.dodir_for_file ( dest )
       for mode in self._strategy:
          if self._supported_modes & mode:
             if self._add_functions [mode] (


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/distroot/
@ 2013-09-03 12:21 André Erdmann
  0 siblings, 0 replies; 11+ messages in thread
From: André Erdmann @ 2013-09-03 12:21 UTC (permalink / raw
  To: gentoo-commits

commit:     03653a186b6baa2c9da681efd3e6d526c3b8ba5e
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Tue Sep  3 12:20:25 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Tue Sep  3 12:20:25 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=03653a18

distroot: update volatile entries

instead of writing a new entry, make the existing one persistent

---
 roverlay/overlay/pkgdir/distroot/distdir.py  |  3 ++-
 roverlay/overlay/pkgdir/distroot/distroot.py | 10 ++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/roverlay/overlay/pkgdir/distroot/distdir.py b/roverlay/overlay/pkgdir/distroot/distdir.py
index 62cb210..4163109 100644
--- a/roverlay/overlay/pkgdir/distroot/distdir.py
+++ b/roverlay/overlay/pkgdir/distroot/distdir.py
@@ -27,7 +27,8 @@ class Distdir ( object ):
          fpath,
          self.get_root() + os.sep + ( fname or os.path.basename ( fpath ) )
       ):
-         self._distroot.distmap_register ( p_info )
+         #self._distroot.distmap_register ( p_info )
+         self._distroot.distmap_update_entry ( p_info )
          return True
       else:
          return False

diff --git a/roverlay/overlay/pkgdir/distroot/distroot.py b/roverlay/overlay/pkgdir/distroot/distroot.py
index d5f6768..e174433 100644
--- a/roverlay/overlay/pkgdir/distroot/distroot.py
+++ b/roverlay/overlay/pkgdir/distroot/distroot.py
@@ -336,6 +336,16 @@ class DistrootBase ( object ):
       return self.distmap.add_entry_for ( p_info )
    # --- end of distmap_register (...) ---
 
+   def distmap_update_entry ( self, p_info ):
+      """Makes an already existing distmap entry for p_info persistent
+      (so that it can be written to disk).
+
+      arguments:
+      * p_info --
+      """
+      return self.distmap.add_entry_for_volatile ( p_info )
+   # --- end of distmap_update_entry (...) ---
+
    def check_integrity ( self ):
       """Verifies (and regenerates) the distmap:
 


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/distroot/
@ 2013-09-03 15:51 André Erdmann
  0 siblings, 0 replies; 11+ messages in thread
From: André Erdmann @ 2013-09-03 15:51 UTC (permalink / raw
  To: gentoo-commits

commit:     f047cd03d8593462fdf49054d8d8e6e39495538d
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Tue Sep  3 15:47:27 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Tue Sep  3 15:47:27 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=f047cd03

distroot: sync_distmap()

This method adds files existing in the distroot to the distmap (unless they
already have an entry). IOW, this method is a subset of what check_integrity()
does.

---
 roverlay/overlay/pkgdir/distroot/distroot.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/roverlay/overlay/pkgdir/distroot/distroot.py b/roverlay/overlay/pkgdir/distroot/distroot.py
index 9412202..ad0e2b6 100644
--- a/roverlay/overlay/pkgdir/distroot/distroot.py
+++ b/roverlay/overlay/pkgdir/distroot/distroot.py
@@ -346,6 +346,22 @@ class DistrootBase ( object ):
       return self.distmap.add_entry_for_volatile ( p_info )
    # --- end of distmap_update_entry (...) ---
 
+   def sync_distmap ( self ):
+      """Creates dummy entries for files missing in the distmap."""
+      if self.distmap is not None:
+         hash_pool = roverlay.util.hashpool.HashPool (
+            ( self.distmap.get_hash_type(), ), self.HASHPOOL_JOB_COUNT,
+            use_threads=True
+         )
+
+         for abspath, relpath in self.iter_distfiles ( False ):
+            if relpath not in distmap:
+               hash_pool.add ( relpath, abspath, None )
+
+         for relpath, hashdict in hash_pool.run_as_completed():
+            self.distmap.add_dummy_entry ( relpath, hashdict=hashdict )
+   # --- end of sync_distmap (...) ---
+
    def check_integrity ( self ):
       """Verifies (and regenerates) the distmap:
 
@@ -356,7 +372,6 @@ class DistrootBase ( object ):
       (c) drop distmap entries whose file do not exist
       """
       if self.distmap is not None:
-         root      = self.get_root()
          distfiles = set()
          distmap_hashtype = self.distmap.get_hash_type()
          checkfile = self.distmap.check_digest_integrity


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/distroot/
@ 2014-03-25 22:48 André Erdmann
  0 siblings, 0 replies; 11+ messages in thread
From: André Erdmann @ 2014-03-25 22:48 UTC (permalink / raw
  To: gentoo-commits

commit:     099ab4d660263b9af7052076a4da1107ba6b08e1
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Tue Mar 25 20:51:58 2014 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Tue Mar 25 20:51:58 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=099ab4d6

fixme note

---
 roverlay/overlay/pkgdir/distroot/distroot.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/roverlay/overlay/pkgdir/distroot/distroot.py b/roverlay/overlay/pkgdir/distroot/distroot.py
index 6762a38..654c1f6 100644
--- a/roverlay/overlay/pkgdir/distroot/distroot.py
+++ b/roverlay/overlay/pkgdir/distroot/distroot.py
@@ -142,6 +142,9 @@ class DistrootBase ( object ):
          # safe removal
          os.unlink ( dest )
       elif os.path.exists ( dest ):
+         # FIXME 2014: exists(<file>) implies lexists(<file>),
+         #             so this block is unreachable -- remove it
+         #
          # unsafe removal (happens when switching from e.g. hardlinks)
          # FIXME log this
          os.unlink ( dest )


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/distroot/
@ 2014-06-25 16:41 André Erdmann
  0 siblings, 0 replies; 11+ messages in thread
From: André Erdmann @ 2014-06-25 16:41 UTC (permalink / raw
  To: gentoo-commits

commit:     dd377fc68bfb78c283d35b2173b47ce4837b0d35
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Jun 25 16:06:00 2014 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Jun 25 16:06:00 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=dd377fc6

distroot, handle_file_collision(): restore src_uri_dest

... if the file collision cannot be resolved

Also adds some safety checks (distfile name must not be empty and should not
be rename_prefix).

---
 roverlay/overlay/pkgdir/distroot/distroot.py | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/roverlay/overlay/pkgdir/distroot/distroot.py b/roverlay/overlay/pkgdir/distroot/distroot.py
index 654c1f6..9872aad 100644
--- a/roverlay/overlay/pkgdir/distroot/distroot.py
+++ b/roverlay/overlay/pkgdir/distroot/distroot.py
@@ -657,22 +657,33 @@ class PersistentDistroot ( DistrootBase ):
       if self.distmap.get_distfile_slot ( package_dir, package_info ):
          return True
       else:
-         distfile      = package_info.get_src_uri_dest().rpartition ( os.sep )
-         rename_prefix = package_info ['repo_name'].lower() + '_'
-
-         if distfile[2][:len(rename_prefix)] == rename_prefix:
+         orig_src_uri_dest = package_info.get_src_uri_dest()
+         # distfile_dirname, distfile_os_sep, distfile_basename
+         distfile          = orig_src_uri_dest.rpartition ( os.sep )
+         rename_prefix     = package_info ['repo_name'].lower() + '_'
+         rename_prefix_len = len ( rename_prefix )
+
+         assert distfile[2]
+
+         if (
+            len(distfile[2]) > rename_prefix_len
+            and distfile[2][:rename_prefix_len] == rename_prefix
+         ):
             # already prefixed with the repo name
             return False
+
          else:
             package_info.update (
                src_uri_dest=(
                   distfile[0] + distfile[1] + rename_prefix + distfile[2]
                )
             )
-            #return self.distmap.get_distfile_slot(...)
+
             if self.distmap.get_distfile_slot ( package_dir, package_info ):
                return True
             else:
+               # restore src_uri_dest
+               package_info.update ( src_uri_dest=orig_src_uri_dest )
                return False
    # --- end of handle_file_collision (...) ---
 


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-06-25 16:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-25 22:48 [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/distroot/ André Erdmann
  -- strict thread matches above, loose matches on Subject: below --
2014-06-25 16:41 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-29 12:36 André Erdmann
2013-08-22  9:01 André Erdmann
2013-02-09 20:45 André Erdmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox