git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit351187d8482a1fe2d7bb957f7b99c3a13ce68db4 authorDoron Behar <doron.behar@gmail.com> dateSat 22 May 2021, 10:14 (5 years ago) parent213cde9
1 file changed+6−2
pkgs/development/interpreters/octave/build-env.nix+6−2
pkgs/development/interpreters/octave/build-env.nix+6−2
@@ -40,11 +40,15 @@ in buildEnv {
4040 cd $out
4141 fi
4242
43− # Remove symlinks to the input tarballs, they aren't needed.
44− rm $out/*.tar.gz
43+ # Remove symlinks to the input tarballs, they aren't needed, use -f so it
44+ # will not fail if no .tar.gz symlinks are there - for example if
45+ # sommething which is not a tarball used as a package
46+ rm -f $out/*.tar.gz
4547
4648 createOctavePackagesPath $out ${octave}
4749
50+ # Create the file even if the loop afterwards has no packages to run over
51+ touch $out/.octave_packages
4852 for path in ${lib.concatStringsSep " " packages}; do
4953 if [ -e $path/*.tar.gz ]; then
5054 $out/bin/octave-cli --eval "pkg local_list $out/.octave_packages; \