Subject: cygwin dll makes gnu tar think that directories have been renamed?
From: George Carrette <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Wed, 22 Oct 2003 11:43:16 -0400 (EDT)

The test-gnu-tar-inc.sh file tests the --listed-incremental
backup and restore features of gnu tar.

These features worked well in a previous version of CYGWIN.
Shame on me for not being able to tell you which one,
but it was one available in August 2003 but before September 2003,
when I upgraded and found that the  --listed-incremental
feature stopped working properly.

In the current version (see test-gnu-tar-inc.log for details)
there is a bug where gnu tar thinks that directories have been
renamed when they have not been touched.

The version of gnu tar has not changed, as far as I can tell,
only the underlying cygwin dll.

----
FILENAME: test-gnu-tar.sh
----
#!/bin/bash
# name: test-gnu-tar-inc.sh
# purpose: test the listed incremental backup and restore
#          capability of gnu tar.
# created: 22-OCT-2003 George J. Carrette, [email-masked]
#
# $Id: test-gnu-tar-inc.sh,v 1.3 2003/10/22 15:10:50 gcarrette Exp $
TAR_CMD=${1-"tar"}
echo "Testing gnu tar"
uname -a
${TAR_CMD} --version

rm -rf gnu_tar_test gnu_tar_test.list gnu_tar_test-*.tgz gnu_tar_test.res

do_backup() {
n=${1?"must specify n"}
f="gnu_tar_test-$n.tgz"
cmd="${TAR_CMD} --create --verbose --gzip --file=$f --directory=gnu_tar_test/from --listed-incremental=gnu_tar_test.list ."
echo $cmd
$cmd
cmd="${TAR_CMD} --list --gzip --file=$f"
echo $cmd
$cmd
}

echo "Creating gnu_tar_test/from"

mkdir gnu_tar_test
mkdir gnu_tar_test/from
mkdir gnu_tar_test/from/a
mkdir gnu_tar_test/from/b
echo "Some stuff xxx" > gnu_tar_test/from/file0.txt
echo "Some stuff xxx yyy" > gnu_tar_test/from/file2.txt
echo "Some stuff" > gnu_tar_test/from/file2.txt
echo "Some stuff wow" > gnu_tar_test/from/file3.txt
echo "Some stuff other" > gnu_tar_test/from/a/file4.txt
echo "Some junk" > gnu_tar_test/from/b/file5.txt
echo "more Some junk" > gnu_tar_test/from/b/file6.txt
echo "XXXX Some junk" > gnu_tar_test/from/b/file7.txt

echo "Making first backup, it is ok to see Directory is new messages."
do_backup 1
echo "Making second backup, no files have changed"
echo "It is a bug to see Directory has been renamed messages"
do_backup 2

echo "Changing files"

rm gnu_tar_test/from/b/file5.txt
echo "Add some line to file" >> gnu_tar_test/from/file1.txt
echo "Add some line to file" >> gnu_tar_test/from/b/file6.txt

echo "Another backup"

do_backup 3

echo "Now restore everything to gnu_tar_test/into"

mkdir gnu_tar_test/into

rm gnu_tar_test.list

do_restore() {
n=${1?"must specify n"}
f="$(pwd)/gnu_tar_test-$n.tgz"
iflag="--listed-incremental=gnu_tar_test.res"
cmd="${TAR_CMD} --extract --verbose --gzip --file=$f $iflag"
echo $cmd
(cd gnu_tar_test/into;$cmd)
}

do_restore 1
do_restore 2
do_restore 3

echo "Now look at the result using md5sum"

md5sum $(find gnu_tar_test -type f)

