summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-arch/cpio/ChangeLog11
-rw-r--r--app-arch/cpio/cpio-2.10-r1.ebuild41
-rw-r--r--app-arch/cpio/files/cpio-2.9-64-bit-wide-inode-fixup.patch142
3 files changed, 192 insertions, 2 deletions
diff --git a/app-arch/cpio/ChangeLog b/app-arch/cpio/ChangeLog
index e6b83cd52fef..2402c399b509 100644
--- a/app-arch/cpio/ChangeLog
+++ b/app-arch/cpio/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-arch/cpio
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-arch/cpio/ChangeLog,v 1.99 2009/06/20 10:20:01 vapier Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/cpio/ChangeLog,v 1.100 2010/01/20 07:30:56 robbat2 Exp $
+
+*cpio-2.10-r1 (20 Jan 2010)
+
+ 20 Jan 2010; Robin H. Johnson <robbat2@gentoo.org>
+ +files/cpio-2.9-64-bit-wide-inode-fixup.patch, +cpio-2.10-r1.ebuild:
+ Cpio on XFS fails to deal with hardlinks properly, apply fix from upstream
+ mailing list.
*cpio-2.10 (20 Jun 2009)
diff --git a/app-arch/cpio/cpio-2.10-r1.ebuild b/app-arch/cpio/cpio-2.10-r1.ebuild
new file mode 100644
index 000000000000..bac96c2e3f50
--- /dev/null
+++ b/app-arch/cpio/cpio-2.10-r1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/cpio/cpio-2.10-r1.ebuild,v 1.1 2010/01/20 07:30:56 robbat2 Exp $
+
+EAPI=2
+
+inherit eutils
+
+DESCRIPTION="A file archival tool which can also read and write tar files"
+HOMEPAGE="http://www.gnu.org/software/cpio/cpio.html"
+SRC_URI="mirror://gnu/cpio/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
+IUSE="nls"
+
+src_prepare() {
+ # Per here: http://lists.gnu.org/archive/html/bug-cpio/2009-10/msg00000.html
+ # fixes hardlink creation from XFS
+ epatch "${FILESDIR}"/cpio-2.9-64-bit-wide-inode-fixup.patch
+}
+
+src_configure() {
+ econf \
+ $(use_enable nls) \
+ --bindir=/bin \
+ --with-rmt=/usr/sbin/rmt \
+ || die
+}
+
+src_compile() {
+ emake || die
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc ChangeLog NEWS README
+ rm -f "${D}"/usr/share/man/man1/mt.1
+ rmdir "${D}"/usr/libexec || die
+}
diff --git a/app-arch/cpio/files/cpio-2.9-64-bit-wide-inode-fixup.patch b/app-arch/cpio/files/cpio-2.9-64-bit-wide-inode-fixup.patch
new file mode 100644
index 000000000000..c510ff565df9
--- /dev/null
+++ b/app-arch/cpio/files/cpio-2.9-64-bit-wide-inode-fixup.patch
@@ -0,0 +1,142 @@
+Add support for filesystems with inode-fields wider than 32-bits (I witnessed
+this bug on a large XFS filesystem).
+This patch fixes the bug that hardlinked files are *not* included at
+all (i.e. both files are listed, but the content is not transmitted with
+either of them).
+
+The patch is relative to the bleeding edge version of cpio on the git
+repostory.
+
+ src/copyin.c | 8 ++++----
+ src/copyout.c | 4 ++--
+ src/copypass.c | 2 +-
+ src/extern.h | 6 +++---
+ src/util.c | 6 +++---
+ 5 files changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/src/copyin.c b/src/copyin.c
+index 5b7594b..8ba2bc9 100644
+--- a/src/copyin.c
++++ b/src/copyin.c
+@@ -258,7 +258,7 @@ create_defered_links (struct cpio_file_stat *file_hdr)
+ {
+ struct deferment *d;
+ struct deferment *d_prev;
+- int ino;
++ ino_t ino;
+ int maj;
+ int min;
+ int link_res;
+@@ -306,7 +306,7 @@ create_defered_links_to_skipped (struct cpio_file_stat *file_hdr,
+ {
+ struct deferment *d;
+ struct deferment *d_prev;
+- int ino;
++ ino_t ino;
+ int maj;
+ int min;
+ if (file_hdr->c_filesize == 0)
+@@ -1460,8 +1460,8 @@ process_copy_in ()
+ struct cpio_file_stat *h;
+ h = &file_hdr;
+ fprintf (stderr,
+- "magic = 0%o, ino = %d, mode = 0%o, uid = %d, gid = %d\n",
+- h->c_magic, h->c_ino, h->c_mode, h->c_uid, h->c_gid);
++ "magic = 0%o, ino = %ld, mode = 0%o, uid = %d, gid = %d\n",
++ h->c_magic, (long)h->c_ino, h->c_mode, h->c_uid, h->c_gid);
+ fprintf (stderr,
+ "nlink = %d, mtime = %d, filesize = %d, dev_maj = 0x%x\n",
+ h->c_nlink, h->c_mtime, h->c_filesize, h->c_dev_maj);
+diff --git a/src/copyout.c b/src/copyout.c
+index dd9bac2..b3bb0ad 100644
+--- a/src/copyout.c
++++ b/src/copyout.c
+@@ -110,7 +110,7 @@ static int
+ count_defered_links_to_dev_ino (struct cpio_file_stat *file_hdr)
+ {
+ struct deferment *d;
+- int ino;
++ ino_t ino;
+ int maj;
+ int min;
+ int count;
+@@ -167,7 +167,7 @@ writeout_other_defers (struct cpio_file_stat *file_hdr, int out_des)
+ {
+ struct deferment *d;
+ struct deferment *d_prev;
+- int ino;
++ ino_t ino;
+ int maj;
+ int min;
+ ino = file_hdr->c_ino;
+diff --git a/src/copypass.c b/src/copypass.c
+index 8941b76..20929a6 100644
+--- a/src/copypass.c
++++ b/src/copypass.c
+@@ -387,7 +387,7 @@ process_copy_pass ()
+
+ int
+ link_to_maj_min_ino (char *file_name, int st_dev_maj, int st_dev_min,
+- int st_ino)
++ ino_t st_ino)
+ {
+ int link_res;
+ char *link_name;
+diff --git a/src/extern.h b/src/extern.h
+index a832897..6144be1 100644
+--- a/src/extern.h
++++ b/src/extern.h
+@@ -119,7 +119,7 @@ void process_copy_out (void);
+ /* copypass.c */
+ void process_copy_pass (void);
+ int link_to_maj_min_ino (char *file_name, int st_dev_maj,
+- int st_dev_min, int st_ino);
++ int st_dev_min, ino_t st_ino);
+ int link_to_name (char *link_name, char *link_target);
+
+ /* dirname.c */
+@@ -169,9 +169,9 @@ void warn_if_file_changed (char *file_name, off_t old_file_size,
+ time_t old_file_mtime);
+ void create_all_directories (char *name);
+ void prepare_append (int out_file_des);
+-char *find_inode_file (unsigned long node_num,
++char *find_inode_file (ino_t node_num,
+ unsigned long major_num, unsigned long minor_num);
+-void add_inode (unsigned long node_num, char *file_name,
++void add_inode (ino_t node_num, char *file_name,
+ unsigned long major_num, unsigned long minor_num);
+ int open_archive (char *file);
+ void tape_offline (int tape_des);
+diff --git a/src/util.c b/src/util.c
+index 1eb92ae..16a4320 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -686,7 +686,7 @@ prepare_append (int out_file_des)
+
+ struct inode_val
+ {
+- unsigned long inode;
++ ino_t inode;
+ unsigned long major_num;
+ unsigned long minor_num;
+ char *file_name;
+@@ -713,7 +713,7 @@ inode_val_compare (const void *val1, const void *val2)
+ }
+
+ char *
+-find_inode_file (unsigned long node_num, unsigned long major_num,
++find_inode_file (ino_t node_num, unsigned long major_num,
+ unsigned long minor_num)
+ {
+ struct inode_val sample;
+@@ -732,7 +732,7 @@ find_inode_file (unsigned long node_num, unsigned long major_num,
+ /* Associate FILE_NAME with the inode NODE_NUM. (Insert into hash table.) */
+
+ void
+-add_inode (unsigned long node_num, char *file_name, unsigned long major_num,
++add_inode (ino_t node_num, char *file_name, unsigned long major_num,
+ unsigned long minor_num)
+ {
+ struct inode_val *temp;
+--
+1.6.2.151.gdc0be