diff options
author | Michael Schroeder <mls@suse.de> | 2014-02-26 18:15:01 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2014-02-26 18:15:01 +0100 |
commit | 6deb2df6c9379ac5444fffa5c1f70cafea440775 (patch) | |
tree | 10b7e22e44c3b5ce800c28c40f8be86e90026096 | |
parent | 6d82d706697c67982d68291b4da7074603f0aa3f (diff) | |
download | libsolv-6deb2df6c9379ac5444fffa5c1f70cafea440775.tar.gz libsolv-6deb2df6c9379ac5444fffa5c1f70cafea440775.tar.bz2 libsolv-6deb2df6c9379ac5444fffa5c1f70cafea440775.zip |
improve guessing of appdata.xml file name
-rw-r--r-- | ext/repo_appdata.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/repo_appdata.c b/ext/repo_appdata.c index 96e114c..3d0ebba 100644 --- a/ext/repo_appdata.c +++ b/ext/repo_appdata.c @@ -368,8 +368,17 @@ endElement(void *userData, const char *name) break; case STATE_ID: pd->desktop_file = solv_strdup(pd->content); + /* guess the appdata.xml file name from the id element */ if (pd->lcontent > 8 && !strcmp(".desktop", pd->content + pd->lcontent - 8)) pd->content[pd->lcontent - 8] = 0; + else if (pd->lcontent > 4 && !strcmp(".ttf", pd->content + pd->lcontent - 4)) + pd->content[pd->lcontent - 4] = 0; + else if (pd->lcontent > 4 && !strcmp(".otf", pd->content + pd->lcontent - 4)) + pd->content[pd->lcontent - 4] = 0; + else if (pd->lcontent > 4 && !strcmp(".xml", pd->content + pd->lcontent - 4)) + pd->content[pd->lcontent - 4] = 0; + else if (pd->lcontent > 3 && !strcmp(".db", pd->content + pd->lcontent - 3)) + pd->content[pd->lcontent - 3] = 0; id = pool_str2id(pd->pool, pool_tmpjoin(pool, "appdata(", pd->content, ".appdata.xml)"), 1); s->requires = repo_addid_dep(pd->repo, s->requires, id, 0); id = pool_str2id(pd->pool, pool_tmpjoin(pool, "application-appdata(", pd->content, ".appdata.xml)"), 1); |