|
|
@@ -38,6 +38,8 @@ namespace Usm {
|
|
|
return locate_canonlib(resource_ref);
|
|
|
case ResourceType.CANONICAL_LIBRARY_RESOURCE:
|
|
|
return locate_canonlibres(resource_ref);
|
|
|
+ case ResourceType.GIO_MODULE:
|
|
|
+ return locate_gio(resource_ref);
|
|
|
case ResourceType.INFO_PAGE:
|
|
|
return locate_info(resource_ref);
|
|
|
case ResourceType.MANUAL_PAGE:
|
|
|
@@ -190,6 +192,29 @@ namespace Usm {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ private string? locate_gio(ResourceRef resource) {
|
|
|
+ var search = Iterate.these("/usr/lib64/gio/modules", "/usr/lib/gio/modules");
|
|
|
+ // Debian-style multiarch keeps GIO modules in
|
|
|
+ // /usr/lib/<triple>/gio/modules, which no fixed path covers:
|
|
|
+ // enumerate whatever multiarch directories exist
|
|
|
+ try {
|
|
|
+ foreach(var entry in Iterate.directory("/usr/lib")) {
|
|
|
+ if(entry.contains("-linux-")) {
|
|
|
+ search = search.concat(Wrap.array(new string[] { @"/usr/lib/$entry/gio/modules" }));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch(FileError e) {
|
|
|
+ }
|
|
|
+ foreach (var path in search) {
|
|
|
+ var file = File.new_build_filename(paths.destination, path, resource.resource);
|
|
|
+ if(file.query_exists()) {
|
|
|
+ return file.get_path();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
private string? locate_app(ResourceRef resource) {
|
|
|
var file = File.new_build_filename("/usr/share/applications", resource.resource);
|
|
|
return file.query_exists() ? file.get_path() : null;
|