--- main.c.can-1999-1572 2005-02-09 11:45:04.561159769 -0700 +++ main.c 2005-02-09 11:46:47.488514709 -0700 @@ -1,5 +1,5 @@ /* main.c - main program and argument processing for cpio. - Copyright (C) 1990, 1991, 1992, 2001 Free Software Foundation, Inc. + Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -11,9 +11,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Written by Phil Nelson <phil@cs.wwu.edu>, David MacKenzie <djm@gnu.ai.mit.edu>, @@ -69,6 +69,7 @@ {"reset-access-time", 0, &reset_time_flag, TRUE}, {"unconditional", 0, &unconditional_flag, TRUE}, {"verbose", 0, &verbose_flag, TRUE}, + {"verbose-skip", 0, &verbose_skip_flag, TRUE}, {"version", 0, 0, 131}, #ifdef DEBUG_CPIO {"debug", 0, &debug_flag, TRUE}, @@ -87,22 +88,22 @@ Usage: %s {-o|--create} [-0acvABLV] [-C bytes] [-H format] [-M message]\n\ [-O [[user@]host:]archive] [-F [[user@]host:]archive]\n\ [--file=[[user@]host:]archive] [--format=format] [--message=message]\n\ - [--null] [--reset-access-time] [--verbose] [--dot] [--append]\n\ - [--block-size=blocks] [--dereference] [--io-size=bytes] [--quiet]\n\ - [--force-local] [--rsh-command=command] [--help] [--version] < name-list\n\ - [> archive]\n", program_name); + [--null] [--reset-access-time] [--verbose] [--verbose-skip] [--dot]\n\ + [--append] [--block-size=blocks] [--dereference] [--io-size=bytes]\n\ + [--quiet] [--force-local] [--rsh-command=command] [--help] [--version]\n\ + < name-list [> archive]\n", program_name); fprintf (fp, "\ %s {-i|--extract} [-bcdfmnrtsuvBSV] [-C bytes] [-E file] [-H format]\n\ [-M message] [-R [user][:.][group]] [-I [[user@]host:]archive]\n\ [-F [[user@]host:]archive] [--file=[[user@]host:]archive]\n\ [--make-directories] [--nonmatching] [--preserve-modification-time]\n\ [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] [--dot]\n\ - [--unconditional] [--verbose] [--block-size=blocks] [--swap-halfwords]\n\ - [--io-size=bytes] [--pattern-file=file] [--format=format]\n\ - [--owner=[user][:.][group]] [--no-preserve-owner] [--message=message]\n\ - [--force-local] [--no-absolute-filenames] [--sparse] [--only-verify-crc]\n\ - [--quiet] [--rsh-command=command] [--help] [--version] [pattern...]\n\ - [< archive]\n", + [--unconditional] [--verbose] [--verbose-skip] [--block-size=blocks]\n\ + [--swap-halfwords] [--io-size=bytes] [--pattern-file=file]\n\ + [--format=format] [--owner=[user][:.][group]] [--no-preserve-owner]\n\ + [--message=message] [--force-local] [--no-absolute-filenames]\n\ + [--sparse] [--only-verify-crc] [--quiet] [--rsh-command=command]\n\ + [--help] [--version] [pattern...] [< archive]\n", program_name); fprintf (fp, "\ %s {-p|--pass-through} [-0adlmuvLV] [-R [user][:.][group]]\n\ @@ -131,6 +132,7 @@ if (argc < 2) usage (stderr, 2); + rsh_command_option = getenv("CPIO_RSH"); xstat = lstat; while ((c = getopt_long (argc, argv, @@ -353,6 +355,10 @@ verbose_flag = TRUE; break; + case 'w': /* Verbose Skip! */ + verbose_skip_flag = TRUE; + break; + case 'V': /* Print `.' for each file. */ dot_flag = TRUE; break; @@ -508,7 +514,7 @@ bzero (zeros_512, 512); } -int +void main (argc, argv) int argc; char *argv[]; @@ -516,7 +522,6 @@ setlocale (LC_ALL, ""); program_name = argv[0]; - umask (0); #ifdef __TURBOC__ _fmode = O_BINARY; /* Put stdin and stdout in binary mode. */ @@ -527,6 +532,7 @@ #endif process_args (argc, argv); + sys_umask = umask (0); initialize_buffers (); --- extern.h.can-1999-1572 +++ extern.h @@ -1,5 +1,5 @@ /* extern.h - External declarations for cpio. Requires system.h. - Copyright (C) 1990, 1991, 1992, 2001 Free Software Foundation, Inc. + Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -11,9 +11,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ enum archive_format { @@ -29,6 +29,7 @@ extern int table_flag; extern int unconditional_flag; extern int verbose_flag; +extern int verbose_skip_flag; extern int dot_flag; extern int link_flag; extern int retain_time_flag; @@ -83,6 +84,7 @@ extern char output_is_seekable; extern int f_force_local; extern char *program_name; +extern mode_t sys_umask; extern int (*xstat) (); extern void (*copy_function) (); @@ -165,8 +167,6 @@ void copy_files_tape_to_disk P_((int in_des, int out_des, long num_bytes)); void copy_files_disk_to_tape P_((int in_des, int out_des, long num_bytes, char *filename)); void copy_files_disk_to_disk P_((int in_des, int out_des, long num_bytes, char *filename)); -void warn_if_file_changed P_((char *file_name, unsigned long old_file_size, - unsigned long old_file_mtime)); void create_all_directories P_((char *name)); void prepare_append P_((int out_file_des)); char *find_inode_file P_((unsigned long node_num, --- global.c.can-1999-1572 +++ global.c @@ -1,5 +1,5 @@ /* global.c - global variables and initial values for cpio. - Copyright (C) 1990, 1991, 1992, 2001 Free Software Foundation, Inc. + Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -11,9 +11,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <sys/types.h> #include "cpiohdr.h" @@ -49,6 +49,9 @@ /* If TRUE, list the files processed, or ls -l style output with -t. (-v) */ int verbose_flag = FALSE; +/* If TRUE, list the files not processed. (-w) */ +int verbose_skip_flag = FALSE; + /* If TRUE, print a . for each file processed. (-V) */ int dot_flag = FALSE; @@ -192,6 +195,9 @@ /* The name this program was run with. */ char *program_name; +/* Debian hack to make the -d option honor the umask. */ +mode_t sys_umask; + /* A pointer to either lstat or stat, depending on whether dereferencing of symlinks is done for input files. */ int (*xstat) (); --- cpio.texi.can-1999-1572 2005-02-09 11:58:07.328334536 -0700 +++ cpio.texi 2005-02-09 11:58:07.328334536 -0700 @@ -259,7 +259,7 @@ [-M message] [-O [[user@@]host:]archive] [-F [[user@@]host:]archive] [--file=[[user@@]host:]archive] [--format=format] [--message=message][--null] [--reset-access-time] [--verbose] -[--dot] [--append] [--block-size=blocks] [--dereference] +[--verbose-skip] [--dot] [--append] [--block-size=blocks] [--dereference] [--io-size=bytes] [--rsh-command=command] [--help] [--version] < name-list [> archive] @end example @@ -284,9 +284,9 @@ [--file=[[user@@]host:]archive] [--make-directories] [--nonmatching] [--preserve-modification-time] [--numeric-uid-gid] [--rename] [--list] [--swap-bytes] [--swap] -[--dot] [--unconditional] [--verbose] [--block-size=blocks] -[--swap-halfwords] [--io-size=bytes] [--pattern-file=file] -[--format=format] [--owner=[user][:.][group]] +[--dot] [--unconditional] [--verbose] [--verbose-skip] +[--block-size=blocks] [--swap-halfwords] [--io-size=bytes] +[--pattern-file=file] [--format=format] [--owner=[user][:.][group]] [--no-preserve-owner] [--message=message] [--help] [--version] [-no-absolute-filenames] [--sparse] [-only-verify-crc] [-quiet] [--rsh-command=command] [pattern...] [< archive] @@ -307,9 +307,9 @@ cpio @{-p|--pass-through@} [-0adlmuvLV] [-R [user][:.][group]] [--null] [--reset-access-time] [--make-directories] [--link] [--preserve-modification-time] [--unconditional] [--verbose] -[--dot] [--dereference] [--owner=[user][:.][group]] [--sparse] -[--no-preserve-owner] [--help] [--version] destination-directory -< name-list +[--verbose-skip] [--dot] [--dereference] [--owner=[user][:.][group]] +[--sparse] [--no-preserve-owner] [--help] [--version] +destination-directory < name-list @end example