----
FILENAME: test-gnu-tar.log
----
./test-gnu-tar-inc.sh
Testing gnu tar
CYGWIN_NT-5.0 GCARRETTE01 1.5.5(0.94/3/2) 2003-09-20 16:31 i686 unknown unknown Cygwin
tar (GNU tar) 1.13.25
Copyright (C) 2001 Free Software Foundation, Inc.
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute it under the terms of the GNU General Public License;
see the file named COPYING for details.
Written by John Gilmore and Jay Fenlason.
Creating gnu_tar_test/from
Making first backup, it is ok to see Directory is new messages.
tar --create --verbose --gzip --file=gnu_tar_test-1.tgz --directory=gnu_tar_test/from --listed-incremental=gnu_tar_test.list .
tar: ./a: Directory is new
tar: ./b: Directory is new
./
./a/
./b/
./file0.txt
./file2.txt
./file3.txt
./a/file4.txt
./b/file5.txt
./b/file6.txt
./b/file7.txt
tar --list --gzip --file=gnu_tar_test-1.tgz
./
./a/
./b/
./file0.txt
./file2.txt
./file3.txt
./a/file4.txt
./b/file5.txt
./b/file6.txt
./b/file7.txt
Making second backup, no files have changed
It is a bug to see Directory has been renamed messages
tar --create --verbose --gzip --file=gnu_tar_test-2.tgz --directory=gnu_tar_test/from --listed-incremental=gnu_tar_test.list .
tar: ./a: Directory has been renamed
tar: ./b: Directory has been renamed
./
./a/
./b/
./a/file4.txt
./b/file5.txt
./b/file6.txt
./b/file7.txt
tar --list --gzip --file=gnu_tar_test-2.tgz
./
./a/
./b/
./a/file4.txt
./b/file5.txt
./b/file6.txt
./b/file7.txt
Changing files
Another backup
tar --create --verbose --gzip --file=gnu_tar_test-3.tgz --directory=gnu_tar_test/from --listed-incremental=gnu_tar_test.list .
tar: ./a: Directory has been renamed
tar: ./b: Directory has been renamed
./
./a/
./b/
./a/file4.txt
./b/file6.txt
./b/file7.txt
tar --list --gzip --file=gnu_tar_test-3.tgz
./
./a/
./b/
./a/file4.txt
./b/file6.txt
./b/file7.txt
Now restore everything to gnu_tar_test/into
tar --extract --verbose --gzip --file=//arascorp/users/gjcarrette/working/wva/maint/gnu_tar_test-1.tgz --listed-incremental=gnu_tar_test.res
./
./a/
./b/
./file0.txt
./file2.txt
./file3.txt
./a/file4.txt
./b/file5.txt
./b/file6.txt
./b/file7.txt
tar --extract --verbose --gzip --file=//arascorp/users/gjcarrette/working/wva/maint/gnu_tar_test-2.tgz --listed-incremental=gnu_tar_test.res
./
./a/
./b/
./a/file4.txt
./b/file5.txt
./b/file6.txt
./b/file7.txt
tar --extract --verbose --gzip --file=//arascorp/users/gjcarrette/working/wva/maint/gnu_tar_test-3.tgz --listed-incremental=gnu_tar_test.res
./
./a/
./b/
tar: Deleting `./b/file5.txt'
./a/file4.txt
./b/file6.txt
./b/file7.txt
Now look at the result using md5sum
178b561032d44d93d5387a2d4eb1d4f8 *gnu_tar_test/from/a/file4.txt
1418b305fe434371ad603912dd767469 *gnu_tar_test/from/b/file6.txt
1249deaee07cc51a35bb9a92c839e8f1 *gnu_tar_test/from/b/file7.txt
e81128076fdd4a02b0ef55b46e19d2a5 *gnu_tar_test/from/file0.txt
ff59b1df503d4ae65b1d8d283ff04d8d *gnu_tar_test/from/file1.txt
e87249460780aea13fe28e059659adfa *gnu_tar_test/from/file2.txt
6da1abc1a6756bdc7eede0745134cf72 *gnu_tar_test/from/file3.txt
178b561032d44d93d5387a2d4eb1d4f8 *gnu_tar_test/into/a/file4.txt
1418b305fe434371ad603912dd767469 *gnu_tar_test/into/b/file6.txt
1249deaee07cc51a35bb9a92c839e8f1 *gnu_tar_test/into/b/file7.txt
e81128076fdd4a02b0ef55b46e19d2a5 *gnu_tar_test/into/file0.txt
e87249460780aea13fe28e059659adfa *gnu_tar_test/into/file2.txt
6da1abc1a6756bdc7eede0745134cf72 *gnu_tar_test/into/file3.txt

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/