svn commit: r303295 - stable/10/usr.bin/ar
Ed Maste
emaste at FreeBSD.org
Mon Jul 25 14:35:15 UTC 2016
Author: emaste
Date: Mon Jul 25 14:35:14 2016
New Revision: 303295
URL: https://svnweb.freebsd.org/changeset/base/303295
Log:
MFC r301974: ar: enable reproducible output by default when invoked as 'ar -s'
ar output is already deterministic by default for ar -q and ar -r, and
when invoked as ranlib. Make ar -s equivalent to ranlib and enable
deterministic output by default in that case too.
PR: 210330
Sponsored by: The FreeBSD Foundation
Modified:
stable/10/usr.bin/ar/ar.1
stable/10/usr.bin/ar/ar.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/usr.bin/ar/ar.1
==============================================================================
--- stable/10/usr.bin/ar/ar.1 Mon Jul 25 14:28:50 2016 (r303294)
+++ stable/10/usr.bin/ar/ar.1 Mon Jul 25 14:35:14 2016 (r303295)
@@ -23,7 +23,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 24, 2015
+.Dd July 25, 2016
.Dt AR 1
.Os
.Sh NAME
@@ -205,7 +205,12 @@ When used in combination with the
.Fl r
or
.Fl q
-option, insert 0's instead of the real mtime, uid and gid values
+option,
+with the
+.Fl s
+option without other options, or when invoked as
+.Nm ranlib ,
+insert 0's instead of the real mtime, uid and gid values
and 0644 instead of file mode from the members named by arguments
.Ar .
This ensures that checksums on the resulting archives are reproducible
Modified: stable/10/usr.bin/ar/ar.c
==============================================================================
--- stable/10/usr.bin/ar/ar.c Mon Jul 25 14:28:50 2016 (r303294)
+++ stable/10/usr.bin/ar/ar.c Mon Jul 25 14:35:14 2016 (r303295)
@@ -283,7 +283,8 @@ main(int argc, char **argv)
}
/* Set determinstic mode for -D, and by default without -U. */
- if (Dflag || (Uflag == 0 && (bsdar->mode == 'q' || bsdar->mode == 'r')))
+ if (Dflag || (Uflag == 0 && (bsdar->mode == 'q' || bsdar->mode == 'r' ||
+ (bsdar->mode == '\0' && bsdar->options & AR_S))))
bsdar->options |= AR_D;
if (bsdar->options & AR_A)
More information about the svn-src-stable-10
mailing list