Bug 476166 - unpacking of archive failed on file /bin/pgawk-3.1.6a
unpacking of archive failed on file /bin/pgawk-3.1.6a
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gawk (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Stepan Kasal
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-12 02:35 EST by Mamoru TASAKA
Modified: 2009-01-30 12:04 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-30 12:04:30 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mamoru TASAKA 2008-12-12 02:35:09 EST
Description of problem:
# LANG=C rpm -Fvv gawk-3.1.6-3.fc11.i386.rpm 
causes:

D: fini      100644  2 (   0,   0)     25837 /usr/share/man/man1/pgawk.1.gz;49421228 
D: fini      100755  2 (   0,   0)         0 /bin/pgawk-3.1.6a;49421228 
D: undo      100755  2 (   0,   0)    338720 /usr/bin/pgawk;49421228 
GZDIO:     199 reads,  1630208 total bytes in 0.029780 secs
error: unpacking of archive failed on file /bin/pgawk-3.1.6a;49421228: cpio: link failed - Invalid cross-device link
D: ========== --- gawk-3.1.6-2.fc11 i386-linux 0x1
D: running post-transaction scripts

http://kojipkgs.fedoraproject.org/packages/gawk/3.1.6/3.fc11/data/logs/i386/build.log
says:
  1017  make[3]: Entering directory `/builddir/build/BUILD/gawk-3.1.6'
  1018  (cd /builddir/build/BUILDROOT/gawk-3.1.6-3.fc11.i386/bin; \
  1019          ln gawk gawk-3.1.6a 2>/dev/null ; \
  1020          ln pgawk pgawk-3.1.6a 2>/dev/null ; \
  1021          if [ ! -f awk ]; \
  1022          then    ln -s gawk awk; \
  1023          fi; exit 0)
  1024  make[3]: Leaving directory `/builddir/build/BUILD/gawk-3.1.6'

pgawk-3.1.6a is "hard link"ed to pgawk and it seems that rpm (cpio?)
cannot handle this.

Version-Release number of selected component (if applicable):
gawk-3.1.6-3.fc11

How reproducible:
100%

Steps to Reproduce:
1. See above
2.
3.

cc-ing rpm maintainer
Comment 1 Joachim Frieben 2008-12-12 04:18:46 EST
Accordingly, an update to gawk-3.1.6-3.fc11 from Koji fails with message:

rpm -Uhv gawk-3.1.6-3.fc11.x86_64.rpm
Preparing...                ########################################### [100%]
   1:gawk                   ########################################### [100%]
error: unpacking of archive failed on file /bin/pgawk-3.1.6a;49422b3c: cpio: link failed - Invalid cross-device link
Comment 2 Panu Matilainen 2008-12-12 04:47:47 EST
Hardlinking doesn't work across filesystems, that's neither cpio or rpm limitation. This can't be detected at build-time as the buildroot is always on a single filesystem (unless you do some very weird things), except by banning hard links outside target directory completely, which would be largely arbitrary limitation but it's the only thing that can be *guaranteed* to work, regardless of how the target system is partitioned.
Comment 3 Mamoru TASAKA 2008-12-12 06:07:34 EST
(In reply to comment #2)
> Hardlinking doesn't work across filesystems, that's neither cpio or rpm
> limitation. 

Ah, actually on my system /bin and /usr/bin are on different
partitions and in this case 

- (%{buildroot})/bin/pgawk-3.1.6a is hardlinked to /bin/pgawk
- After that /bin/pgawk is moved to /usr/bin:
  From build.log:
  1114  + mv /builddir/build/BUILDROOT/gawk-3.1.6-3.fc11.i386/bin/pgawk /builddir/build/BUILDROOT/gawk-3.1.6-3.fc11.i386/bin/igawk /builddir/build/BUILDROOT/gawk-3.1.6-3.fc11.i386/usr/bin
Comment 4 Michal Jaegermann 2008-12-28 17:57:32 EST
Such change is needed in gawk specs:

--- ./gawk.spec~        2008-12-11 04:25:53.000000000 -0700
+++ ./gawk.spec 2008-12-28 15:33:39.000000000 -0700
@@ -56,7 +56,7 @@ ln -sf gawk.1.gz $RPM_BUILD_ROOT%{_mandi
 ln -sf ../../bin/gawk $RPM_BUILD_ROOT%{_bindir}/awk
 ln -sf ../../bin/gawk $RPM_BUILD_ROOT%{_bindir}/gawk
 mv $RPM_BUILD_ROOT/bin/{p,i}gawk $RPM_BUILD_ROOT%{_bindir}
-rm -f $RPM_BUILD_ROOT/bin/{,p}gawk-%{version} $RPM_BUILD_ROOT%{_infodir}/dir
+rm -f $RPM_BUILD_ROOT/bin/{,p}gawk-* $RPM_BUILD_ROOT%{_infodir}/dir
 
 %find_lang %name
 
Otherwise a compilation produces

	ln gawk gawk-3.1.6a 2>/dev/null ; \
	ln pgawk pgawk-3.1.6a 2>/dev/null ; \

with this trailing "a", and we get a crossdevice hard link.
Comment 5 Mamoru TASAKA 2009-01-06 10:54:15 EST
ping?
Comment 6 Stepan Kasal 2009-01-30 12:04:30 EST
Fixed in gawk-3.1.6-4

Note You need to log in before you can comment on or make changes to this bug.