diff options
| author | Roland McGrath <[email protected]> | 2011-11-05 21:08:07 -0700 |
|---|---|---|
| committer | Roland McGrath <[email protected]> | 2011-11-05 21:08:07 -0700 |
| commit | e5ba2a160bea234b1f38d6e4e7a09ef898017c51 (patch) | |
| tree | e906a628062ca023550d2212b6c934e74ef225bd /src | |
| parent | 4fa988e13d09465b8ae4f605333fabf39d50fd30 (diff) | |
ar: Implement -D.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/ar.c | 13 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d777ca1a..8cfa9860 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2011-11-05 Roland McGrath <[email protected]> + * 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 <[email protected]> @@ -95,6 +95,8 @@ static const struct argp_option options[] = { 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 }, @@ -141,6 +143,7 @@ static bool allow_truncate_fname; 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; @@ -380,6 +383,10 @@ parse_opt (int key, char *arg __attribute__ ((unused)), allow_truncate_fname = true; break; + case 'D': + deterministic_output = true; + break; + case 'u': update_newer = true; break; @@ -1295,9 +1302,9 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc, 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; |
