Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 21ef8d5c8928
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f5364122b590
Choose a head ref
  • 3 commits
  • 2 files changed
  • 3 contributors

Commits on Jul 7, 2017

  1. stdenv: Harden hook runners

    Instead of eval, use a "nameref" to get the name of the array and
    iterate with that. Also, make the for-loop parameter a local variable,
    too.
    Ericson2314 committed Jul 7, 2017
    2
    Copy the full SHA
    a14cf06 View commit details
  2. Copy the full SHA
    e57a220 View commit details
  3. Merge pull request #27215 from obsidiansystems/stdenv-harden

    Harden stdenv in two misc ways
    Ericson2314 authored Jul 7, 2017
    Copy the full SHA
    f536412 View commit details
Showing with 10 additions and 5 deletions.
  1. +2 −1 pkgs/development/compilers/swift/patches/build-script-pax.patch
  2. +8 −4 pkgs/stdenv/generic/setup.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
--- swift/utils/build-script-impl 2017-01-23 12:47:20.401326309 -0600
+++ swift-pax/utils/build-script-impl 2017-01-23 13:24:10.339366996 -0600
@@ -1823,6 +1823,16 @@ function set_lldb_xcodebuild_options() {
@@ -1823,6 +1823,17 @@ function set_lldb_xcodebuild_options() {
fi
}

+## XXX: Taken from nixpkgs /pkgs/stdenv/generic/setup.sh
+isELF() {
+ local fn="$1"
+ local fd
+ local magic
+ exec {fd}< "$fn"
+ read -n 4 -u $fd magic
12 changes: 8 additions & 4 deletions pkgs/stdenv/generic/setup.sh
Original file line number Diff line number Diff line change
@@ -17,8 +17,9 @@ runHook() {
shift
local var="$hookName"
if [[ "$hookName" =~ Hook$ ]]; then var+=s; else var+=Hooks; fi
eval "local -a dummy=(\"\${$var[@]}\")"
for hook in "_callImplicitHook 0 $hookName" "${dummy[@]}"; do
local -n var
local hook
for hook in "_callImplicitHook 0 $hookName" "${var[@]}"; do
_eval "$hook" "$@"
done
return 0
@@ -32,8 +33,9 @@ runOneHook() {
shift
local var="$hookName"
if [[ "$hookName" =~ Hook$ ]]; then var+=s; else var+=Hooks; fi
eval "local -a dummy=(\"\${$var[@]}\")"
for hook in "_callImplicitHook 1 $hookName" "${dummy[@]}"; do
local -n var
local hook
for hook in "_callImplicitHook 1 $hookName" "${var[@]}"; do
if _eval "$hook" "$@"; then
return 0
fi
@@ -192,6 +194,7 @@ _addRpathPrefix() {
# Return success if the specified file is an ELF object.
isELF() {
local fn="$1"
local fd
local magic
exec {fd}< "$fn"
read -n 4 -u $fd magic
@@ -203,6 +206,7 @@ isELF() {
# "#!").
isScript() {
local fn="$1"
local fd
local magic
if ! [ -x /bin/sh ]; then return 0; fi
exec {fd}< "$fn"