From owner-freebsd-bugs@FreeBSD.ORG Fri Dec 4 21:50:01 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EA311065672 for ; Fri, 4 Dec 2009 21:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 50EE28FC12 for ; Fri, 4 Dec 2009 21:50:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4Lo1Hn076601 for ; Fri, 4 Dec 2009 21:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id nB4Lo1o5076600; Fri, 4 Dec 2009 21:50:01 GMT (envelope-from gnats) Resent-Date: Fri, 4 Dec 2009 21:50:01 GMT Resent-Message-Id: <200912042150.nB4Lo1o5076600@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Philip Kizer Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56C66106568F for ; Fri, 4 Dec 2009 21:44:27 +0000 (UTC) (envelope-from pckizer@nostrum.com) Received: from nostrum.com (nostrum-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:267::2]) by mx1.freebsd.org (Postfix) with ESMTP id 36E888FC14 for ; Fri, 4 Dec 2009 21:44:27 +0000 (UTC) Received: from nostrum.com (localhost [127.0.0.1]) by nostrum.com (8.14.3/8.14.3) with ESMTP id nB4FI2LF060085 for ; Fri, 4 Dec 2009 09:18:02 -0600 (CST) (envelope-from pckizer@nostrum.com) Received: (from root@localhost) by nostrum.com (8.14.3/8.14.3/Submit) id nB4FI2QD060084; Fri, 4 Dec 2009 09:18:02 -0600 (CST) (envelope-from pckizer) Message-Id: <200912041518.nB4FI2QD060084@nostrum.com> Date: Fri, 4 Dec 2009 09:18:02 -0600 (CST) From: Philip Kizer To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/141175: New cpio in FreeBSD 8 regresed and left out a previous option: -V (dots) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Philip Kizer List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 21:50:01 -0000 >Number: 141175 >Category: bin >Synopsis: New cpio in FreeBSD 8 regresed and left out a previous option: -V (dots) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Dec 04 21:50:00 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Philip Kizer >Release: FreeBSD 8.0-RELEASE i386 >Organization: >Environment: System: FreeBSD discord.test 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:48:17 UTC 2009 root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: In the new 8.0 release its replacement cpio is missing an option that existed in the previous version (and also exists in the various other OSes I use like Solaris and Linux). The option is "-V" or "--dots" to provide some level of verbosity while not being as voluminous as the "-v" mechanism. >How-To-Repeat: % cpio -oV Brief Usage: List: cpio -it < archive Extract: cpio -i < archive Create: cpio -o < filenames > archive Help: cpio --help >Fix: The correct behavior should look like: % find /var/tmp | cpio -oV > /tmp/try.cpio .... 6 blocks The following patch adapted from the 7.x version re-adds the option to the 8.x version: diff -ru cpio-8.0_RELEASE/bsdcpio.1 cpio/bsdcpio.1 --- cpio-8.0_RELEASE/bsdcpio.1 2009-10-24 20:10:29.000000000 -0500 +++ cpio/bsdcpio.1 2009-12-04 14:52:45.000000000 -0600 @@ -223,6 +223,8 @@ (i and p modes) Unconditionally overwrite existing files. Ordinarily, an older file will not overwrite a newer file on disk. +.It Fl V +Print a single dot (".") for each file to stderr as it is processed. .It Fl v Print the name of each file to stderr as it is processed. With diff -ru cpio-8.0_RELEASE/cmdline.c cpio/cmdline.c --- cpio-8.0_RELEASE/cmdline.c 2009-10-24 20:10:29.000000000 -0500 +++ cpio/cmdline.c 2009-12-04 12:07:07.000000000 -0600 @@ -50,7 +50,7 @@ /* * Short options for cpio. Please keep this sorted. */ -static const char *short_options = "0AaBC:F:O:cdE:f:H:hijLlmnopR:rtuvW:yZz"; +static const char *short_options = "0AaBC:F:O:cdE:f:H:hijLlmnopR:rtuvVW:yZz"; /* * Long options for cpio. Please keep this sorted. @@ -61,6 +61,7 @@ int equivalent; /* Equivalent short option. */ } cpio_longopts[] = { { "create", 0, 'o' }, + { "dot", 0, 'V' }, { "extract", 0, 'i' }, { "file", 1, 'F' }, { "format", 1, 'H' }, diff -ru cpio-8.0_RELEASE/cpio.c cpio/cpio.c --- cpio-8.0_RELEASE/cpio.c 2009-10-24 20:10:29.000000000 -0500 +++ cpio/cpio.c 2009-12-04 13:28:58.000000000 -0600 @@ -152,6 +152,7 @@ cpio->argc = argc; cpio->line_separator = '\n'; cpio->mode = '\0'; + cpio->dot = 0; cpio->verbose = 0; cpio->compress = '\0'; cpio->extract_flags = ARCHIVE_EXTRACT_NO_AUTODIR; @@ -275,6 +276,9 @@ cpio->extract_flags &= ~ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER; break; + case 'V': + cpio->dot++; + break; case 'v': /* POSIX 1997 */ cpio->verbose++; break; @@ -524,6 +528,9 @@ if (r != ARCHIVE_OK) cpio_errc(1, 0, archive_error_string(cpio->archive)); + if (cpio->dot) + fputc('\n',stderr); + if (!cpio->quiet) { blocks = (archive_position_uncompressed(cpio->archive) + 511) / 512; @@ -660,6 +667,10 @@ if (cpio->verbose) fprintf(stderr,"%s", destpath); + /* Print out a dot per file processed. */ + if (cpio->dot) + fputc('.', stderr); + /* * Option_link only makes sense in pass mode and for * regular files. Also note: if a link operation fails @@ -858,6 +869,8 @@ continue; if (cpio->verbose) fprintf(stdout, "%s\n", destpath); + if (cpio->dot) + fputc('.',stderr); if (cpio->uid_override >= 0) archive_entry_set_uid(entry, cpio->uid_override); if (cpio->gid_override >= 0) @@ -877,6 +890,8 @@ r = archive_write_close(ext); if (r != ARCHIVE_OK) cpio_errc(1, 0, archive_error_string(ext)); + if (cpio->dot) + fputc('\n',stderr); if (!cpio->quiet) { blocks = (archive_position_uncompressed(a) + 511) / 512; @@ -1081,6 +1096,9 @@ if (r != ARCHIVE_OK) cpio_errc(1, 0, archive_error_string(cpio->archive)); + if (cpio->dot) + fputc('\n',stderr); + if (!cpio->quiet) { blocks = (archive_position_uncompressed(cpio->archive) + 511) / 512; diff -ru cpio-8.0_RELEASE/cpio.h cpio/cpio.h --- cpio-8.0_RELEASE/cpio.h 2009-10-24 20:10:29.000000000 -0500 +++ cpio/cpio.h 2009-12-01 13:46:10.000000000 -0600 @@ -51,6 +51,7 @@ char compress; /* -j, -y, or -z */ const char *format; /* -H format */ int bytes_per_block; /* -b block_size */ + int dot; /* -V */ int verbose; /* -v */ int quiet; /* --quiet */ int extract_flags; /* Flags for extract operation */ >Release-Note: >Audit-Trail: >Unformatted: