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

bashdb: init at 4.4-0.92 #22275

Merged
merged 3 commits into from Jan 29, 2017
Merged

bashdb: init at 4.4-0.92 #22275

merged 3 commits into from Jan 29, 2017

Conversation

nthorne
Copy link
Contributor

@nthorne nthorne commented Jan 29, 2017

Motivation for this change

To introduce the Bash script debugger.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

name = "bashdb-4.4-0.92";

src = fetchurl {
url = "mirror://sourceforge/sourceforge/bashdb/bashdb-4.4-0.92.tar.bz2";
Copy link
Contributor

@joachifm joachifm Jan 29, 2017

Choose a reason for hiding this comment

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

What about using mirror://sourceforge/bashdb (instead of sourceforge/sourceforge/bashdb)

Also, consider re-using name (or factoring out a version attr) in src.url.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestions! I'll give them a try,

@@ -1,10 +1,15 @@
{ stdenv, fetchurl }:

let
basename = "bashdb-4.4-0.92";
Copy link
Contributor

Choose a reason for hiding this comment

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

If you make the attrset passed to mkDerivation recursive, you can inline this, as in

stdenv.mkDerivation rec {
  name = "...";
   src = {
     url = ".../${name}.tar.bz2";
   }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Really! I did not know that. So, by adding the rec keyword, attributes can refer to other attributes within the same set? Are there any drawbacks to using the rec keyword, or is it to be preferred over the let version that I first wrote?

Copy link
Contributor

Choose a reason for hiding this comment

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

For very complicated stuff it may be clearer to use explicit recursion (to not lose track of what is being referred to exactly), but it's almost always better to use rec if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, then I know. Thank you!

Copy link
Contributor

Choose a reason for hiding this comment

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

rec { foo = "x"; bar = foo; }

basically desugars to

let self = { foo = "x"; bar = self.foo; }; in self

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah. That makes it a lot clearer; thanks for explaining!

@joachifm joachifm merged commit 2eb8163 into NixOS:master Jan 29, 2017
@joachifm
Copy link
Contributor

Thank you

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