From owner-svn-src-head@freebsd.org Tue Jul 21 22:57:29 2015 Return-Path: Delivered-To: svn-src-head@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 D59F19A74DD; Tue, 21 Jul 2015 22:57:29 +0000 (UTC) (envelope-from cem@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 C68691C0C; Tue, 21 Jul 2015 22:57:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6LMvTax098066; Tue, 21 Jul 2015 22:57:29 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6LMvS1A098063; Tue, 21 Jul 2015 22:57:28 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201507212257.t6LMvS1A098063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 21 Jul 2015 22:57:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285772 - head/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 22:57:30 -0000 Author: cem Date: Tue Jul 21 22:57:27 2015 New Revision: 285772 URL: https://svnweb.freebsd.org/changeset/base/285772 Log: patch(1): Add -Vnone option to disable backup files Differential Revision: https://reviews.freebsd.org/D3146 Reviewed by: pfg Approved by: markj (mentor) MFC after: 1 week Relnotes: yes Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/patch/backupfile.c head/usr.bin/patch/patch.1 head/usr.bin/patch/patch.c Modified: head/usr.bin/patch/backupfile.c ============================================================================== --- head/usr.bin/patch/backupfile.c Tue Jul 21 22:56:46 2015 (r285771) +++ head/usr.bin/patch/backupfile.c Tue Jul 21 22:57:27 2015 (r285772) @@ -219,11 +219,11 @@ invalid_arg(const char *kind, const char } static const char *backup_args[] = { - "never", "simple", "nil", "existing", "t", "numbered", 0 + "none", "never", "simple", "nil", "existing", "t", "numbered", 0 }; static enum backup_type backup_types[] = { - simple, simple, numbered_existing, + none, simple, simple, numbered_existing, numbered_existing, numbered, numbered }; Modified: head/usr.bin/patch/patch.1 ============================================================================== --- head/usr.bin/patch/patch.1 Tue Jul 21 22:56:46 2015 (r285771) +++ head/usr.bin/patch/patch.1 Tue Jul 21 22:57:27 2015 (r285772) @@ -21,7 +21,7 @@ .\" .\" $OpenBSD: patch.1,v 1.27 2014/04/15 06:26:54 jmc Exp $ .\" $FreeBSD$ -.Dd June 15, 2014 +.Dd July 21, 2015 .Dt PATCH 1 .Os .Sh NAME @@ -39,7 +39,7 @@ .Op Fl o Ar out-file .Op Fl p Ar strip-count .Op Fl r Ar rej-name -.Op Fl V Cm t | nil | never +.Op Fl V Cm t | nil | never | none .Op Fl x Ar number .Op Fl z Ar backup-ext .Op Fl Fl posix @@ -296,8 +296,8 @@ Forces .Nm to interpret the patch file as a unified context diff (a unidiff). .It Xo -.Fl V Cm t | nil | never , -.Fl Fl version-control Cm t | nil | never +.Fl V Cm t | nil | never | none , +.Fl Fl version-control Cm t | nil | never | none .Xc Causes the next argument to be interpreted as a method for creating backup file names. @@ -328,6 +328,8 @@ Make numbered backups of files that alre simple backups of the others. .It Cm never , simple Always make simple backups. +.It Cm none +Do not make backups. .El .It Fl v , Fl Fl version Causes Modified: head/usr.bin/patch/patch.c ============================================================================== --- head/usr.bin/patch/patch.c Tue Jul 21 22:56:46 2015 (r285771) +++ head/usr.bin/patch/patch.c Tue Jul 21 22:57:27 2015 (r285772) @@ -109,6 +109,8 @@ static bool remove_empty_files = false; /* true if -R was specified on command line. */ static bool reverse_flag_specified = false; +static bool Vflag = false; + /* buffer holding the name of the rejected patch file. */ static char rejname[NAME_MAX + 1]; @@ -201,7 +203,7 @@ main(int argc, char *argv[]) Argv = argv; get_some_switches(); - if (backup_type == none) { + if (!Vflag) { if ((v = getenv("PATCH_VERSION_CONTROL")) == NULL) v = getenv("VERSION_CONTROL"); if (v != NULL || !posix) @@ -595,6 +597,7 @@ get_some_switches(void) break; case 'V': backup_type = get_version(optarg); + Vflag = true; break; #ifdef DEBUGGING case 'x': @@ -631,8 +634,8 @@ usage(void) fprintf(stderr, "usage: patch [-bCcEeflNnRstuv] [-B backup-prefix] [-D symbol] [-d directory]\n" " [-F max-fuzz] [-i patchfile] [-o out-file] [-p strip-count]\n" -" [-r rej-name] [-V t | nil | never] [-x number] [-z backup-ext]\n" -" [--posix] [origfile [patchfile]]\n" +" [-r rej-name] [-V t | nil | never | none] [-x number]\n" +" [-z backup-ext] [--posix] [origfile [patchfile]]\n" " patch