[game-data-packager] 10/11: install_to, symlinks: strip leading / if any

Simon McVittie smcv at debian.org
Tue Jan 5 09:55:27 UTC 2016


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 dc35b1628b7e9e3ecc04e30838177fe5cd8038b3
Author: Simon McVittie <smcv at debian.org>
Date:   Tue Jan 5 09:25:14 2016 +0000

    install_to, symlinks: strip leading / if any
---
 game_data_packager/build.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/game_data_packager/build.py b/game_data_packager/build.py
index eaa4547..55e5ed1 100644
--- a/game_data_packager/build.py
+++ b/game_data_packager/build.py
@@ -1602,6 +1602,8 @@ class PackagingTask(object):
                     mkdir_p(dest_pkglicensedir)
                     install_to = pkglicensedir + install_to[14:]
 
+                install_to = install_to.lstrip('/')
+
                 copy_to = os.path.join(destdir, install_to, install_as)
                 copy_to_dir = os.path.dirname(copy_to)
                 logger.debug('Copying to %s', copy_to)
@@ -1618,9 +1620,6 @@ class PackagingTask(object):
                     os.chmod(copy_to, 0o644)
 
         for symlink, real_file in package.symlinks.items():
-            symlink = symlink.lstrip('/')
-            real_file = real_file.lstrip('/')
-
             symlink = string.Template(symlink).safe_substitute(
                     assets=self.packaging.ASSETS,
                     bindir=self.packaging.BINDIR,
@@ -1636,6 +1635,9 @@ class PackagingTask(object):
                     pkglicensedir=pkglicensedir,
                     install_to=package.install_to)
 
+            symlink = symlink.lstrip('/')
+            real_file = real_file.lstrip('/')
+
             toplevel, rest = symlink.split('/', 1)
             if real_file.startswith(toplevel + '/'):
                 symlink_dirs = symlink.split('/')
@@ -1662,6 +1664,8 @@ class PackagingTask(object):
                 install_to = package.install_to
                 if install_to.startswith('$assets'):
                     install_to = self.packaging.ASSETS + install_to[7:]
+
+                install_to = install_to.lstrip('/')
                 install_as = package.rip_cd['filename_format'] % i
                 copy_to = os.path.join(destdir, install_to, install_as)
                 copy_to_dir = os.path.dirname(copy_to)

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