From 2f499eb8eb7918b4c0a7350123e314956ccf9a36 Mon Sep 17 00:00:00 2001 From: Martin Toman Date: Wed, 21 Sep 2022 15:05:08 -0700 Subject: [PATCH] fix: php: package names ensure lowercase --- src/subsystems/php/builders/granular-php/default.nix | 4 ++-- src/subsystems/php/builders/simple-php/default.nix | 4 ++-- src/subsystems/php/translators/composer-json/default.nix | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/subsystems/php/builders/granular-php/default.nix b/src/subsystems/php/builders/granular-php/default.nix index 0fc70f13..471dc570 100644 --- a/src/subsystems/php/builders/granular-php/default.nix +++ b/src/subsystems/php/builders/granular-php/default.nix @@ -98,7 +98,7 @@ url = "${root}/vendor/${name}"; options = { versions = { - "${name}" = "${version}"; + "${l.strings.toLower name}" = "${version}"; }; symlink = false; }; @@ -125,7 +125,7 @@ (repositories ++ [{packagist = false;}]); dependenciesString = l.toJSON (l.listToAttrs ( map (dep: { - inherit (dep) name; + name = l.strings.toLower dep.name; value = dep.version; }) (dependencies diff --git a/src/subsystems/php/builders/simple-php/default.nix b/src/subsystems/php/builders/simple-php/default.nix index 713e8ed9..f5e0558a 100644 --- a/src/subsystems/php/builders/simple-php/default.nix +++ b/src/subsystems/php/builders/simple-php/default.nix @@ -111,7 +111,7 @@ url = "${cleanDependency dep.name dep.version}"; options = { versions = { - "${dep.name}" = "${dep.version}"; + "${l.strings.toLower dep.name}" = "${dep.version}"; }; symlink = false; }; @@ -123,7 +123,7 @@ dependenciesString = l.toJSON (l.listToAttrs ( map (dep: { - inherit (dep) name; + name = l.strings.toLower dep.name; value = dep.version; }) dependencies diff --git a/src/subsystems/php/translators/composer-json/default.nix b/src/subsystems/php/translators/composer-json/default.nix index 362a4351..c26c8c09 100644 --- a/src/subsystems/php/translators/composer-json/default.nix +++ b/src/subsystems/php/translators/composer-json/default.nix @@ -60,7 +60,9 @@ jq \ "(.config.lock = true) | \ - (.config.\"platform-check\" = false)" \ + (.config.\"platform-check\" = false) | \ + (.require = ((.require // {}) | with_entries(.key |= ascii_downcase))) | \ + (.\"require-dev\" = ((.\"require-dev\" // {}) | with_entries(.key |= ascii_downcase)))" \ composer.json.orig > composer.json if [ "$(jq '.project.subsystemInfo.noDev' -c -r $jsonInput)" == "true" ]; then