Skip to content

Commit

Permalink
Support SRC_URI
Browse files Browse the repository at this point in the history
  • Loading branch information
vaeth committed Sep 19, 2018
1 parent 4ac7d32 commit 470c9d3
Show file tree
Hide file tree
Showing 45 changed files with 476 additions and 87 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
*eix-0.33.5
Martin Väth <martin at mvath.de>:
- New search options --{available,installed}-{deps,{,r,p,b}depend}
- Support SRC_URI, https://bugs.gentoo.org/show_bug.cgi?id=666546
In detail: Add SRC_URI, <srcuri> {havesrcuri}, --src-uri,
extend DEFAULT_MATCH_FIELD by src-uri, output by default with -vl,
output in xml, new xml version 15, new eix database version 38
- handle installed deps even without DEP
- default to --with-deps-default --with-required-use-default
- bugfix: empty LINGUAS w/ meson https://github.com/vaeth/eix/issues/54
- do not let installed deps default to available deps if DEPS_INSTALLED
- add yet another ATTRIBUTE_PURE
Expand Down
3 changes: 3 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,9 @@
/* Default ROOT */
#undef ROOT_DEFAULT

/* Default SRC_URI */
#undef SRC_URI_DEFAULT

/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS

Expand Down
26 changes: 20 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1782,26 +1782,40 @@ AC_SUBST([ALWAYS_ACCEPT_KEYWORDS_DEFAULT])

AC_MSG_CHECKING([DEP default])
AC_ARG_WITH([dep-default],
[AS_HELP_STRING([--with-dep-default],
[default to DEP=true])],
[AS_HELP_STRING([--without-dep-default],
[default to DEP=false])],
[AS_CASE(["$withval"],
[no], [AS_VAR_SET([DEP_DEFAULT], ["false"])],
[AS_VAR_SET([DEP_DEFAULT], ["true"])])],
[AS_VAR_SET([DEP_DEFAULT], ["false"])])
[AS_VAR_SET([DEP_DEFAULT], ["true"])])
MV_MSG_RESULT_VAR([DEP_DEFAULT])
AC_DEFINE_UNQUOTED([DEP_DEFAULT],
["$DEP_DEFAULT"],
[Default DEP])
AC_SUBST([DEP_DEFAULT])

AC_MSG_CHECKING([SRC_URI default])
AC_ARG_WITH([src-uri-default],
[AS_HELP_STRING([--without-src-uri-default],
[default to SRC_URI=false])],
[AS_CASE(["$withval"],
[no], [AS_VAR_SET([SRC_URI_DEFAULT], ["false"])],
[AS_VAR_SET([SRC_URI_DEFAULT], ["true"])])],
[AS_VAR_SET([SRC_URI_DEFAULT], ["true"])])
MV_MSG_RESULT_VAR([SRC_URI_DEFAULT])
AC_DEFINE_UNQUOTED([SRC_URI_DEFAULT],
["$SRC_URI_DEFAULT"],
[Default SRC_URI])
AC_SUBST([SRC_URI_DEFAULT])

