[game-data-packager] 04/10: add replaces/conflicts

Simon McVittie smcv at debian.org
Sun Jan 18 09:25:15 UTC 2015


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

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

commit af643fdd834deaf71335e0bbd6b87c1874abcdef
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Sat Jan 17 23:21:08 2015 +0100

    add replaces/conflicts
    
    "debian: replaces:" is used to fill both 'Replaces:' & 'Conflicts:',
    as this is the common use case in GDP.
    .
    support for "debian: depends:" added for ROTT, because DarkWar
    depends on freely avabile TheHUNTBegin to ensure that REMOTE1.RTS
    is present.
---
 data/quake2.yaml                     |  1 +
 data/rott-data.control.in            | 11 -----------
 data/rott-extreme-data.control.in    | 11 -----------
 data/rott-registered-data.control.in | 13 -------------
 data/rott.yaml                       |  2 ++
 data/wolf3d.yaml                     |  1 +
 lib/game_data_packager/__init__.py   | 19 +++++++++++++++++++
 7 files changed, 23 insertions(+), 35 deletions(-)

diff --git a/data/quake2.yaml b/data/quake2.yaml
index e60a793..cd24301 100644
--- a/data/quake2.yaml
+++ b/data/quake2.yaml
@@ -6,6 +6,7 @@ packages:
     debian:
       engine: quake2 | quake2-server
       provides: quake2-data
+      replaces: quake2-data
     steam:
       id: 2320
       path: "common/Quake 2"
diff --git a/data/rott-data.control.in b/data/rott-data.control.in
index 07a4860..903de3a 100644
--- a/data/rott-data.control.in
+++ b/data/rott-data.control.in
@@ -1,14 +1,3 @@
-Package: rott-data
-Section: non-free/games
-Priority: optional
-Architecture: all
-Multi-Arch: foreign
-Recommends: rott
-Installed-Size: 56
-Version: VERSION
-Conflicts: rott (<< 1.1.1-4)
-Replaces: rott (<< 1.1.1-4)
-Maintainer: Debian Games Team <pkg-games-devel at lists.alioth.debian.org>
 Description: Game data for Rise of the Triad
  Rise of the Triad requires game data to play. This package contains
  the game data from the shareware episode of Rise of the Triad and
diff --git a/data/rott-extreme-data.control.in b/data/rott-extreme-data.control.in
index 96b5fde..9e74abd 100644
--- a/data/rott-extreme-data.control.in
+++ b/data/rott-extreme-data.control.in
@@ -1,14 +1,3 @@
-Package: rott-extreme-data
-Section: non-free/games
-Priority: optional
-Architecture: all
-Multi-Arch: foreign
-Depends: rott-registered-data
-Installed-Size: 56
-Version: VERSION
-Conflicts: rott (<< 1.1.1-4)
-Replaces: rott (<< 1.1.1-4)
-Maintainer: Debian Games Team <pkg-games-devel at lists.alioth.debian.org>
 Description: Extreme Rise of the Triad
  These are extra levels for "Rise of the Triad".
  This package was generated using the "game-data-packager" program.
diff --git a/data/rott-registered-data.control.in b/data/rott-registered-data.control.in
index a2f5e7f..d2b80f6 100644
--- a/data/rott-registered-data.control.in
+++ b/data/rott-registered-data.control.in
@@ -1,16 +1,3 @@
-Package: rott-registered-data
-Section: non-free/games
-Priority: optional
-Architecture: all
-Multi-Arch: foreign
-Depends: rott-data
-Recommends: rott
-Suggests: rott-extreme-data
-Installed-Size: 56
-Version: VERSION
-Conflicts: rott (<< 1.1.1-4)
-Replaces: rott (<< 1.1.1-4)
-Maintainer: Debian Games Team <pkg-games-devel at lists.alioth.debian.org>
 Description: Game data for Rise of the Triad: Dark War
  Rise of the Triad requires game data to play. This package contains
  the extra episodes from the commercial edition of Rise of the Triad
diff --git a/data/rott.yaml b/data/rott.yaml
index 018e3ee..33d58b4 100644
--- a/data/rott.yaml
+++ b/data/rott.yaml
@@ -13,6 +13,7 @@ packages:
     longname: "Rise of the Triad: The HUNT begins"
     debian:
       engine: rott
+      replaces: rott (<< 1.1.1-4)
     # this shareware data are considered a as full game because
     # it includes the HUNT Begin levels not present in the commercial game
 
@@ -30,6 +31,7 @@ packages:
   rott-registered-data:
     longname: "Rise of the Triad: Dark War"
     debian:
+      depends: rott-data
       engine: rott
     install_to: usr/share/games/rott
     install:
diff --git a/data/wolf3d.yaml b/data/wolf3d.yaml
index f128a80..a3c87f8 100644
--- a/data/wolf3d.yaml
+++ b/data/wolf3d.yaml
@@ -9,6 +9,7 @@ packages:
     debian:
       engine: wolf4sdl
       provides: wolf3d-data
+      replaces: wolf3d-data-wl1
     install_to: usr/share/games/wolf3d
     install_files_from_cksums: |
       2707522358 1156   audiohed.wl1
diff --git a/lib/game_data_packager/__init__.py b/lib/game_data_packager/__init__.py
index eca0763..1588269 100644
--- a/lib/game_data_packager/__init__.py
+++ b/lib/game_data_packager/__init__.py
@@ -1500,6 +1500,8 @@ class GameData(object):
         recommends = set()
         suggests = set()
         provides = set()
+        replaces = set()
+        conflicts = set()
         if 'Depends' in control:
             for depend in control['Depends'].split(','):
                 depends.add(depend.strip())
@@ -1512,6 +1514,12 @@ class GameData(object):
         if 'Provides' in control:
             for provide in control['Provides'].split(','):
                 provides.add(provide.strip())
+        if 'Replaces' in control:
+            for replace in control['Replaces'].split(','):
+                replaces.add(replace.strip())
+        if 'Conflicts' in control:
+            for conflict in control['Conflicts'].split(','):
+                conflicts.add(conflict.strip())
 
         if package.expansion_for:
             depends.add(package.expansion_for)
@@ -1523,11 +1531,18 @@ class GameData(object):
         for other_package in self.packages.values():
             if other_package.expansion_for == package.name:
                 suggests.add(other_package.name)
+        depend = package.debian.get('depends')
+        if depend:
+            depends.add(depend)
         provide = package.debian.get('provides')
         assert provide != package.name, \
                "A package shouldn't extraneously provide itself"
         if provide:
             provides.add(provide)
+        replace = package.debian.get('replaces')
+        if replace:
+            replaces.add(replace)
+            conflicts.add(replace)
 
         if depends:
             control['Depends'] = ', '.join(depends)
@@ -1537,6 +1552,10 @@ class GameData(object):
             control['Suggests'] = ', '.join(suggests)
         if provides:
             control['Provides'] = ', '.join(provides)
+        if replaces:
+            control['Replaces'] = ', '.join(replaces)
+        if conflicts:
+            control['Conflicts'] = ', '.join(conflicts)
 
         version = package.debian.get('version')
         if 'Version' in control:

-- 
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