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

rpm: fix helper script paths #77993

Merged
merged 1 commit into from Jan 19, 2020
Merged

rpm: fix helper script paths #77993

merged 1 commit into from Jan 19, 2020

Conversation

ericnorris
Copy link
Contributor

Motivation for this change

This PR replaces a hardcoded reference to /usr/lib/rpm that, at least on my machine, appears in the find-provides and find-requires scripts (e.g. https://github.com/rpm-software-management/rpm/blob/75ec16e660e784d7897b37cac1a2b9b135825f25/scripts/find-provides).

The hardcoded link results in the following error:

$ /nix/store/ag4r7xv9kv0bc79y7rlsy07rjadl26xk-rpm-4.14.2.1/lib/rpm/find-provides
/nix/store/ag4r7xv9kv0bc79y7rlsy07rjadl26xk-rpm-4.14.2.1/lib/rpm/find-provides: line 3: /usr/lib/rpm/rpmdeps: No such file or directory

There may be a better way of fixing this, so I am open to suggestions.

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.

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @ericnorris, everything looks good on my side ✨.

Though I'd like to give some advice that's in our docs for later contributions.
It would be best to do

git checkout -b $branch_name

off the master branch instead of working directly on it.

Frequently, integrators my force push to branches to fixup work, and they could overwrite your master branch.

@worldofpeace
Copy link
Contributor

A lot of the other scripts in lib/rpm look like they'd be useless on NixOS. But I guess this is enough to make those specific utilities work ok on macOS.

@worldofpeace worldofpeace merged commit 282b79a into NixOS:master Jan 19, 2020
@ericnorris
Copy link
Contributor Author

Thanks @worldofpeace!

Understood, I'll use a feature branch for any contributions going forward.

Re: "a lot of the other scripts..." agreed, and to be honest I'm not very familiar with RPM packaging, so I'm not sure why I would have ran into this via rpmbuild while others wouldn't. It doesn't seem like this would be a macOS-only thing.

Furthermore, I noticed that something replaces the the #!/bin/sh part of the find-{provides,requires} script; even before my patch, it looked like this:

#!/nix/store/5arhyyfgnfs01n1cgaf7s82ckzys3vbg-bash-4.4-p23/bin/sh

/usr/lib/rpm/rpmdeps --define="_use_internal_dependency_generator 1" --provides

I'm curious how the /bin/sh reference was "fixed", and wonder why whatever was doing that didn't also fix the /usr/lib/rpm bit.

Anyhow, thanks again for the merge, and if someone more familiar with these things has a better approach, I'm all ears.

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

2 participants