Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 524864 - app-admin/lastpass - warning [/var/tmp/portage/app-admin/lastpass-3.1.61/distdir/lpchrome_linux.crx]: 306 extra bytes at beginning or within zipfile (attempting to process anyway)
Summary: app-admin/lastpass - warning [/var/tmp/portage/app-admin/lastpass-3.1.61/dist...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-09 17:38 UTC by Andrew Udvare
Modified: 2014-10-19 22:32 UTC (History)
0 users

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


Attachments
build.log (build.log,1.75 KB, text/plain)
2014-10-09 17:39 UTC, Andrew Udvare
Details
unzip CRX without warning (lastpass-3.1.61-unzip-crx.patch,463 bytes, patch)
2014-10-12 18:42 UTC, Andrew Udvare
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Udvare 2014-10-09 17:38:17 UTC
I made sure distfiles no longer had copies of LastPass files.

Everything else here passes fine:

 * lpchrome_linux.crx SHA256 SHA512 WHIRLPOOL size ;-) ... 
 * lp_linux.xpi SHA256 SHA512 WHIRLPOOL size ;-) ...

But then a warning occurs and the ebuild fails. I think the || die on unzip needs to be removed. I never had it in my original ebuild and this might be the reason why.

Obviously, can also filter for errors too.
out=$(unzip -qq ...)
if [[ "$out" = *extra\ bytes* ]]; ...

