LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   /bin/tar: Cowardly refusing to create an empty archive (https://www.linuxquestions.org/questions/linux-software-2/bin-tar-cowardly-refusing-to-create-an-empty-archive-4175457278/)

mentalasalto 04-07-2013 05:32 PM

/bin/tar: Cowardly refusing to create an empty archive
 
Hi all! I am having problems with an installer for a program. The installer itself is a compiled script that wants to use the "tar" command for making some backups prior to actual installation. The problem is that when it calls "tar" to try to do so, it fails with the following message:

Code:

/bin/tar: Cowardly refusing to create an empty archive
Try `/bin/tar --help' or `/bin/tar --usage' for more information.
/bin/tar: Cowardly refusing to create an empty archive
Try `/bin/tar --help' or `/bin/tar --usage' for more information.
    while executing
"exec $TAR -cf $backupDir/$backFile -I ./existfiles.txt"
    (procedure "makeBackup" line 18)
    invoked from within
"makeBackup $package "
    (procedure "xtar" line 6)
    invoked from within
"xtar          $fullName $pakName "
    ("tar" arm line 1)
    invoked from within
"switch $tool {
                "bundle" { set fullName [ extractBundle $fullName $pakName ] }
                "des"    { set fullName [ des        ..."
    (procedure "installPackage" line 16)
    invoked from within
"installPackage $package  "
    (procedure "installSelectedPackage" line 37)
    invoked from within
"installSelectedPackage"
    invoked from within
".installpkg.bSelUp invoke"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0[list $w invoke]"
    (procedure "tk::ButtonUp" line 22)
    invoked from within
"tk::ButtonUp .installpkg.bSelUp"
    (command bound to event)

I am able to run this script successfully in a PC with Centos5 (tar --version gives "tar (GNU tar) 1.15.1"), but it fails in a PC with Opensuse 11.4 (tar --version gives "tar (GNU tar) 1.26 [...]").

Note that, as I mentioned before, it is a compiled installer so unfortunately I am not able to change/modify it :(

I would be really grateful if somebody has any ideas as to how I could bypass this problem!

Cheers,

Jorge.

whizje 04-07-2013 05:53 PM

Maybe you can copy tar from centos to opensuse.

colucix 04-07-2013 06:50 PM

The problem is that the resulting command line is malformed
Code:

exec $TAR -cf $backupDir/$backFile -I ./existfiles.txt
since the -I option accepts an argument and takes "./existfiles.txt" as the name of a compression program. Therefore the list of files to archive results empty. Moreover, since doubtfully the process tries to archive a single file, -I should rather be -T. I'd tell it's a bug of some sort and in this case you should report it to the software maintainer.

On the other hand, if you suspect the problem is tied to the tar version, you may locally install the older version and temporarily adjust the PATH to point to the (newly installed) older tar. Just for the time of the installation and doing this in the terminal from which you launch the installer. You can find the source code of version 1.15.1 on the official GNU ftp archive.

Another option is to check if the installer has the ability to skip the backup process. Maybe running it with --help?

mentalasalto 04-07-2013 08:29 PM

Thanks for the ideas!. Since reporting the bug to the developers would take a very long time to solve my problem (if ever), I will try to follow the suggestion of installing an older version of tar (the installer itself doesn't have any help info and the backup step seems un-bypassable!). I'll report on what I find.

Cheers,

Jorge.

rknichols 04-08-2013 09:48 AM

Good luck with that. I looked back at old versions of GNU tar, and previous to the introduction of "-I" as a short form for "--use-compress-program" it wasn't recognized at all.

I suggest writing a small wrapper script that changes "-I" to "-T" before invoking /bin/tar. Name the script "tar" and put it in some directory ahead of /bin in your PATH.


All times are GMT -5. The time now is 07:25 AM.