Changeset 2475

Show
Ignore:
Timestamp:
01/27/07 10:38:56 (2 years ago)
Author:
dhozac
Message:

Add an option (--ignore-mtime) to vhashify to hashify files with differing mtimes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib_internal/unify.h

    r1926 r2475  
    4747          (LHS)->st_ino ==(RHS)->st_ino)) 
    4848 
    49 #define Unify_isUnifyable(LHS, RHS)           \ 
     49#define _Unify_isUnifyable(LHS, RHS)          \ 
    5050  ((bool)((LHS)->st_dev  ==(RHS)->st_dev  &&    \ 
    5151          (LHS)->st_ino  !=(RHS)->st_ino  &&    \ 
     
    5353          (LHS)->st_uid  ==(RHS)->st_uid  &&    \ 
    5454          (LHS)->st_gid  ==(RHS)->st_gid  &&    \ 
    55           (LHS)->st_size ==(RHS)->st_size &&    \ 
    56           (LHS)->st_mtime==(RHS)->st_mtime)) 
     55          (LHS)->st_size ==(RHS)->st_size)) 
     56#ifdef UTIL_VSERVER_UNIFY_MTIME_OPTIONAL 
     57#  define Unify_isUnifyable(LHS, RHS)           \ 
     58    ((bool)(_Unify_isUnifyable(LHS, RHS)  &&    \ 
     59          (global_args->ignore_mtime ||         \ 
     60           (LHS)->st_mtime==(RHS)->st_mtime))) 
     61#else 
     62#  define Unify_isUnifyable(LHS, RHS)           \ 
     63        _Unify_isUnifyable(LHS, RHS) 
     64#endif 
    5765   
    5866 
  • trunk/src/vhashify.c

    r2403 r2475  
    2121#endif 
    2222 
     23#define UTIL_VSERVER_UNIFY_MTIME_OPTIONAL 
     24 
    2325#include "vhashify.h" 
    2426#include "util.h" 
     
    7173#define CMD_MANUALLY            0x1003 
    7274#define CMD_REFRESH             0x1004 
     75#define CMD_NOMTIME             0x1005 
    7376 
    7477struct option const 
     
    8184  { "manually",     no_argument,        0, CMD_MANUALLY }, 
    8285  { "refresh",      no_argument,        0, CMD_REFRESH }, 
     86  { "ignore-mtime", no_argument,        0, CMD_NOMTIME }, 
    8387  { "dry-run",      no_argument,        0, 'n' }, 
    8488  { "verbose",      no_argument,        0, 'v' }, 
     
    290294    SET_ATTR(rdev), 
    291295    SET_ATTR(size), 
    292     SET_ATTR(mtime) 
     296    .mtime = (global_args->ignore_mtime ? 0 : st->st_mtime), 
    293297  }; 
    294298 
     
    689693    .dry_run            =  false, 
    690694    .do_refresh         =  false, 
     695    .ignore_mtime       =  false, 
    691696  }; 
    692697 
     
    707712      case CMD_SLEDGE           :  args.insecure    = 2;    break; 
    708713      case CMD_REFRESH          :  args.do_refresh  = true; break; 
     714      case CMD_NOMTIME          :  args.ignore_mtime = true; break; 
    709715      case 'n'                  :  args.dry_run     = true; break; 
    710716      case 'v'                  :  ++args.verbosity; break; 
  • trunk/src/vhashify.h

    r1922 r2475  
    3333    bool                                dry_run; 
    3434    bool                                do_refresh; 
     35    bool                                ignore_mtime; 
    3536}; 
    3637