summaryrefslogtreecommitdiffstats
path: root/src/extension/extension.cpp
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-10-14 23:47:09 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-10-15 00:05:47 +0000
commit3da7f71e45eb986aef67771b5af3c1e308971cff (patch)
tree4b1b842ab5f9d1ccd61df7e83aa13d2072490fb2 /src/extension/extension.cpp
parentFix a warning issue on theme change (diff)
downloadinkscape-3da7f71e45eb986aef67771b5af3c1e308971cff.tar.gz
inkscape-3da7f71e45eb986aef67771b5af3c1e308971cff.zip
Extensions: Fix file test when checking dependencies by type
For "executable" files only existence was checked. (Glib::file_test needs a single FileTest) Apply this properly when checking script <command>s and xslt <file>s - interpreted scripts and xslt files -> only check existence - un-interpreted scripts -> check for executable file For Windows workarounds are implemented to yield desirable behavior: - as there is no executable bit, only check existence - as executables usually come with an extensions, scan for those as well.
Diffstat (limited to 'src/extension/extension.cpp')
-rw-r--r--src/extension/extension.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp
index e0f4ed3fe..fedd0facc 100644
--- a/src/extension/extension.cpp
+++ b/src/extension/extension.cpp
@@ -125,14 +125,16 @@ Extension::Extension(Inkscape::XML::Node *in_repr, Implementation::Implementatio
} else if (!strcmp(chname, "script")) { // TODO: should these be parsed in their respective Implementation?
for (Inkscape::XML::Node *child = child_repr->firstChild(); child != nullptr; child = child->next()) {
if (child->type() == Inkscape::XML::ELEMENT_NODE) { // skip non-element nodes (see LP #1372200)
- _deps.push_back(new Dependency(child, this));
+ const char *interpreted = child->attribute("interpreter");
+ Dependency::type_t type = interpreted ? Dependency::TYPE_FILE : Dependency::TYPE_EXECUTABLE;
+ _deps.push_back(new Dependency(child, this, type));
break;
}
}
} else if (!strcmp(chname, "xslt")) { // TODO: should these be parsed in their respective Implementation?
for (Inkscape::XML::Node *child = child_repr->firstChild(); child != nullptr; child = child->next()) {
if (child->type() == Inkscape::XML::ELEMENT_NODE) { // skip non-element nodes (see LP #1372200)
- _deps.push_back(new Dependency(child, this));
+ _deps.push_back(new Dependency(child, this, Dependency::TYPE_FILE));
break;
}
}