AC_MSG_CHECKING([REQUIRED_USE default])
AC_ARG_WITH([required-use-default],
[AS_HELP_STRING([--with-required-use-default],
[default to REQUIRED_USE=true])],
[AS_HELP_STRING([--without-required-use-default],
[default to REQUIRED_USE=false])],
[AS_CASE(["$withval"],
[no], [AS_VAR_SET([REQUIRED_USE_DEFAULT], ["false"])],
[AS_VAR_SET([REQUIRED_USE_DEFAULT], ["true"])])],
[AS_VAR_SET([REQUIRED_USE_DEFAULT], ["false"])])
[AS_VAR_SET([REQUIRED_USE_DEFAULT], ["true"])])
MV_MSG_RESULT_VAR([REQUIRED_USE_DEFAULT])
AC_DEFINE_UNQUOTED([REQUIRED_USE_DEFAULT],
["$REQUIRED_USE_DEFAULT"],
Expand Down
9 changes: 1 addition & 8 deletions contrib/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Available options are
-1/2/3 Generate 1/2/3 binaries for eix-{,diff,update} but no separate tools
(unless combined with -4)
-4 Enable separate tools but no separate binaries (unless combined with 2/3)
-D Do not use dep-default, required-use-default
-w Use -werror
-W Do not use --enable-strong-warnings
-g Use clang++, setting CXX, filtering some flags (default if available)
Expand Down Expand Up @@ -104,7 +103,6 @@ clang_cxx=`PATH=${PATH-}${PATH:+:}/usr/lib/llvm/*/bin command -v clang++ 2>/dev/
meson=false
remove_builddir=false
quiet=false
dep_default=:
earlystop=false
keepenv=false
warnings=:
Expand All @@ -123,7 +121,7 @@ debugging=false
dialect=:
nopie_security=:
OPTIND=1
while getopts 'mJRq1234gGDnewWsSrOoCxXyYdM:c:j:hH' opt
while getopts 'mJRq1234gGnewWsSrOoCxXyYdM:c:j:hH' opt
do case $opt in
m) meson=:;;
J) meson_extra=$meson_extra' -Djumbo-build=false'
Expand All @@ -142,7 +140,6 @@ do case $opt in
configure_extra=$configure_extra' --enable-separate-tools';;
g) clang=:;;
G) clang=false;;
D) dep_default=false;;
n) earlystop=:;;
e) keepenv=:;;
w) werror=:;;
Expand Down Expand Up @@ -179,10 +176,6 @@ then meson_extra=$meson_extra' -Dnew-dialect=true'
else meson_extra=$meson_extra' -Dnew-dialect=false'
configure_extra=$configure_extra' --disable-new-dialect'
fi
if $dep_default
then meson_extra=$meson_extra' -Ddep-default=true -Drequired-use-default=true'
configure_extra=$configure_extra' --with-dep-default --with-required-use-default'
fi
if $separate_all
then meson_extra=$meson_extra' -Dseparate-binaries=true -Dseparate-tools=true'
configure_extra=$configure_extra' --enable-separate-binaries --enable-separate-tools'
Expand Down
6 changes: 5 additions & 1 deletion doc/eix-db.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ Vector names of world sets
Number This is a bitmask:
0x01: dependencies are stored
0x02: REQUIRED_USE is stored
0x04: SRC_URI is stored

The rest occurs only if dependencies are stored
Number Length of the subsequent hash in bytes
Expand Down Expand Up @@ -258,14 +259,17 @@ HashedWords Useflags of this version
The following occurs only if REQUIRED_USE is stored
HashedWords REQUIRED_USE of this version

The rest occurs only if dependencies are stored
The following occurs only if dependencies are stored
Number Length of the next four entries in bytes
HashedWords DEPEND of this version; the quotation symbol means
the content of RDEPEND (it occurs only as separate word)
HashedWords RDEPEND of this version; the quotation symbol means
the content of DEPEND (it occurs only as separate word)
HashedWords PDEPEND of this version
HashedWords BDEPEND of this version

The following occurs only if SRC_URI is stored
String SRC_URI
============ ========================================================


Expand Down
4 changes: 4 additions & 0 deletions doc/eix-xml.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ Except for id, all of them are optional.

The slot name is only output if it is nonempty and different from 0.

- **srcURI="** [..] **"**

The SRC_URI is only output if it is nonempty.

- **installed="1"**

This is only output if the version is installed.
Expand Down
7 changes: 7 additions & 0 deletions doc/eix-xml.xsd.in
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="srcURI" type="xsd:string">
<xsd:annotation>
<xsd:documentation xml:lang="en">
The SRC_URI; is only output if it is nonempty.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="installed" type="xsd:string" fixed="1">
<xsd:annotation>
<xsd:documentation xml:lang="en">
Expand Down
22 changes: 19 additions & 3 deletions manpage/de-eix.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -891,11 +891,14 @@ oder eines anderen Verzeichnisses ausB<EIX_LOCAL_SETS_ADD>; siehe die Kommentare
Die "profile", "system" und "world" sets sind hier bewusst ausgenommen, da diese mit
B<--profile[+-]>, B<--system[+-]>, B<--world>, B<--world-all> oder B<--world-sets> getestet werden sollten.
.TP
.B --src-uri
SRC_URI einer Version in der Datenbank.
.TP
.B --eapi
EAPI of a version in the database, e.g. "6"
EAPI einer Version in der Datenbank, z.B. "6"
.TP
.B --installed-eapi
EAPI of an installed version
EAPI einer installierten Version
.TP
.B --slot
Slotname einer Version in der Datenbank, z.B. "kde-4"
Expand Down Expand Up @@ -1319,6 +1322,10 @@ Um die Wiederbenutzung von Code zu erleichtern gilt:
Wenn die Durckausgabe nicht Slot-sortiert ist, dann sind
B<slotfirst>/B<slotlast> äquivalent zu B<first>/B<last>, und B<oneslot> ist 1.
.TP
.BR srcuri, havesrcuri
Dies darf nur in I<VARIABLE> im Zusammenhang von Versionsausgaben benutzt werden.
Sie gibt die B<SRC_URI> einer verfügbaren Version aus bzw. 1, wenn B<SRC_URI> nicht leer ist.
.TP
.BR eapi
Dies darf nur in I<VARIABLE> im Zusammenhang von Versionsausgaben benutzt werden.
Sie gibt die B<EAPI> einer verfügbaren oder installierten Version aus.
Expand Down Expand Up @@ -2455,6 +2462,13 @@ B<DEPEND>, B<RDEPEND>, B<PDEPEND>, B<BDEPEND> (die z.B. mit eix -lv gezeigt werd
tatsächlich benutzt und gespeichert werden sollen.
Im positiven Fall verdoppelt sich ungefähr der Disk- und Speicherbedarf von eix.

.TP
.BR SRC_URI " " (true / false)
Dieser Wert entscheidet, ob die Variable
B<SRC_URI> (die z.B. mit eix -lv gezeigt werden könnten)
tatsächlich benutzt und gespeichert werden sollen.
Im positiven Fall verdoppelt sich ungefähr der Disk- und Speicherbedarf von eix.

.TP
.BR REQUIRED_USE " " (true / false)
Dieser Wert entscheidet, ob die Variable B<REQUIRED_USE> (die z.B. mit eix -l gezeigt werden könnte)
Expand Down Expand Up @@ -3220,7 +3234,7 @@ praktisch sein, da man sich so das händische Escapen spart.
Die möglichen Werte für I<Operandenfeld> sind: B<name>, B<category>, B<category/name>
(oder B<category-name>), B<description>, B<license>, B<homepage>, B<set>, B<eapi>, B<installed-eapi>,
B<slot>, B<installed-slot>, B<use> (oder B<iuse>), B<with-use> (oder B<installed-with-use>),
B<without-use> (oder B<installed-without-use>),
B<without-use> (oder B<installed-without-use>), B<src-uri> (oder B<srcuri>),
B<deps>, B<depend>, B<rdepend>, B<pdepend>, B<bdepend> und B<error>.
Sie entsprechen den analogen Kommandozeilenoptionen für die Operandenwahl.
Der spezielle Wert B<error> bedeutet, dass eix mit der Fehlermeldung abbricht,
Expand Down Expand Up @@ -4030,6 +4044,8 @@ Wenn Sie für Systeme mit wenig Speicher kompilieren, kann es auch ratsam sein,

.B --without-dep-default

.B --without-src-uri-default

und/oder

.B --without-required-use-default
Expand Down
17 changes: 16 additions & 1 deletion manpage/en-eix.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,9 @@ see the comments to B<EIX_LOCAL_SETS>).
The "profile", "system" and "world" sets are intentionally excluded here, since these
should be tested with B<--profile[+-]>, B<--system[+-]>, B<--world>, B<--world-all>, or B<--world-sets>.
.TP
.B --src-uri
SRC_URI of a version in the database
.TP
.B --eapi
EAPI of a version in the database, e.g. "6"
.TP
Expand Down Expand Up @@ -1293,6 +1296,11 @@ All these properties are empty if the condition is not satisfied, otherwise 1.
To ease reusing code, when printing is not sorted according to slots, then
B<slotfirst>/B<slotlast> is equivalent to B<first>/B<last> and B<oneslot> is 1.
.TP
.BR srcuri, havesrcuri
This must occur only in I<VARIABLE> in the context of version printing.
It outputs the B<SRC_URI> of an available version or 1, if B<SRC_URI> is nonempty,
respectively.
.TP
.BR eapi
This must occur only in I<VARIABLE> in the context of version printing.
It outputs the B<EAPI> of an available or installed version.
Expand Down Expand Up @@ -2423,6 +2431,11 @@ The option B<--deps-installed> does the same.
If true, store/use B<DEPEND>, B<RDEPEND>, B<PDEPEND>, B<BDEPEND> (e.g. shown with eix -lv).
Usage of B<DEP> roughly doubles disk resp. memory requirements.

.TP
.BR SRC_URI " " (true / false)
If true, store/use B<SRC_URI>.
Usage of B<SRC_URI> roughly doubles disk resp. memory requirements.

.TP
.BR REQUIRED_USE " " (true / false)
If true, store/use B<REQUIRED_USE> (e.g. shown with eix -l).
Expand Down Expand Up @@ -3152,7 +3165,7 @@ to avoid manually inserting additional escapes.
The possible values for I<match_field> are B<name>, B<category>, B<category/name>
(or B<category-name>), B<description>, B<license>, B<homepage>, B<set>, B<eapi>, B<installed-eapi>,
B<slot>, B<installed-slot>, B<use> (or B<iuse>), B<with-use> (or B<installed-with-use>),
B<without-use> (or B<installed-without-use>),
B<without-use> (or B<installed-without-use>), B<src-uri> (or B<srcuri>),
B<deps>, B<depend>, B<rdepend>, B<pdepend>, B<bdepend>, or B<error>,
corresponding to the analogous command line option for the match field.
The special value B<error> means that eix stops with an error message claiming
Expand Down Expand Up @@ -3934,6 +3947,8 @@ If you compile for a low-memory system, it might also be advisable to add

.B --without-dep-default

.B --without-src-uri-default

and/or

.B --without-required-use-default
Expand Down
17 changes: 16 additions & 1 deletion manpage/ru-eix.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,9 @@ see the comments to B<EIX_LOCAL_SETS>).
The "profile", "system" and "world" sets are intentionally excluded here, since these
should be tested with B<--profile[+-]>, B<--system[+-]>, B<--world>, B<--world-all>, or B<--world-sets>.
.TP
.B --src-uri
SRC_URI of a version in the database
.TP
.B --eapi
EAPI of a version in the database, e.g. "6"
.TP
Expand Down Expand Up @@ -1290,6 +1293,11 @@ All these properties are empty if the condition is not satisfied, otherwise 1.
To ease reusing code, when printing is not sorted according to slots, then
B<slotfirst>/B<slotlast> is equivalent to B<first>/B<last> and B<oneslot> is 1.
.TP
.BR srcuri, havesrcuri
This must occur only in I<VARIABLE> in the context of version printing.
It outputs the B<SRC_URI> of an available version or 1, if B<SRC_URI> is nonempty,
respectively.
.TP
.BR eapi
This must occur only in I<VARIABLE> in the context of version printing.
It outputs the B<EAPI> of an available or installed version.
Expand Down Expand Up @@ -2420,6 +2428,11 @@ The option B<--deps-installed> does the same.
If true, store/use B<DEPEND>, B<RDEPEND>, B<PDEPEND>, B<BDEPEND> (e.g. shown with eix -lv).
Usage of B<DEP> roughly doubles disk resp. memory requirements.

.TP
.BR SRC_URI " " (true / false)
If true, store/use B<SRC_URI>.
Usage of B<SRC_URI> roughly doubles disk resp. memory requirements.

.TP
.BR REQUIRED_USE " " (true / false)
If true, store/use B<REQUIRED_USE> (e.g. shown with eix -l).
Expand Down Expand Up @@ -3149,7 +3162,7 @@ to avoid manually inserting additional escapes.
The possible values for I<match_field> are B<name>, B<category>, B<category/name>
(or B<category-name>), B<description>, B<license>, B<homepage>, B<set>, B<eapi>, B<installed-eapi>,
B<slot>, B<installed-slot>, B<use> (or B<iuse>), B<with-use> (or B<installed-with-use>),
B<without-use> (or B<installed-without-use>),
B<without-use> (or B<installed-without-use>), B<src-uri> (or B<srcuri>),
B<deps>, B<depend>, B<rdepend>, B<pdepend>, B<bdepend>, or B<error>,
corresponding to the analogous command line option for the match field.
The special value B<error> means that eix stops with an error message claiming
Expand Down Expand Up @@ -3931,6 +3944,8 @@ If you compile for a low-memory system, it might also be advisable to add

.B --without-dep-default

.B --without-src-uri-default

and/or

.B --without-required-use-default
Expand Down
5 changes: 5 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,11 @@ result += [ 'dep-default=' + dep_default.to_string() ]
conf.set_quoted('DEP_DEFAULT', dep_default.to_string(),
description : 'Default DEP')

src_uri_default = get_option('src-uri-default')
result += [ 'src-uri-default=' + src_uri_default.to_string() ]
conf.set_quoted('SRC_URI_DEFAULT', src_uri_default.to_string(),
description : 'Default SRC_URI')

required_use_default = get_option('required-use-default')
result += [ 'required-use-default=' + required_use_default.to_string() ]
conf.set_quoted('REQUIRED_USE_DEFAULT', required_use_default.to_string(),
Expand Down
6 changes: 4 additions & 2 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ option('eix-gid', type : 'string', value : '%{EIX_UID}',
description : 'default EIX_GID')
option('always-accept-keywords', type : 'boolean', value : false,
description : 'default ALWAYS_ACCEPT_KEYWORDS')
option('dep-default', type : 'boolean', value : false,
option('dep-default', type : 'boolean', value : true,
description : 'default DEP')
option('required-use-default', type : 'boolean', value : false,
option('src-uri-default', type : 'boolean', value : true,
description : 'default SRC_URI')
option('required-use-default', type : 'boolean', value : true,
description : 'default REQUIRED_USE')
option('zsh-completion', type : 'string', value : 'share/zsh/site-functions',
description : 'Where to install zsh-completion. Empty string means no installation')
Expand Down
Loading

0 comments on commit 470c9d3

Please sign in to comment.