Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 544096 - emerge (=sys-apps/portage-2.2.14) and eix (=app-portage/eix-0.30.4) fails to parse complete atom suffix
Summary: emerge (=sys-apps/portage-2.2.14) and eix (=app-portage/eix-0.30.4) fails to ...
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Configuration (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-22 12:23 UTC by Sergey S. Starikoff
Modified: 2017-02-10 00:20 UTC (History)
1 user (show)

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 Sergey S. Starikoff 2015-03-22 12:23:44 UTC
man 5 ebuild + man 5 portage → complete atom format (see bug #544094):
${CATEGORY}/${PN}-${PV}-${PACKAGE_REVISION:${SLOT}[:${repo-name}]

First case: slot value for all repositories:
/etc/portage/package.keywords: dev-qt/*:5
Works fine.

Second case: all slots (blank field), gentoo distro repository:
/etc/portage/package.keywords: dev-qt/*::gentoo
Again works fine:

But when I try to set both slot and repository fields:
/etc/portage/package.keywords: dev-qt/*:5:gentoo

I got the error:
# emerge -1 dev-qt/qtcore:5
--- Invalid atom in /etc/portage/package.keywords: dev-qt/*:5:gentoo
…

$ einfo
Portage 2.2.14 (python 3.3.5-final-0, default/linux/amd64/13.0, gcc-4.8.3, glibc-2.19-r1, 3.16.7-aufs-ext x86_64)
=================================================================
System uname: Linux-3.16.7-aufs-ext-x86_64-Intel-R-_Core-TM-_i5_CPU_661_@_3.33GHz-with-gentoo-2.2
KiB Mem:     7977628 total,   2088416 free
KiB Swap:    4024240 total,   4024240 free
Timestamp of tree: Fri, 20 Mar 2015 16:15:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.2_p53
dev-java/java-config:     2.2.0
dev-lang/perl:            5.20.1-r4
dev-lang/python:          2.7.9-r1, 3.3.5-r1, 3.4.1
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.11
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6-r1, 1.13.4
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.4
sys-devel/make:           4.1-r1
sys-kernel/linux-headers: 3.18 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo rion mva local_home
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA GPL*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/conf.d/clock /etc/rc.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles/"
EMERGE_DEFAULT_OPTS="--ask=y --verbose --autounmask=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildsyspkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://xeon.gentoo.ru/mirrors/gentoo/distfiles/ 		ftp://mirror2.corbina.ru/gentoo-distfiles/ 		http://mirror2.corbina.ru/gentoo-distfiles/ 		http://mirror.yandex.ru/gentoo-distfiles/ 		ftp://mirror.yandex.ru/gentoo-distfiles/ 		http://gentoo.bloodhost.ru/ 		ftp://gentoo.bloodhost.ru/ 		distfiles.gentoo.org"
LANG="ru_RU.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
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/gentoo"
PORTDIR_OVERLAY="/usr/portage/layman/rion /usr/portage/layman/mva /usr/portage/local"
SYNC="rsync://mirror.yandex.ru/gentoo-portage/"
USE="X a52 acl alsa amd64 berkdb bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus djvu dri dv dvd ffmpeg flac fortran gdbm gif gtk iconv icu jpeg jpeg2k kpathsea mac mmx modules mp3 mpeg multilib ncurses nls nptl ogg openmp pam pcre pdf png policykit qt3support readline session sse sse2 ssl tcpd tiff truetype unicode utf8 v4l v4l2 vorbis x264 zlib" ABI_X86="64" ALSA_CARDS="hda-intel" 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" CPU_FLAGS_X86="aes mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" FOO2ZJS_DEVICES="hp1018" 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" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="ru" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="i386" QEMU_USER_TARGETS="i386" RUBY_TARGETS="ruby19 ruby20" SANE_BACKENDS="genesys" USERLAND="GNU" VIDEO_CARDS="intel" 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"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Zac Medico gentoo-dev 2015-03-25 22:07:27 UTC
You need :: before the repo name, so your atoms should be dev-qt/*:5::gentoo instead.
Comment 2 Sergey S. Starikoff 2015-03-26 07:10:50 UTC
(In reply to Zac Medico from comment #1)
> You need :: before the repo name, so your atoms should be dev-qt/*:5::gentoo
> instead.

Thank you!

But I find a little bit strange usage of two _different_ (!) field-separators: ':' for optional field "slot" and '::' for also optional field "repository".

In any case, this format shopuld be properly and completely documented.
Comment 3 Martin Väth 2015-03-26 08:08:41 UTC
(In reply to Sergey S. Starikoff from comment #2)
> little bit strange usage of two _different_ (!) field-separators

Originally, I had also expected the same (and the implementation in eix was originally buggy for this reason). However, thinking it over, I changed my mind:

Since *both* fields are optional, you *need* two different field separators:
Otherwise you could not distinguish between "specified as empty" or "unspecified"
(this difference might e.g. be taken into account for determining the "specification level").
Comment 4 Sergey S. Starikoff 2015-03-27 06:16:59 UTC
(In reply to Martin Väth from comment #3)
> Originally, I had also expected the same (and the implementation in eix was
> originally buggy for this reason). However, thinking it over, I changed my
> mind:
> 
> Since *both* fields are optional, you *need* two different field separators:
> Otherwise you could not distinguish between "specified as empty" or
> "unspecified"
> (this difference might e.g. be taken into account for determining the
> "specification level").

I'm more meticulous.
So, here I'm interested for what reasons we may need to differ slot "specified as empty" and "unspecified"?

vim's skel of ebuild contains SLOT variable.

Trying to generate manifest for ebuild without SLOT avriable fails:

# ebuild sqlitestudio-3.0.3.ebuild manifest
Error(s) in metadata for 'dev-db/sqlitestudio-3.0.3':
  SLOT: invalid value: ''

So, I expect "specified as empty" being default value and "unspecified" as invalid.
And using similiar field separator (':') for both fields (slot and repository) seems to be possible.
Comment 5 Martin Väth 2015-03-27 07:24:42 UTC
(In reply to Sergey S. Starikoff from comment #4)
> So, here I'm interested for what reasons we may need to differ slot
> "specified as empty" and "unspecified"?

I have given a possible example: One might want to make this difference when sorting entries by specification level.

> Trying to generate manifest for ebuild without SLOT avriable fails

Completely irrelevant concerning the atom syntax. "Specified as empty" can mean e.g. to match any value (but in contrast to "unspecified" is considered as a specification).

> So, I expect "specified as empty" being default value and "unspecified" as
> invalid.

What you expect is independent of what is (or can be) implemented.
In this connection, it plays no rule what currently *is* implemented or what is planned to be implemented in the near future (I did not even check how portage does handle it currently, because it plays no role): When deciding about a syntax, it is always best to have it as future-safe as possible.

Now that the syntax *is* established since years, the rules have changed anyway: It is your *duty* to prove the current syntax to be broken if you want to change it and to force hundreds or thousands of users to change their configuration. You must have a very strong reason to do so.
"Currently the extended possibilities with this more general syntax are not yet implemented" is not a valid reason.