2011-11-05 Roland McGrath <roland@hack.frob.com>
+ * ar.c (deterministic_output): New flag variable.
+ (options, parse_opt): Grok -D to set it.
+ (do_oper_insert): When set, use zero from mtime, uid, and gid.
+
* ar.c (do_oper_insert): Fix check on elf_rawfile return value.
2011-10-04 Marek Polacek <mpolacek@redhat.com>
{ NULL, 'a', NULL, 0, N_("Insert file after [MEMBER]."), 0 },
{ NULL, 'b', NULL, 0, N_("Insert file before [MEMBER]."), 0 },
{ NULL, 'i', NULL, 0, N_("Same as -b."), 0 },
+ { NULL, 'D', NULL, 0,
+ N_("Use zero for uid, gid, and date in archive members."), 0 },
{ NULL, 'c', NULL, 0, N_("Suppress message when library has to be created."),
0 },
{ NULL, 'P', NULL, 0, N_("Use full path for file matching."), 0 },
static bool force_symtab;
static bool suppress_create_msg;
static bool full_path;
+static bool deterministic_output;
static bool update_newer;
static enum { ipos_none, ipos_before, ipos_after } ipos;
allow_truncate_fname = true;
break;
+ case 'D':
+ deterministic_output = true;
+ break;
+
case 'u':
update_newer = true;
break;
found[cnt]->old_off == -1l ? 'a' : 'r', argv[cnt]);
found[cnt]->elf = newelf;
- found[cnt]->sec = newst.st_mtime;
- found[cnt]->uid = newst.st_uid;
- found[cnt]->gid = newst.st_gid;
+ found[cnt]->sec = deterministic_output ? 0 : newst.st_mtime;
+ found[cnt]->uid = deterministic_output ? 0 : newst.st_uid;
+ found[cnt]->gid = deterministic_output ? 0 : newst.st_gid;
found[cnt]->mode = newst.st_mode;
found[cnt]->name = bname;