[game-data-packager] 04/10: Use os.stat to get sizes, so we follow symlinks
Simon McVittie
smcv at debian.org
Sun Jan 4 18:34:48 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 7ce7373335b909a32fcaf79c447d40ab8abf9029
Author: Simon McVittie <smcv at debian.org>
Date: Sat Jan 3 20:11:46 2015 +0000
Use os.stat to get sizes, so we follow symlinks
Useful for git-annex users.
---
lib/game_data_packager/__init__.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/game_data_packager/__init__.py b/lib/game_data_packager/__init__.py
index 8591a32..52414f2 100644
--- a/lib/game_data_packager/__init__.py
+++ b/lib/game_data_packager/__init__.py
@@ -490,7 +490,7 @@ class GameData(object):
def use_file(self, wanted, path, hashes=None):
logger.debug('found possible %s at %s', wanted.name, path)
- size = os.path.getsize(path)
+ size = os.stat(path).st_size
if wanted.size is not None and wanted.size != size:
if wanted.distinctive_name:
logger.warning('found possible %s\n' +
@@ -542,7 +542,7 @@ class GameData(object):
return
match_path = '/' + path.lower()
- size = os.path.getsize(path)
+ size = os.stat(path).st_size
if really_should_match_something:
if size > QUITE_LARGE:
--
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