A forked version from https://gitorious.org/appstream/appstream/source/820802e089edcee3dc28e1c8828b4167ef6a4896: