[game-data-packager] 01/01: fedora: avoid duplicates sub-tree in specfile '%files' stanza

Alexandre Detiste detiste-guest at moszumanska.debian.org
Wed Jan 6 10:40:01 UTC 2016


This is an automated email from the git hooks/post-receive script.

detiste-guest pushed a commit to branch master
in repository game-data-packager.

commit 27e43617affefb343532c7f21e63173d83930cd2
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Wed Jan 6 11:39:01 2016 +0100

    fedora: avoid duplicates sub-tree in specfile '%files' stanza
---
 game_data_packager/build.py | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/game_data_packager/build.py b/game_data_packager/build.py
index fb9e200..2fbdb9f 100644
--- a/game_data_packager/build.py
+++ b/game_data_packager/build.py
@@ -1472,21 +1472,34 @@ class PackagingTask(object):
         else:
             url = 'https://wiki.debian.org/Games/GameDataPackager'
 
-        SYSTEM_DIRS = set(['/usr/bin',
+        SYSTEM_DIRS = set(['/usr',
+                           '/usr/bin',
+                           '/usr/lib',
+                           '/usr/share',
                            '/usr/share/applications',
+                           '/usr/share/doc',
                            '/usr/share/icons/hicolor/scalable/apps',
+                           '/usr/share/licenses',
                            '/usr/share/pixmaps'])
         files = set()
         for dirpath, dirnames, filenames in os.walk(destdir):
-             for fn in filenames:
-                 full = os.path.join(dirpath, fn)
-                 dir = dirpath[len(destdir):]
-                 if dir in SYSTEM_DIRS:
+             dir = dirpath[len(destdir):]
+             if not dir:
+                 # /
+                 continue
+             elif dir in SYSTEM_DIRS:
+                 for fn in filenames + dirnames:
+                     full = os.path.join(dirpath, fn)
                      file = full[len(destdir):]
-                     files.add(file)
+                     if file not in SYSTEM_DIRS:
+                         files.add(file)
+             else:
+                 for file in files:
+                     if dir.startswith(file):
+                         break
                  else:
                      files.add(dir)
-                     break
+
         logger.debug('%%files in specfile:\n%s', '\n'.join(sorted(files)))
 
         with open(specfile, 'w', encoding='utf-8') as spec:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git



More information about the Pkg-games-commits mailing list