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/nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3a6a2f88f263
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 85329cac35b3
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jan 25, 2021

  1. scripts/install-nix-from-closure: only show progress if a terminal is…

    … used
    
    While the progress dots during the copying of the store work fine on a
    normal terminal, those look pretty off if the script is run inside a
    provisioning script of e.g. `vagrant` or `packer` where `stderr` and
    `stdout` are captured:
    
        default: .
        default: ..
        default: .
        default: .
        default: .
    
    To work around this, the script checks with `-t 0` if it's
    running on an actual terminal and doesn't show the progress if that's not
    the case.
    
    (cherry picked from commit d9367a2)
    Ma27 authored and edolstra committed Jan 25, 2021

    Verified

    This commit was signed with the committer’s verified signature.
    edolstra Eelco Dolstra
    Copy the full SHA
    85329ca View commit details
Showing with 7 additions and 1 deletion.
  1. +7 −1 scripts/install-nix-from-closure.sh
8 changes: 7 additions & 1 deletion scripts/install-nix-from-closure.sh
Original file line number Diff line number Diff line change
@@ -154,9 +154,15 @@ fi
mkdir -p $dest/store

printf "copying Nix to %s..." "${dest}/store" >&2
# Insert a newline if no progress is shown.
if [ ! -t 0 ]; then
echo ""
fi

for i in $(cd "$self/store" >/dev/null && echo ./*); do
printf "." >&2
if [ -t 0 ]; then
printf "." >&2
fi
i_tmp="$dest/store/$i.$$"
if [ -e "$i_tmp" ]; then
rm -rf "$i_tmp"