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
Contributor

@Synthetica9 Synthetica9 commented Oct 2, 2020

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.
Synthetica9 added 2 commits Oct 2, 2020
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`.
…s using Repology data
@Synthetica9 Synthetica9 requested review from FRidh, jonringer and stigtsp as code owners Oct 2, 2020
@Synthetica9
Copy link
Contributor Author

@Synthetica9 Synthetica9 commented Oct 2, 2020

Sorry for the pings code owners :(

@Synthetica9 Synthetica9 changed the title Redirected urls treewide: fix redirected urls Oct 2, 2020
@ofborg ofborg bot requested a review from bfortz Oct 2, 2020
@marsam
marsam approved these changes Oct 2, 2020
Copy link
Contributor

@jonringer jonringer left a comment

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
2 of 3 checks passed
2 of 3 checks passed
tests tests
Details
action
Details
Wait for ofborg This failed status will be cleared when ofborg finishes eval.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.