5X6FHW3SHOE5R37WJPLKNVJM6VWFT6SNRMC5OFFCCW3IGC4ORY2QC
PMNWRTGJ4GVSMSSAWSUD57B26PCRAHMZIQ5SIWJIK7A74ENKEQLAC
DPYJFBXU55M7PFYHARO5FSZ4GFNZQQI4GYV5YTIXC77FUCVUU3PAC
HVXL2XUZTOWJPESBHBFD74B4QXNMG5SX4LOXDLPJ7732IU4SUYWQC
4N5APGRGHTKFMEJ7THSJX6TSYYAP3BUZQG73AJBKCQLXOOEHPATQC
3PNG7NIBQQURUUPRVQXYL342OT7JUUYOMY2JJNP6YDX7SYJDZMYAC
7YCFGMZBCWDOOO3DHSJ3ZWPUWFMEO6OLQGDZWLULAPER3YZOYUJAC
KD5237CUR4X3VRUD46H3CVU22NYS7LOPF3WXENWHNSF7GKEIQZ6QC
4LWGZL33NOCTVZXUZZM5P6BRBHDUMEAJPVPNB52PN3UZVC7DMSZAC
YGRLM2SKOIPP4M24VYZTRREELKICDFKXL7ZHHR54BR5HVRCDOP6AC
A63IHCMXH3F4V56HDXJLJVVHKXRSJCJMT2PWXXI2IW3J734J6SGQC
ZTQEU5QSAJYC66QQABJLVR7EEZWEIW6UMQMSIEP2KRZH5PGEB53QC
5MNUNZWR3HN5OOY4G6UQ5CMJTOSQIEFSJR5VOU4NE2KYLJAYRA3AC
MetaValue value = meta[name];
if (value.type != MetaValue::tpString) return "";
return value.stringValue;
}
static int queryMetaFieldInt(MetaInfo & meta, const string & name, int def)
{
MetaValue value = meta[name];
if (value.type == MetaValue::tpInt) return value.intValue;
if (value.type == MetaValue::tpString) {
int n;
if (string2Int(value.stringValue, n)) return n;
}
return def;
}
static string queryMetaField(MetaInfo & meta, const string & name)
{
string res;
MetaValue value = meta[name];
if (value.type == MetaValue::tpString)
res = value.stringValue;
else if (value.type == MetaValue::tpStrings) {
foreach (Strings::const_iterator, i, value.stringValues) {
if (res.size() != 0) res += ", ";
res += *i;
Value * v = drv.queryMeta(name);
if (v) {
state.forceValue(*v);
if (v->type == tString)
return v->string.s;
else if (v->type == tList) {
string res = "";
for (unsigned int n = 0; n < v->list.length; ++n) {
Value v2(*v->list.elems[n]);
state.forceValue(v2);
if (v2.type == tString) {
if (res.size() != 0) res += ", ";
res += v2.string.s;
}
}
return res;
xmlAttrs["drvPath"] = drvPath = drv.queryDrvPath(state);
MetaInfo meta = drv.queryMetaInfo(state);
xmlAttrs["description"] = queryMetaFieldString(meta, "description");
xmlAttrs["longDescription"] = queryMetaFieldString(meta, "longDescription");
xmlAttrs["license"] = queryMetaField(meta, "license");
xmlAttrs["homepage"] = queryMetaFieldString(meta, "homepage");
xmlAttrs["maintainers"] = queryMetaField(meta, "maintainers");
xmlAttrs["drvPath"] = drvPath = drv.queryDrvPath();
xmlAttrs["description"] = drv.queryMetaString("description");
xmlAttrs["longDescription"] = drv.queryMetaString("longDescription");
xmlAttrs["license"] = queryMetaStrings(state, drv, "license");
xmlAttrs["homepage"] = drv.queryMetaString("homepage");
xmlAttrs["maintainers"] = queryMetaStrings(state, drv, "maintainers");