From 9e74ec65bb19a183d036a209c382c16c798f47a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Bourdeauducq?= Date: Wed, 4 Dec 2024 12:25:40 +0800 Subject: [PATCH] nixbld: hydra-restrictdist not needed anymore --- nixbld-etc-nixos/configuration.nix | 1 - nixbld-etc-nixos/hydra-restrictdist.patch | 32 ----------------------- 2 files changed, 33 deletions(-) delete mode 100644 nixbld-etc-nixos/hydra-restrictdist.patch diff --git a/nixbld-etc-nixos/configuration.nix b/nixbld-etc-nixos/configuration.nix index d2c9324..be45b02 100644 --- a/nixbld-etc-nixos/configuration.nix +++ b/nixbld-etc-nixos/configuration.nix @@ -941,7 +941,6 @@ in patches = oa.patches or [] ++ [ ./hydra-conda.patch ./hydra-msys2.patch - ./hydra-restrictdist.patch ]; hydraPath = oa.hydraPath + ":" + super.lib.makeBinPath [ super.jq ]; doCheck = false; # FIXME: ldap tests fail on hydra rebuild, seems unrelated to patches above. diff --git a/nixbld-etc-nixos/hydra-restrictdist.patch b/nixbld-etc-nixos/hydra-restrictdist.patch deleted file mode 100644 index a346f10..0000000 --- a/nixbld-etc-nixos/hydra-restrictdist.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git src/lib/Hydra/Controller/Root.pm src/lib/Hydra/Controller/Root.pm -index a9b0d558..71869ba0 100644 ---- a/src/lib/Hydra/Controller/Root.pm -+++ b/src/lib/Hydra/Controller/Root.pm -@@ -19,6 +19,11 @@ use Net::Prometheus; - # Put this controller at top-level. - __PACKAGE__->config->{namespace} = ''; - -+sub isRedistRestricted { -+ my ($path) = @_; -+ -+ return index($path, "-RESTRICTDIST-") >= 0; -+} - - sub noLoginNeeded { - my ($c) = @_; -@@ -319,6 +324,7 @@ sub nar :Local :Args(1) { - $path = $Nix::Config::storeDir . "/$path"; - - gone($c, "Path " . $path . " is no longer available.") unless isValidPath($path); -+ notFound($c, "Redistribution restricted") if isRedistRestricted($path); - - $c->stash->{current_view} = 'NixNAR'; - $c->stash->{storePath} = $path; -@@ -368,6 +374,7 @@ sub narinfo :LocalRegex('^([a-z0-9]+).narinfo$') :Args(0) { - setCacheHeaders($c, 60 * 60); - return; - } -+ notFound($c, "Redistribution restricted") if isRedistRestricted($path); - - $c->stash->{storePath} = $path; - $c->forward('Hydra::View::NARInfo');