bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] GNU TAR: problem with --files-from & -C in filelist


From: Klaus Witberg
Subject: [Bug-tar] GNU TAR: problem with --files-from & -C in filelist
Date: Tue, 24 Aug 2004 13:40:39 +0200




Dear GNU-team,

having invested a day of research in groups and boards on the net, I failed
in finding a working solution on a documented feature with tar 1.13,
so you're kind of last hope for my request ....

Version identification of the used tar-module:

   OPER CCM 6.2>ccm_tar --version
   tar (GNU ccm_tar) 1.13
   Copyright (C) 1988, 92,93,94,95,96,97,98, 1999 Free Software Foundation,
   Inc.
   This is free software; see the source for copying conditions.  There is
   NO
   warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
   PURPOSE.
   Written by John Gilmore and Jay Fenlason.


Documentation for this tar-release states:

   6.8.1 Changing the Working Directory


   @FIXME{need to read over this node now for continuity; i've switched
   things around some.}


   @UNREVISED


   To change the working directory in the middle of a list of file names,
   either on the command line or in a file specified using --files-from=
   file-of-names (-T file-of-names), use --directory=directory (-C
   directory). This will change the working directory to the directory
   directory after that point in the list.


   --directory=directory
   -C directory
         Changes the working directory in the middle of a command line.

   <snip>

   Note that `--directory' options are interpreted consecutively. If
   `--directory' specifies a relative file name, it is interpreted relative
   to the then current directory, which might not be the same as the
   original current working directory of tar, due to a previous
   `--directory' option.


   @FIXME{dan: does this mean that you *can* use the short option form, but
   you can *not* use the long option form with --files-from? or is this
   totally screwed?}


   When using `--files-from' (see section 6.3 Reading Names from a File),
   you can put `-C' options in the file list. Unfortunately, you cannot put
   `--directory' options in the file list. (This interpretation can be
   disabled by using the --null option.)

-----------------------------------------------------------------------------------
Now my problem:

A perl-script generates a complete list of files via "find ..." from a
directory called:
   /scm2test/cba/wa_ptest/MID_COBJ~2.0_sqa/MID_COBJ

Result-list holds
   cobol_src/_mvs/komwdvs.cbl
   Dokumentation/Komdoku.doc
   Fehlertexte/MIDCOBJ.MSG
   Fehlertexte/MIDCOBJ.XLS

When untaring later, the above directory structure is unnecessary, so
before executing the tar command the working directory is set:
   cd /scm2test/cba/wa_ptest/MID_COBJ~2.0_sqa/MID_COBJ

The tar command will use the generated filelist "mxp.incl":
   /ccm62/bin/util/ccm_tar -cv -file=/scm2test/mxp.tar
   --files-from=/scm2test/auftraege/mxp.incl

Now the tricky part: my intention is to "cut out" the
"/Dokumentation/"-path and have the "Komdoku.doc"-file stored in root-path.
This should be done by using the change-directory feature within the
filelist - as described above.
So I coded the following lines within the files-from "mxp.incl"

attempt #1:
   cobol_src/_mvs/komwdvs.cbl
   -C /scm2test/cba/wa_ptest/MID_COBJ~2.0_sqa/MID_COBJ/Dokumentation
   Komdoku.doc
   -C /scm2test/cba/wa_ptest/MID_COBJ~2.0_sqa/MID_COBJ
   Fehlertexte/MIDCOBJ.MSG
   Fehlertexte/MIDCOBJ.XLS

attempt #2:
   cobol_src/_mvs/komwdvs.cbl
   -C '/scm2test/cba/wa_ptest/MID_COBJ~2.0_sqa/MID_COBJ/Dokumentation'
   'Komdoku.doc'
   -C '/scm2test/cba/wa_ptest/MID_COBJ~2.0_sqa/MID_COBJ'
   Fehlertexte/MIDCOBJ.MSG
   Fehlertexte/MIDCOBJ.XLS

attempt #3:
   cobol_src/_mvs/komwdvs.cbl
   -C ./Dokumentation Komdoku.doc
   -C /scm2test/cba/wa_ptest/MID_COBJ~2.0_sqa/MID_COBJ
   Fehlertexte/MIDCOBJ.MSG
   Fehlertexte/MIDCOBJ.XLS

   etc.etc.etc.

I tested with lots of different syntax layouts, but none of them produced
any other result than (relating to the attempt):
   cobol_src/_mvs/komwdvs.cbl
   /ccm62/bin/util/ccm_tar: Cannot add file
   -C'/scm2test/cba/wa_ptest/MID_COBJ~2.0_sqa/MID_COBJ/Dokumentation'
   'Komdoku.doc': No such file or directory
   /ccm62/bin/util/ccm_tar: Cannot add file
   -C'/scm2test/cba/wa_ptest/MID_COBJ~2.0_sqa/MID_COBJ': No such file or
   directory
   Fehlertexte/MIDCOBJ.MSG
   Fehlertexte/MIDCOBJ.XLS
   /ccm62/bin/util/ccm_tar: Error exit delayed from previous errors

All but the "Komdoku.com" file were tarred correctly.
I even produced a tab-separated list and used the --null option ... with no
success regarding the "-C" request.

Is there any incompatibility between those options -T (--files-from)  and
-C (--directory) ... the @FIXME comments might ?

Any help would be appreciated.

Thanx a lot in advance
Klaus

--------------------------------
E-Mail:  address@hidden
phone:   +49 221 - 7715 4164
--------------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]