Date: Thu, 16 Jun 2016 21:22:27 +0000 (UTC) From: Ed Maste <emaste@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301974 - head/usr.bin/ar Message-ID: <201606162122.u5GLMRwK054902@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: emaste Date: Thu Jun 16 21:22:26 2016 New Revision: 301974 URL: https://svnweb.freebsd.org/changeset/base/301974 Log: 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 Reviewed by: bdrewery Approved by: re (gjb) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6871 Modified: head/usr.bin/ar/ar.1 head/usr.bin/ar/ar.c Modified: head/usr.bin/ar/ar.1 ============================================================================== --- head/usr.bin/ar/ar.1 Thu Jun 16 21:14:25 2016 (r301973) +++ head/usr.bin/ar/ar.1 Thu Jun 16 21:22:26 2016 (r301974) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 2015 +.Dd June 16, 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: head/usr.bin/ar/ar.c ============================================================================== --- head/usr.bin/ar/ar.c Thu Jun 16 21:14:25 2016 (r301973) +++ head/usr.bin/ar/ar.c Thu Jun 16 21:22:26 2016 (r301974) @@ -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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606162122.u5GLMRwK054902>