From owner-svn-src-all@freebsd.org Mon Aug 31 17:30:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCCFB9C685E; Mon, 31 Aug 2015 17:30:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC20792A; Mon, 31 Aug 2015 17:30:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7VHUEha002194; Mon, 31 Aug 2015 17:30:14 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7VHUE9Y002192; Mon, 31 Aug 2015 17:30:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201508311730.t7VHUE9Y002192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 31 Aug 2015 17:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r287326 - stable/10/usr.bin/ar X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Aug 2015 17:30:14 -0000 Author: emaste Date: Mon Aug 31 17:30:13 2015 New Revision: 287326 URL: https://svnweb.freebsd.org/changeset/base/287326 Log: MFC r285844: ar: add -U (unique) option to disable -D (deterministic) mode This is required in order for us to support deterministic mode by default. If multiple -D or -U options are specified on the command line, the final one takes precedence. GNU ar also uses -U for this. PR: 196929 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 Aug 31 12:42:21 2015 (r287325) +++ stable/10/usr.bin/ar/ar.1 Mon Aug 31 17:30:13 2015 (r287326) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 22, 2011 +.Dd August 31, 2015 .Dt AR 1 .Os .Sh NAME @@ -66,6 +66,7 @@ .Op Fl D .Op Fl f .Op Fl s | Fl S +.Op Fl U .Op Fl v .Op Fl z .Ar archive @@ -82,6 +83,7 @@ .Op Fl j .Op Fl s | Fl S .Op Fl u +.Op Fl U .Op Fl v .Op Fl z .Ar archive @@ -112,6 +114,7 @@ .Fl M .Nm ranlib .Op Fl D +.Op Fl U .Ar archive ... .Sh DESCRIPTION The @@ -207,6 +210,11 @@ and 0644 instead of file mode from the m .Ar . This ensures that checksums on the resulting archives are reproducible when member contents are identical. +If multiple +.Fl D +and +.Fl U +options are specified on the command line, the final one takes precedence. .It Fl f Synonymous with option .Fl T . @@ -316,6 +324,19 @@ option, the members specified by argumen .Ar will be extracted only if they are newer than the corresponding files in the file system. +.It Fl U +When used in combination with the +.Fl r +or +.Fl q +option, insert the real mtime, uid and gid, and file mode values +from the members named by arguments +.Ar . +If multiple +.Fl D +and +.Fl U +options are specified on the command line, the final one takes precedence. .It Fl v Provide verbose output. When used with the Modified: stable/10/usr.bin/ar/ar.c ============================================================================== --- stable/10/usr.bin/ar/ar.c Mon Aug 31 12:42:21 2015 (r287325) +++ stable/10/usr.bin/ar/ar.c Mon Aug 31 17:30:13 2015 (r287326) @@ -113,7 +113,7 @@ main(int argc, char **argv) len = strlen(bsdar->progname); if (len >= strlen("ranlib") && strcmp(bsdar->progname + len - strlen("ranlib"), "ranlib") == 0) { - while ((opt = getopt_long(argc, argv, "tDV", longopts, + while ((opt = getopt_long(argc, argv, "tDUV", longopts, NULL)) != -1) { switch(opt) { case 't': @@ -122,6 +122,9 @@ main(int argc, char **argv) case 'D': bsdar->options |= AR_D; break; + case 'U': + bsdar->options &= ~AR_D; + break; case 'V': ranlib_version(); break; @@ -157,7 +160,7 @@ main(int argc, char **argv) } } - while ((opt = getopt_long(argc, argv, "abCcdDfijlMmopqrSsTtuVvxz", + while ((opt = getopt_long(argc, argv, "abCcdDfijlMmopqrSsTtUuVvxz", longopts, NULL)) != -1) { switch(opt) { case 'a': @@ -216,6 +219,9 @@ main(int argc, char **argv) case 't': set_mode(bsdar, opt); break; + case 'U': + bsdar->options &= ~AR_D; + break; case 'u': bsdar->options |= AR_U; break; @@ -364,9 +370,9 @@ bsdar_usage(void) (void)fprintf(stderr, "\tar -m [-Tjsvz] archive file ...\n"); (void)fprintf(stderr, "\tar -m [-Tabijsvz] position archive file ...\n"); (void)fprintf(stderr, "\tar -p [-Tv] archive [file ...]\n"); - (void)fprintf(stderr, "\tar -q [-TcDjsvz] archive file ...\n"); - (void)fprintf(stderr, "\tar -r [-TcDjsuvz] archive file ...\n"); - (void)fprintf(stderr, "\tar -r [-TabcDijsuvz] position archive file ...\n"); + (void)fprintf(stderr, "\tar -q [-TcDjsUvz] archive file ...\n"); + (void)fprintf(stderr, "\tar -r [-TcDjsUuvz] archive file ...\n"); + (void)fprintf(stderr, "\tar -r [-TabcDijsUuvz] position archive file ...\n"); (void)fprintf(stderr, "\tar -s [-jz] archive\n"); (void)fprintf(stderr, "\tar -t [-Tv] archive [file ...]\n"); (void)fprintf(stderr, "\tar -x [-CTouv] archive [file ...]\n"); @@ -378,7 +384,7 @@ static void ranlib_usage(void) { - (void)fprintf(stderr, "usage: ranlib [-t] archive ...\n"); + (void)fprintf(stderr, "usage: ranlib [-DtU] archive ...\n"); (void)fprintf(stderr, "\tranlib -V\n"); exit(EX_USAGE); }