warning [/var/tmp/portage/app-admin/lastpass-3.1.61/distdir/lpchrome_linux.crx]:  306 extra bytes at beginning or within zipfile
  (attempting to process anyway)
 * ERROR: app-admin/lastpass-3.1.61::gentoo failed (unpack phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line  93:  Called src_unpack
 *   environment, line 2018:  Called die
 * The specific snippet of code:
 *       unzip -qq -o "${DISTDIR}/lpchrome_linux.crx" -d "${S}"/crx || die
 * 
 * If you need support, post the output of `emerge --info '=app-admin/lastpass-3.1.61::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-admin/lastpass-3.1.61::gentoo'`.
 * The complete build log is located at '/var/log/portage/app-admin:lastpass-3.1.61:20141009-173202.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/app-admin/lastpass-3.1.61/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-admin/lastpass-3.1.61/temp/environment'.
 * Working directory: '/var/tmp/portage/app-admin/lastpass-3.1.61/work'
 * S: '/var/tmp/portage/app-admin/lastpass-3.1.61/work'

>>> Failed to emerge app-admin/lastpass-3.1.61, Log file:

>>>  '/var/log/portage/app-admin:lastpass-3.1.61:20141009-173202.log'

 * Messages for package app-admin/lastpass-3.1.61:

 * ERROR: app-admin/lastpass-3.1.61::gentoo failed (unpack phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line  93:  Called src_unpack
 *   environment, line 2018:  Called die
 * The specific snippet of code:
 *       unzip -qq -o "${DISTDIR}/lpchrome_linux.crx" -d "${S}"/crx || die
 * 
 * If you need support, post the output of `emerge --info '=app-admin/lastpass-3.1.61::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-admin/lastpass-3.1.61::gentoo'`.
 * The complete build log is located at '/var/log/portage/app-admin:lastpass-3.1.61:20141009-173202.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/app-admin/lastpass-3.1.61/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-admin/lastpass-3.1.61/temp/environment'.
 * Working directory: '/var/tmp/portage/app-admin/lastpass-3.1.61/work'
 * S: '/var/tmp/portage/app-admin/lastpass-3.1.61/work'
Comment 1 Andrew Udvare 2014-10-09 17:39:02 UTC
Created attachment 386310 [details]
build.log
Comment 2 Andrew Udvare 2014-10-09 17:39:32 UTC
Portage 2.2.14_rc1 (python 3.3.5-final-0, default/linux/amd64/13.0/desktop/kde/systemd, gcc-4.7.3, glibc-2.19-r1, 3.14.14-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.14.14-gentoo-x86_64-AMD_FX-tm-8150_Eight-Core_Processor-with-gentoo-2.2
KiB Mem:    16388832 total,    371916 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Thu, 09 Oct 2014 16:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p52
dev-java/java-config:     2.2.0
dev-lang/perl:            5.18.2-r1
dev-lang/python:          2.7.7, 3.3.5-r1
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.1
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.13 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo tatsh-overlay jamiel-gentoo-overlay srcshelton
Installed sets: @anfplaylists, @ansible, @beanstalk, @bloodhound, @cdr, @cgit, @chrome, @clang, @compass, @cups, @firefox, @gimp, @git, @gnome-games, @ibus, @icedtea, @icewm, @kde4, @kde4-devel, @kdevelop, @libimobiledevice, @media, @micasa, @misc, @mupen64plus, @mysql, @nginx, @php, @php-xdebug, @pidgin, @portage-dev, @portage-utilities, @postgresql, @python, @rar, @rutorrent, @ssh, @stepmania, @tatshnet, @uwsgi, @vagrant, @virtualbox, @wine, @x11, @x11-misc
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -fomit-frame-pointer -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.0/conf"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=native -fomit-frame-pointer -ggdb"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg candy clean-logs compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://gentoo.mirrors.pair.com/ rsync://mirrors.rit.edu/gentoo/ http://mirrors.rit.edu/gentoo/ http://gentoo.llarian.net/ rsync://gentoo.mirrors.tds.net/gentoo http://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ http://gentoo.cites.uiuc.edu/pub/gentoo/"
LANG="en_GB.utf8"
LDFLAGS="-Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/tatsh-overlay /var/lib/layman/jamiel-gentoo-overlay /var/lib/layman/srcshelton"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 bash-completion bluetooth branding bzip2 cairo cjk cli cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss exif fam flac fortran gdbm gif glamor gpm iconv idn ipv6 jemalloc jpeg kde kipi lcms libnotify mad mmx mmxext modules mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds qt qt3support qt4 readline semantic-desktop session spell sse sse2 sse3 sse4 sse4_1 sse4_2 sse4a ssl ssse3 svg syslog systemd tcpd tiff truetype udev udisks unicode upower vim-syntax vorbis wxwidgets x264 xcb xcomposite xinerama xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev joystick keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_GB en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="nvidia v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7 3.3"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Andrew Udvare 2014-10-12 18:41:59 UTC
Found out the reason why there are 306 bytes at the beginning of the 'zip file', the crx. It is the header for a Chrome extension, which has magic b'Cr24'. Right at byte 307 begins the zip file with the PK magic.

If you want to not have the warning and still use || die, knowing this ahead of time, you can do a little manipulation (I could not find how to pass stdin to unzip):

Do this in src_unpack():
dd bs=306 skip=1 if="${DISTDIR}/lpchrome_linux.crx" of="lpchrome_linux.zip" 2>/dev/null || die
unzip -qq -o "lpchrome_linux.zip" -d "${S}"/crx || die

This works for me and I am attaching a patch. Also, the XPI format for Firefox (which is just a zip) does not add junk the beginning of the zip file.
Comment 4 Andrew Udvare 2014-10-12 18:42:49 UTC
Created attachment 386540 [details, diff]
unzip CRX without warning

Strip the 306 bytes from the beginning of the file which are for Chrome only.
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-10-19 06:41:27 UTC
thanks, InCVS.

Do you want to be added as a proxy maintainer (open a new bug if you want to do it).
Comment 6 Andrew Udvare 2014-10-19 22:32:53 UTC
(In reply to Robin Johnson from comment #5)
> thanks, InCVS.
> 
> Do you want to be added as a proxy maintainer (open a new bug if you want to
> do it).

Opened: https://bugs.gentoo.org/show_bug.cgi?id=525912