Bug 476166

Summary: unpacking of archive failed on file /bin/pgawk-3.1.6a
Product: [Fedora] Fedora Reporter: Mamoru TASAKA <mtasaka>
Component: gawkAssignee: Stepan Kasal <kasal>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: jfrieben, kasal, lkundrak, michal, peter, pmatilai
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-30 17:04:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mamoru TASAKA 2008-12-12 07:35:09 UTC
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 09:18:46 UTC
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 09:47:47 UTC
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 11:07:34 UTC
(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 22:57:32 UTC
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 15:54:15 UTC
ping?

Comment 6 Stepan Kasal 2009-01-30 17:04:30 UTC
Fixed in gawk-3.1.6-4