Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 640450 - >sys-apps/portage-2.3.8: can't extract the binary packages on Gentoo/FreeBSD
Summary: >sys-apps/portage-2.3.8: can't extract the binary packages on Gentoo/FreeBSD
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All FreeBSD
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 637452
  Show dependency tree
 
Reported: 2017-12-10 00:18 UTC by Yuta SATOH
Modified: 2018-02-02 00:01 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuta SATOH 2017-12-10 00:18:59 UTC
BSD's head command doesn't support -c-42888.
But, the latest portage uses it.
https://github.com/gentoo/portage/blob/master/pym/_emerge/BinpkgExtractorAsync.py#L80

# head -c-42888 /usr/portage/packages/sys-apps/portage-2.3.13.tbz2
head: illegal byte count -- -42888

Reproducible: Always

Steps to Reproduce:
1. emerge -B portage && emerge -K portage
2.
3.
Actual Results:  
>>> Emerging binary (1 of 1) sys-apps/portage-2.3.13::gentoo
 * portage-2.3.13.tbz2 MD5 SHA1 size ;-) ...                             [ ok ]
>>> Extracting info
>>> Extracting sys-apps/portage-2.3.13
head: illegal byte count -- -42888

bzip2: Compressed file ends unexpectedly;
        perhaps it is corrupted?  *Possible* reason follows.
bzip2: Inappropriate ioctl for device
        Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

command 'head -c-42888 -- /usr/portage/packages/sys-apps/portage-2.3.13.tbz2' failed with status 1
!!! Error Extracting '/usr/portage/packages/sys-apps/portage-2.3.13.tbz2'

>>> Failed to emerge sys-apps/portage-2.3.13, Log file:

>>>  '/var/tmp/portage/sys-apps/portage-2.3.13/temp/build.log'
 *
 * The following package has failed to build, install, or execute postinst:
 *
 *  (sys-apps/portage-2.3.13:0/0::gentoo, binary scheduled for merge), Log file:
 *   '/var/tmp/portage/sys-apps/portage-2.3.13/temp/build.log'
 *
Comment 1 Zac Medico gentoo-dev 2017-12-10 00:47:00 UTC
This should fix it:

https://patch-diff.githubusercontent.com/raw/gentoo/portage/pull/231.patch

If you save the patch in /etc/portage/patches/sys-apps/portage/ then it will be applied automatically when you emerge portage.
Comment 2 Yuta SATOH 2017-12-10 08:09:14 UTC
(In reply to Zac Medico from comment #1)
> This should fix it:
> 
> https://patch-diff.githubusercontent.com/raw/gentoo/portage/pull/231.patch
> 
> If you save the patch in /etc/portage/patches/sys-apps/portage/ then it will
> be applied automatically when you emerge portage.

I've confirmed that this bug have been fixed by applying your patch.
Thanks!

# emerge -K portage

>>> Emerging binary (1 of 1) sys-apps/portage-2.3.13::gentoo
 * portage-2.3.13.tbz2 MD5 SHA1 size ;-) ...                             [ ok ]
>>> Extracting info
>>> Extracting sys-apps/portage-2.3.13

>>> Installing (1 of 1) sys-apps/portage-2.3.13::gentoo
Comment 3 Larry the Git Cow gentoo-dev 2017-12-10 08:42:16 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=4a0421e1768dccafd4f9edb77f61cc186afb18d3

commit 4a0421e1768dccafd4f9edb77f61cc186afb18d3
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2017-12-10 00:29:27 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2017-12-10 00:41:21 +0000

    BinpkgExtractorAsync: use posix compatible head arguments (bug 640450)
    
    Fixes: b4b0e6b0aaa1 ("BinpkgExtractorAsync: remove trailer when decompressing binary packages")
    Bug: https://bugs.gentoo.org/640450

 pym/_emerge/BinpkgExtractorAsync.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)}
Comment 4 Zac Medico gentoo-dev 2017-12-10 08:44:34 UTC
(In reply to Yuta SATOH from comment #2)
> I've confirmed that this bug have been fixed by applying your patch.
> Thanks!

Great! Thanks for testing!