tar 1.27 在 Ubuntu 14.04 中的错误解决方法

Workaround for tar 1.27's bug in Ubuntu 14.04

Ubuntu14.04最新tar版本为1.27.1:

tar --version
tar (GNU tar) 1.27.1

但是编译 Yocto(由 Altera 提供:http://download.altera.com/akdlm/software/acdsinst/13.0/156/ib_installers/linux-socfpga-13.02-RC10-src.bsx, and instructions given here: http://rocketboards.org/foswiki/view/Documentation/AlteraSoCDevelopmentBoardYoctoGettingStarted)一直报错:

| tar: --same-order option cannot be used with -c
| Try 'tar --help' or 'tar --usage' for more information.

归因于 1.27 的 tar 功能 (http://lists.openembedded.org/pipermail/openembedded-core/2013-October/085105.html)。或者我从 GNU 网站下载 tar 1.26,编译时出现以下错误:

  CC     argp-eexst.o
In file included from argp.h:24:0,
                 from argp-eexst.c:27:
./stdio.h:479:1: error: ‘gets’ undeclared here (not in a function)
 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
 ^

那么在最新修补的 Ubuntu 14.04 中编译 Yocto 时,有人有任何解决方法吗?

终于克服了这个问题。这不是 tar 1.27.1 的错误,只是它破坏了许多使用旧 tar 功能的现有系统。

我从 GNU 获取了 tar 的 1.26 版本,注释掉了 stdio.h 中第 479 行的注释,并生成了一个新的 tar 忽略了 gets( ) 警告。这不是一个长期的解决方案,但现在至少我可以成功编译 Yocto。

我不知道这在技术上是否可以被视为一个错误,但可以肯定的是它也出现在 1.29 版中并且默默地破坏了我的 amanda-zdm 备份。 不好笑。 对我来说,解决方案是降级到版本 1.26