|
|
@@ -529,7 +529,7 @@ public static Invercargill.DataStructures.Dictionary<Usm.ResourceRef, Usm.Manife
|
|
|
var folder = File.new_for_path(path);
|
|
|
|
|
|
// Getting a list of all files and folders inside the directory
|
|
|
- var enumerator = folder.enumerate_children("*", FileQueryInfoFlags.NONE);
|
|
|
+ var enumerator = folder.enumerate_children("*", FileQueryInfoFlags.NOFOLLOW_SYMLINKS);
|
|
|
|
|
|
var provides = new Invercargill.DataStructures.Dictionary<Usm.ResourceRef, Usm.ManifestFile>();
|
|
|
|
|
|
@@ -542,7 +542,6 @@ public static Invercargill.DataStructures.Dictionary<Usm.ResourceRef, Usm.Manife
|
|
|
|
|
|
// Checking if the current item is a file or a folder
|
|
|
if (info.get_file_type() == FileType.REGULAR) {
|
|
|
- // Removing the file
|
|
|
var file = folder.get_child(info.get_name());
|
|
|
var true_path = file.get_path().substring(install_root.length);
|
|
|
var type = guess_resource_type(true_path);
|
|
|
@@ -558,8 +557,27 @@ public static Invercargill.DataStructures.Dictionary<Usm.ResourceRef, Usm.Manife
|
|
|
var manifest_file = new Usm.ManifestFile.from_string("as-expected");
|
|
|
provides[resource_ref] = manifest_file;
|
|
|
}
|
|
|
+ else if (info.get_file_type() == FileType.SYMBOLIC_LINK) {
|
|
|
+ var file = folder.get_child(info.get_name());
|
|
|
+ var true_path = file.get_path().substring(install_root.length);
|
|
|
+ var type = guess_resource_type(true_path);
|
|
|
+
|
|
|
+ var relative_path = get_relative_path_for_type(true_path, type.to_string());
|
|
|
+ // Remove leading slash from relative_path if present
|
|
|
+ if (relative_path.has_prefix("/")) {
|
|
|
+ relative_path = relative_path.substring(1);
|
|
|
+ }
|
|
|
+
|
|
|
+ // Create ResourceRef and ManifestFile
|
|
|
+ var resource_ref = new Usm.ResourceRef.with_type(type, relative_path);
|
|
|
+ var manifest_file = new Usm.ManifestFile() {
|
|
|
+ path_base = Usm.ManifestFilePathBase.AS_EXPECTED,
|
|
|
+ file_type = Usm.ManifestFileType.SYMBOLIC_LINK,
|
|
|
+ destination = info.get_symlink_target()
|
|
|
+ };
|
|
|
+ provides[resource_ref] = manifest_file;
|
|
|
+ }
|
|
|
else if (info.get_file_type() == FileType.DIRECTORY) {
|
|
|
- // Removing the folder recursively
|
|
|
var subfolder = folder.get_child(info.get_name());
|
|
|
var sub_provides = autoprovides_scan_tree(install_root, subfolder.get_path());
|
|
|
// Add all entries from subdirectory
|
|
|
@@ -648,7 +666,7 @@ private static Usm.ResourceType guess_resource_type(string path) {
|
|
|
|
|
|
// Library and Library resource have the same path. Try to have actual libraries get 'lib:' type, and all others 'libres:'
|
|
|
var basename = Path.get_basename(path);
|
|
|
- var is_library = basename.has_suffix(".so") || basename.has_suffix(".a") || basename.contains(".so.");
|
|
|
+ var is_library = basename.has_suffix(".so") || basename.contains(".so.") || basename.has_suffix(".a") || basename.has_suffix(".o");
|
|
|
if(!is_library && (type == Usm.ResourceType.LIBRARY || type == Usm.ResourceType.CANONICAL_LIBRARY)) {
|
|
|
continue;
|
|
|
}
|