Skip to content

Commit

Permalink
EAPI in --xml. Fix initialization of know_eapi. Wipe env *FLAGS witho…
Browse files Browse the repository at this point in the history
…ut -e
  • Loading branch information
vaeth committed Jan 12, 2016
1 parent b02ca5a commit c32de25
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 21 deletions.
3 changes: 2 additions & 1 deletion contrib/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ FilterClang() {
}

if ! $keepenv
then CFLAGS=`portageq envvar CFLAGS`
then unset CFLAGS CXXFLAGS LDFLAGS CPPFLAGS CXX
CFLAGS=`portageq envvar CFLAGS`
CXXFLAGS=`portageq envvar CXXFLAGS`
LDFLAGS=`portageq envvar LDFLAGS`
CPPFLAGS=`portageq envvar CPPFLAGS`
Expand Down
9 changes: 8 additions & 1 deletion doc/eix-xml.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ the **eixdump** element.

.. container:: layout-block version-block

**<version id="** 1st version of 1st package **"** [possibly further `version attributes`_ (see below), separated by spaces] **>**
**<version id="** 1st version of 1st package **"EAPI="** ... **"** [possibly further `version attributes`_ (see below), separated by spaces] **>**

[possibly `version elements`_ (see below), separated by newlines and tabs]

Expand Down Expand Up @@ -119,6 +119,13 @@ Except for id, all of them are optional.
The installDate attribute is output if and only if the installed attribute
is output, i.e. if and only if the version is installed.

- **installEAPI="** [..] **"**

The EAPI of the installed version.
In contrast, the **EAPI** attribute refers to the available version.
The installEAPI attribute is output if and only if the installed attribute
is output, i.e. if and only if the version is installed.


`Version Elements`
------------------
Expand Down
16 changes: 16 additions & 0 deletions doc/eix-xml.xsd.in
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="EAPI" type="xsd:string" use="required">
<xsd:annotation>
<xsd:documentation xml:lang="en">
The EAPI of the (available) version.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="virtual" type="xsd:string" fixed="1">
<xsd:annotation>
<xsd:documentation xml:lang="en">
Expand Down Expand Up @@ -278,6 +285,15 @@
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="installEAPI" type="xsd:string">
<xsd:annotation>
<xsd:documentation xml:lang="en">
The EAPI of the installed version.
The installEAPI attribute is output if and only if the installed attribute
is output, i.e. if and only if the version is installed.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>

<xsd:complexType name="Package">
Expand Down
13 changes: 8 additions & 5 deletions src/output/print-xml.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,29 +171,32 @@ void PrintXml::package(Package *pkg) {
if(var_db_pkg->isInstalled(*pkg, *ver, &installedVersion)) {
versionInstalled = true;
var_db_pkg->readInstDate(*pkg, installedVersion);
var_db_pkg->readEapi(*pkg, installedVersion);
}
}

cout << "\t\t\t<version id=\"" << escape_xmlstring(ver->getFull()) << "\"";
cout << "\t\t\t<version id=\"" << escape_xmlstring(ver->getFull()) <<
"\" EAPI=\"" << escape_xmlstring(ver->eapi.get()) << '"';
ExtendedVersion::Overlay overlay_key(ver->overlay_key);
if(unlikely(overlay_key != 0)) {
if(print_format->is_virtual(overlay_key)) {
cout << " virtual=\"1\"";
}
const OverlayIdent& overlay(hdr->getOverlay(overlay_key));
if((print_overlay || overlay.label.empty()) && !(overlay.path.empty())) {
cout << " overlay=\"" << escape_xmlstring(overlay.path) << "\"";
cout << " overlay=\"" << escape_xmlstring(overlay.path) << '"';
}
if(!overlay.label.empty()) {
cout << " repository=\"" << escape_xmlstring(overlay.label) << "\"";
cout << " repository=\"" << escape_xmlstring(overlay.label) << '"';
}
}
if(!ver->get_shortfullslot().empty()) {
cout << " slot=\"" << escape_xmlstring(ver->get_longfullslot()) << "\"";
cout << " slot=\"" << escape_xmlstring(ver->get_longfullslot()) << '"';
}
if(versionInstalled) {
cout << " installed=\"1\" installDate=\"" <<
escape_xmlstring(date_conv(dateformat.c_str(), installedVersion->instDate)) << "\"";
escape_xmlstring(date_conv(dateformat.c_str(), installedVersion->instDate)) <<
"\" installEAPI=\"" << escape_xmlstring(installedVersion->eapi.get()) << '"';
}
cout << ">\n";

Expand Down
2 changes: 1 addition & 1 deletion src/output/print-xml.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class PrintXml {

public:
typedef eix::UNumber XmlVersion;
static CONSTEXPR XmlVersion current = 12;
static CONSTEXPR XmlVersion current = 13;

void init(const DBHeader *header, VarDbPkg *vardb, const PrintFormat *printformat, const SetStability *set_stability, EixRc *eixrc, const std::string& port_dir) ATTRIBUTE_NONNULL_ {
hdr = header;
Expand Down
16 changes: 3 additions & 13 deletions src/portage/instversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,9 @@ class InstVersion : public ExtendedVersion, public Keywords {
**/
bool know_overlay, overlay_failed;

void init() {
know_slot = false;
read_failed = false;
know_use = false;
know_restricted = false;
know_deps = false;
instDate = 0;
know_overlay = false;
overlay_failed = false;
}

InstVersion() {
init();
InstVersion() : know_slot(false), read_failed(false), know_use(false),
know_restricted(false), know_deps(false), know_eapi(false),
instDate(0), know_overlay(false), overlay_failed(false) {
}

static eix::SignedBool compare(const InstVersion& left, const InstVersion& right) ATTRIBUTE_PURE;
Expand Down

0 comments on commit c32de25

Please sign in to comment.