From e6cb3d0a0dcfe13e9b493afdc4e2107668ec99ff Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 6 Sep 2011 12:06:30 +0000 Subject: =?UTF-8?q?*=20Added=20a=20command=20=E2=80=98nix-store=20--verify?= =?UTF-8?q?-paths=20PATHS=E2=80=99=20to=20check=20whether=20=20=20the=20co?= =?UTF-8?q?ntents=20of=20any=20of=20the=20given=20store=20paths=20have=20b?= =?UTF-8?q?een=20modified.=20=20=20E.g.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit $ nix-store --verify-path $(nix-store -qR /var/run/current-system) path `/nix/store/m2smyiwbxidlprfxfz4rjlvz2c3mg58y-etc' was modified! expected hash `fc87e271c5fdf179b47939b08ad13440493805584b35e3014109d04d8436e7b8', got `20f1a47281b3c0cbe299ce47ad5ca7340b20ab34246426915fce0ee9116483aa' All paths are checked; the exit code is 1 if any path has been modified, 0 otherwise. --- src/libmain/shared.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/libmain/shared.cc') diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index f0035c358..8532cdaad 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -187,12 +187,11 @@ static void initAndRun(int argc, char * * argv) ignore options for the ATerm library. */ for (Strings::iterator i = args.begin(); i != args.end(); ++i) { string arg = *i; - if (string(arg, 0, 4) == "-at-") ; - else if (arg.length() > 2 && arg[0] == '-' && arg[1] != '-' && !isdigit(arg[1])) { + if (arg.length() > 2 && arg[0] == '-' && arg[1] != '-' && !isdigit(arg[1])) { for (unsigned int j = 1; j < arg.length(); j++) if (isalpha(arg[j])) remaining.push_back((string) "-" + arg[j]); - else { + else { remaining.push_back(string(arg, j)); break; } @@ -332,6 +331,9 @@ static void * oomHandler(size_t requested) } +int exitCode = 0; + + } @@ -390,7 +392,5 @@ int main(int argc, char * * argv) return 1; } - return 0; + return exitCode; } - - -- cgit v1.2.3