Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treewide: fix redirected urls #99369

Merged
merged 4 commits into from Oct 2, 2020
Merged

Conversation

Synthetica9
Copy link
Member

Motivation for this change

Related:

Since the last time I ran this script, the Repology API changed, so I had to
adapt the script used in the previous PR. The new API should be more robust, so
overall this is a positive (no more grepping the error messages for our relevant
data but just a nice json structure).

Here's the new script I used:

curl repology.org/api/v1/repository/nix_unstable/problems \
   | jq -r '.[] | select(.type == "homepage_permanent_https_redirect") | .data | "s@\(.url)@\(.target)@"' \
   | sort | uniq | tee script.sed
find -name '*.nix' | xargs -P4 -- sed -f script.sed -i

I also added this script to maintainers/scripts.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Related:
 - 9fc5e7e
 - 593e11f
 - 508ae42

Since the last time I ran this script, the Repology API changed, so I had to
adapt the script used in the previous PR. The new API should be more robust, so
overall this is a positive (no more grepping the error messages for our relevant
data but just a nice json structure).

Here's the new script I used:

```sh
curl https://repology.org/api/v1/repository/nix_unstable/problems \
   | jq -r '.[] | select(.type == "homepage_permanent_https_redirect") | .data | "s@\(.url)@\(.target)@"' \
   | sort | uniq | tee script.sed
find -name '*.nix' | xargs -P4 -- sed -f script.sed -i
```

I will also add this script to `maintainers/scripts`.
@Synthetica9
Copy link
Member Author

Sorry for the pings code owners :(

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff LGTM
nice script :)

was able to run ofborg locally

$ nix-instantiate ./nixos/release.nix --option restrict-eval true -I foo=. --arg nixpkgs '{ outPath = ./.; revCount = 0; shortRev = "aabbcc"; }'
warning: dumping very large path (> 256 MiB); this may run out of memory
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/bzhayi9ljcy432z34lj9hlz1n151i2ax-nixos-channel-21.03pre0.aabbcc.drv
/nix/store/mdca90jpg2d8w6k3if565rp3vrd3wllv-options.json.drv

@jonringer jonringer merged commit eb013e6 into NixOS:master Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants