X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=2.2 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_CV,TW_RV,TW_TV,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org MIME-Version: 1.0 Date: Thu, 26 Aug 2010 00:49:23 -0400 Message-ID: Subject: Possible tar version 1.23-1 --remove-files bug. From: Jeremy Warren To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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