X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fvhashify.c;h=f7b83bde9dcfce834de1f430f52845b6717606a7;hb=b0a62d195efca12c5cb9e7c0b3bea3be2cd57fc9;hp=34e32a9012c1719f156d6592eba64b085d4f604a;hpb=fc28db1eb4146796ec27c2fb15780d6303120261;p=util-vserver.git diff --git a/src/vhashify.c b/src/vhashify.c index 34e32a9..f7b83bd 100644 --- a/src/vhashify.c +++ b/src/vhashify.c @@ -1,4 +1,4 @@ -// $Id: vhashify.c 2403 2006-11-24 23:06:08Z dhozac $ --*- c -*-- +// $Id: vhashify.c 2475 2007-01-27 09:38:56Z dhozac $ --*- c -*-- // Copyright (C) 2005 Enrico Scholz // @@ -20,6 +20,8 @@ # include #endif +#define UTIL_VSERVER_UNIFY_MTIME_OPTIONAL + #include "vhashify.h" #include "util.h" @@ -70,6 +72,7 @@ #define CMD_SLEDGE 0x1002 #define CMD_MANUALLY 0x1003 #define CMD_REFRESH 0x1004 +#define CMD_NOMTIME 0x1005 struct option const CMDLINE_OPTIONS[] = { @@ -80,6 +83,7 @@ CMDLINE_OPTIONS[] = { { "sledgehammer", no_argument, 0, CMD_SLEDGE }, { "manually", no_argument, 0, CMD_MANUALLY }, { "refresh", no_argument, 0, CMD_REFRESH }, + { "ignore-mtime", no_argument, 0, CMD_NOMTIME }, { "dry-run", no_argument, 0, 'n' }, { "verbose", no_argument, 0, 'v' }, { 0,0,0,0 } @@ -289,7 +293,7 @@ addStatHash(hashFunctionContext *h_ctx, struct stat const * const st) SET_ATTR(gid), SET_ATTR(rdev), SET_ATTR(size), - SET_ATTR(mtime) + .mtime = (global_args->ignore_mtime ? 0 : st->st_mtime), }; #undef SET_ATTR @@ -688,6 +692,7 @@ int main(int argc, char *argv[]) .insecure = 0, .dry_run = false, .do_refresh = false, + .ignore_mtime = false, }; Vector_init(&global_info.hash_dirs, sizeof(struct HashDirInfo)); @@ -706,6 +711,7 @@ int main(int argc, char *argv[]) case CMD_INSECURE : args.insecure = 1; break; case CMD_SLEDGE : args.insecure = 2; break; case CMD_REFRESH : args.do_refresh = true; break; + case CMD_NOMTIME : args.ignore_mtime = true; break; case 'n' : args.dry_run = true; break; case 'v' : ++args.verbosity; break; default :