如何提取tar(ed)Android repo?

时间:2014-10-21 05:01:38

标签: android linux git repository tar

我正在从备份恢复我的Linux分区(主要是非压缩的tarball)。我在提取tarball时遇到问题,这是同步android repo的备份。我用简单的tar -cf command来修改我现有的仓库,然后用tar -xf blah.tar提取它。我收到以下错误。

http://pastebin.com/rkyu9qvD

转储tar -tvf blah.tar

http://pastebin.com/WyrwU3v2(截断)

我认为问题是符号链接。例如,考虑提取

失败

的.repo /项目/包/提供商/ DownloadProvider.git /信息/排除

如果文件是按-t显示顺序提取的(如果我错了,请更正我),那么首先它应该提取.repo/projects/packages/providers/DownloadProvider.git/info因为它是符号链接(看看转储) lrwxrwxrwx bootmgr/bootmgr 0 2014-03-23 11:02 .repo/projects/packages/providers/DownloadProvider.git/info -> ../../../../project-objects/platform/packages/providers/DownloadProvider.git/info 我认为这就是为什么它在提取时会出错。

许多其他文件以这种方式被错误地提取为ex,首先它将创建a/b/c.x路径来提取c.x但后来发现b是符号链接到另一个目录然后抛出错误就像文件已经存在

所以任何想法我应该如何提取它或者它是不可能的。

如果不可能,那么任何其他更好的方法来备份现有的Android回购,以便我可以将其移动到其他硬盘。

1 个答案:

答案 0 :(得分:2)

来自tar文档:

Normally, when tar archives a symbolic link, it writes a block to the archive naming the target of the link. In that way, the tar archive is a faithful record of the file system contents. When - 取消引用' (-h') is used with - 创建'(-c'), tar archives the files symbolic links point to, instead of the links themselves.

因此尝试使用tar -chf ...进行存档,我想您的问题将会得到解决。