I have now compiled and verified the problem exists in Linux as well in the Gnu Tar 1.23-1 release, and is not a cygwin specific bug. I have submitted to bug-tar.
Sorry for the false alarm. On Thu, Aug 26, 2010 at 8:57 AM, Jeremy Warren <jer...@gmail.com> wrote: > I have additionally verified now that rolling back to version : tar > (GNU tar) 1.22.90 does not exhibit this problem. > > > > -----Original Message----- > From: Jeremy Warren [mailto:jer...@gmail.com] > Sent: Thursday, August 26, 2010 12:49 AM > To: cygwin@cygwin.com > Subject: Possible tar version 1.23-1 --remove-files bug. > > I have duplicated the following behavior on 2 different machines > CYGWIN_NT-5.2 1.7.6(0.230/5/3) 2010-08-16 16:06 i686 (Windows 2003 R2 Server) > CYGWIN_NT-5.1 1.7.5(0.225/5/3) 2010-04-12 19:07 i686 (Windows XP Desktop) > Both are running tar version 1.23-1 and the problem is 100% > reproducible in my environment. > > *Some editing has been made to the output to protect the innocent. > Any discrepancies in the output are unlikely related to the problem > itself and more likely caused by my sausage shaped fingers. > > Scenario: > Given a directory with sample contents: > $ ls > file1.asc file2.asc file3.asc file4.asc > > the following command: > $ tar --remove-files -cvf test.tar *.asc > file1.asc > file2.asc > file3.asc > file4.asc > > Produces the expected result of a single test.tar, with the 4 asc files > removed. > > $ ls > test.tar > > And the tarball correctly contains all 4 files. > > $ tar -tvf test.tar > -rw-r--r-- XXXXXXXXXXXXXX/None 22 2010-08-26 00:07 file1.asc > -rw-r--r-- XXXXXXXXXXXXXX/None 22 2010-08-26 00:07 file2.asc > -rw-r--r-- XXXXXXXXXXXXXX/None 22 2010-08-26 00:07 file3.asc > -rw-r--r-- XXXXXXXXXXXXXX/None 22 2010-08-26 00:07 file4.asc > > > *** PROBLEM STARTS HERE *** > > The following command, using the -r (append -vs- create) switch, > correctly produces a test.tar file with all 4 files but fails to > delete the files. > $ tar --remove-files -rvf test.tar *.asc > file1.asc > file2.asc > file3.asc > file4.asc > > $ ls > file1.asc file2.asc file3.asc file4.asc test.tar > > $ tar -tvf test.tar > -rw-r--r-- XXXXXXXXXXXXXX/None 22 2010-08-26 00:11 file1.asc > -rw-r--r-- XXXXXXXXXXXXXX/None 22 2010-08-26 00:11 file2.asc > -rw-r--r-- XXXXXXXXXXXXXX/None 22 2010-08-26 00:11 file3.asc > -rw-r--r-- XXXXXXXXXXXXXX/None 22 2010-08-26 00:11 file4.asc > > A return code of zero is produced in either instance, and the tarballs > created are both fully usable. There is a second scenario where all > asc files are deleted except the last one (so test.tar and file4 would > be left in the directory at completion) but as of yet I cannot > reproduce that scenario at will, so I'm uncertain as to the exact > startup conditions that cause it. > > In my situation using -c is not a solution since this command is > embedded within a large loop. Each file is being processed and > appended to the archive one at a time. The processing script worked > without issue prior to upgrading to the 1.23-1 version tar within the > last week or so. > > *** Other possibly relevant pieces of information: *** > > I verified using a Linux box (2.6.18-164.9.1.el5.centos.plus) running > tar (GNU tar) 1.15.1 to verify that my expectations of the command > were correct. > > $ ls > file1.asc file2.asc file3.asc file4.asc > > $ tar --remove-files -rvf test.tar *.asc > file1.asc > file2.asc > file3.asc > file4.asc > > $ ls > test.tar > > $ tar -tvf test.tar > -rw-r--r-- XXXXXXXXXXXXXX/XXXXXXXXXXXXXX 22 2010-08-26 00:15:28 file1.asc > -rw-r--r-- XXXXXXXXXXXXXX/XXXXXXXXXXXXXX 22 2010-08-26 00:15:28 file2.asc > -rw-r--r-- XXXXXXXXXXXXXX/XXXXXXXXXXXXXX 22 2010-08-26 00:15:28 file3.asc > -rw-r--r-- XXXXXXXXXXXXXX/XXXXXXXXXXXXXX 22 2010-08-26 00:15:28 file4.asc > > Cygwin was installed from different mirrors at different times on each > machine. > > It appears from the release notes that some changes were made in > 1.23-1 related to the --remove-files argument > "** The --remove-files option removes files only if they were > succesfully stored in the archive." > > I was unable to find any related issues in the archive but was having > trouble making the archive search match the '--remove-files' switch in > the query. Apologies in advance if I duped. > > Thanks, > Jeremy > -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple