Hi,

When passed a random derivation name, "nix-env --set-flag" just exits
silently.  How about something along the lines of the attached patch?

Thanks,
Ludovic.

Index: src/nix-env/nix-env.cc
===================================================================
*** src/nix-env/nix-env.cc	(revision 12181)
--- src/nix-env/nix-env.cc	(working copy)
*************** static void opSetFlag(Globals & globals,
*** 762,767 ****
--- 762,773 ----
      string flagValue = *arg++;
      DrvNames selectors = drvNamesFromArgs(Strings(arg, opArgs.end()));
  
+     if (selectors.empty ())
+     {
+       printMsg (lvlError, format("no derivation named `%1%'") % opArgs);
+       return;
+     }
+ 
      /* Load the currently installed derivations. */
      PathLocks lock;
      lockProfile(lock, globals.profile);
_______________________________________________
nix-dev mailing list
[email protected]
https://mail.cs.uu.nl/mailman/listinfo/nix-dev

Reply via email to