From 351187d8482a1fe2d7bb957f7b99c3a13ce68db4 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sat, 22 May 2021 10:14:34 +0300 Subject: [PATCH] octave.buildEnv: Handle better no packages situation Use `rm -f` for *.tar.gz files so the command won't fail in case there aren't any packages. Create the `$out/.octave_packages` file before iterating the packages. --- pkgs/development/interpreters/octave/build-env.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/octave/build-env.nix b/pkgs/development/interpreters/octave/build-env.nix index 433026f0a7e..59575f95fc4 100644 --- a/pkgs/development/interpreters/octave/build-env.nix +++ b/pkgs/development/interpreters/octave/build-env.nix @@ -40,11 +40,15 @@ in buildEnv { cd $out fi - # Remove symlinks to the input tarballs, they aren't needed. - rm $out/*.tar.gz + # Remove symlinks to the input tarballs, they aren't needed, use -f so it + # will not fail if no .tar.gz symlinks are there - for example if + # sommething which is not a tarball used as a package + rm -f $out/*.tar.gz createOctavePackagesPath $out ${octave} + # Create the file even if the loop afterwards has no packages to run over + touch $out/.octave_packages for path in ${lib.concatStringsSep " " packages}; do if [ -e $path/*.tar.gz ]; then $out/bin/octave-cli --eval "pkg local_list $out/.octave_packages; \