Subject: bin/36308: cpio not replacing on old file
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <reed@reedmedia.net>
List: netbsd-bugs
Date: 05/11/2007 14:25:00
>Number:         36308
>Category:       bin
>Synopsis:       cpio not replacing on old file
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 11 14:25:00 +0000 2007
>Originator:     reed@reedmedia.net
>Release:        NetBSD 3.99.24
>Organization:
  Jeremy C. Reed
>Environment:
	
	
System: NetBSD glacier.reedmedia.net 3.99.24 NetBSD 3.99.24 (JCR20060802) #0: Mon Sep 25 12:22:43 CDT 2006 reed@new-host-8:/usr/src/sys/arch/i386/compile/JCR20060802 i386
Architecture: i386
Machine: i386
>Description:
I didn't have a chance to look at code, but don't want to forget this.
I emailed about it in March.

I am doing:

 find . | grep -v /.svn | cut -d / -f 2- | cpio -vvvpdm ../book

Basically, it looks for new TeX documents and copies over to a different 
directory for doing some builds. The first time (to empty ../book/ 
directory) it works fine.

I edit a file but it are not copied second time I do the same cpio. (Even 
for more than one file modified.)

The -v shows:
../book/ToC.tex

But it is not updated.

$ ls -l ToC.tex  ../book/ToC.tex 
-rw-r--r--  1 reed  staff  5545 Feb 24 14:07 ../book/ToC.tex
-rw-r--r--  1 reed  staff  5557 Mar 23 11:57 ToC.tex

It works correctly as I expect on DragonFly and also
on Linux with cpio (GNU cpio) 2.6.

I also tried using complete destination path with cpio instead of .. but 
same problem. Verbose showed the single file updated -- but it wasn't.

I also tried --insecure but I never had any warning before and that didn't 
help.

I have been using cpio --pass-through for years.

Here is example on NetBSD:

glacier:/home/reed/book/dru-FreeBSD-Basics$ cd ~/tmp
glacier:/home/reed/tmp$ date > J
glacier:/home/reed/tmp$ mkdir ~/tmp2
glacier:/home/reed/tmp$ find . -name J | cpio -vvvpdm ../tmp2
../tmp2/./J
../tmp2/./ILS/Open-ILS/src/J
../tmp2/./ILS/J
../tmp2/./ikiwiki-testbed.moved/J
glacier:/home/reed/tmp$ ls -l ../tmp2/./J J
-rw-r-----  1 reed  users  29 Mar 23 12:22 ../tmp2/./J
-rw-r-----  1 reed  users  29 Mar 23 12:22 J
glacier:/home/reed/tmp$ date >> J
glacier:/home/reed/tmp$ ls -l ../tmp2/./J J 
-rw-r-----  1 reed  users  29 Mar 23 12:22 ../tmp2/./J
-rw-r-----  1 reed  users  58 Mar 23 12:22 J
glacier:/home/reed/tmp$ find . -name J | cpio -vvvpdm ../tmp2 
../tmp2/./J
glacier:/home/reed/tmp$ ls -l ../tmp2/./J J                   
-rw-r-----  1 reed  users  29 Mar 23 12:22 ../tmp2/./J
-rw-r-----  1 reed  users  58 Mar 23 12:22 J

No change.

glacier:/home/reed/tmp$ date >> J                             
glacier:/home/reed/tmp$ find . -name J | cpio -vvvpdm ../tmp2 
../tmp2/./J
glacier:/home/reed/tmp$ ls -l ../tmp2/./J J                   
-rw-r-----  1 reed  users  29 Mar 23 12:22 ../tmp2/./J
-rw-r-----  1 reed  users  87 Mar 23 12:24 J

Still no change.

This is:

glacier:/home/reed/tmp$ ident `which cpio`
/bin/cpio:
     $NetBSD: crt0.c,v 1.16 2006/05/17 17:08:54 christos Exp $
     $NetBSD: ar_io.c,v 1.47 2006/02/11 10:43:17 dsl Exp $
     $NetBSD: ar_subs.c,v 1.49 2006/02/11 11:04:57 dsl Exp $
     $NetBSD: buf_subs.c,v 1.27 2006/02/11 10:43:18 dsl Exp $
     $NetBSD: file_subs.c,v 1.59 2006/02/11 10:43:18 dsl Exp $
     $NetBSD: ftree.c,v 1.34 2006/02/11 10:43:18 dsl Exp $
     $NetBSD: gen_subs.c,v 1.33 2006/02/11 10:43:18 dsl Exp $
     $NetBSD: getoldopt.c,v 1.22 2006/02/11 10:43:18 dsl Exp $
     $NetBSD: options.c,v 1.97 2006/04/16 16:20:21 christos Exp $
     $NetBSD: pat_rep.c,v 1.25 2006/04/24 19:00:29 snj Exp $
     $NetBSD: pax.c,v 1.40 2006/02/11 11:04:57 dsl Exp $
     $NetBSD: sel_subs.c,v 1.20 2006/02/11 10:43:18 dsl Exp $
     $NetBSD: tables.c,v 1.27 2006/04/24 19:00:29 snj Exp $
     $NetBSD: tar.c,v 1.64 2006/03/18 05:43:47 christos Exp $
     $NetBSD: tty_subs.c,v 1.18 2006/02/11 10:43:18 dsl Exp $
     $NetBSD: spec.c,v 1.62 2006/04/12 19:49:59 dsl Exp $
     $NetBSD: misc.c,v 1.27 2005/09/29 14:29:03 tron Exp $
     $NetBSD: stat_flags.c,v 1.19 2004/05/25 14:54:55 hannken Exp $
     $NetBSD: pack_dev.c,v 1.8 2004/05/11 17:09:58 christos Exp $
     $NetBSD: cpio.c,v 1.19 2006/02/11 10:43:18 dsl Exp $
     $NetBSD: rmtlib.c,v 1.21 2006/03/19 23:05:50 christos Exp $

>How-To-Repeat:

>Fix:
	

>Unformatted: