From 8005779640207a46089476721ce1a5441b579478 Mon Sep 17 00:00:00 2001 From: aszlig Date: Sun, 15 Jul 2018 10:29:26 +0200 Subject: fetchHumbleBundle: Fix subproduct name collision Every HumbleBundle purchase has a list of subproducts and those have so-called 'machine_name' attributes which are unique. However in our fetcher we used the 'human_name' as a unique key, which isn't really unique and in case of bastion the soundtrack subproduct is has the human_name "Bastion" and the actual game has the *same* name as well. Using the machine_name as the unique key now solves the problem that certain games couldn't be found if you for example also have the soundtrack. Signed-off-by: aszlig --- pkgs/games/humblebundle/fetch-humble-bundle/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/games') diff --git a/pkgs/games/humblebundle/fetch-humble-bundle/default.nix b/pkgs/games/humblebundle/fetch-humble-bundle/default.nix index dbf6c862..44b0537a 100644 --- a/pkgs/games/humblebundle/fetch-humble-bundle/default.nix +++ b/pkgs/games/humblebundle/fetch-humble-bundle/default.nix @@ -114,7 +114,7 @@ prodname = subproduct.human_name.encode('ascii', 'replace') downloads = [(download.machine_name, download.download_struct) for download in subproduct.downloads] - yield (prodname, downloads) + yield ((subproduct.machine_name, prodname), downloads) def find_download(downloads): for machine_name, dstruct in sum(downloads.values(), []): @@ -161,7 +161,7 @@ print >>sys.stderr, ${pyStr "Cannot find download for ${machineName}!"} print >>sys.stderr, 'Available machine names:' for name, dstructs in sorted(products.items(), key=lambda x: x[0]): - print >>sys.stderr, " * " + name + print >>sys.stderr, " * " + name[1] print >>sys.stderr, " " + ', '.join(map(lambda x: x[0], dstructs)) raise SystemExit(1) elif dstruct.md5 != ${pyStr md5}: -- cgit 1.4.1