소스 검색

Remove "Alternative Format" resources

Billy Barrow 1 개월 전
부모
커밋
11da0ff478
4개의 변경된 파일4개의 추가작업 그리고 63개의 파일을 삭제
  1. 2 17
      src/cli/Manifest.vala
  2. 2 9
      src/lib/Manifest.vala
  3. 0 3
      src/lib/Paths.vala
  4. 0 34
      src/lib/ResourceRef.vala

+ 2 - 17
src/cli/Manifest.vala

@@ -464,7 +464,8 @@ private int autoprovides() {
         manifest.run_install(build_path, install_dir.get_path(), paths, Usm.InstallType.FRESH, install_flags).wait_check();
     }
     catch(Error e) {
-        printerr(@"Error running install exec: $(e.message)\n");
+        printerr(@"Error running install exec: $(e.message)\n"
+);
         return 249;
     }
 
@@ -586,22 +587,6 @@ public static Invercargill.DataStructures.Dictionary<Usm.ResourceRef, Usm.Manife
             }
         }
     }
-
-    // If we have any cananocal resources, check to make sure they aren't actually alternative
-    var canon_resources = provides.keys.where(p => p.resource_type == Usm.ResourceType.CANONICAL_LIBRARY || p.resource_type == Usm.ResourceType.CANONICAL_LIBRARY_RESOURCE).to_series();
-    foreach (var canon_resource in canon_resources) {
-        var canon_type = canon_resource.resource_type;
-        var regular_type = canon_type == Usm.ResourceType.CANONICAL_LIBRARY ? Usm.ResourceType.LIBRARY : Usm.ResourceType.LIBRARY_RESOURCE;
-        var alternative_type = canon_type == Usm.ResourceType.CANONICAL_LIBRARY ? Usm.ResourceType.ALTERNATIVE_FORMAT_LIBRARY : Usm.ResourceType.ALTERNATIVE_FORMAT_LIBRARY_RESOURCE;
-        Usm.ManifestFile? regular_file;
-        // Is there a regular counterpart?
-        if(provides.try_get(new Usm.ResourceRef.with_type(regular_type, canon_resource.resource), out regular_file)) {
-            // Convert from canonical resource to alternative resource
-            Usm.ManifestFile canon_file;
-            provides.remove(canon_resource, out canon_file);
-            provides[new Usm.ResourceRef.with_type(alternative_type, canon_resource.resource)] = canon_file;
-        }
-    }
     
     return provides;
 }

+ 2 - 9
src/lib/Manifest.vala

@@ -372,13 +372,6 @@ namespace Usm {
                 callback(resource.key, resources_installed, resource_count, 0.0f);
                 var path = paths.get_suggested_path_for_resource(resource.key);
                 
-                // Check if this is an ALTERNATIVE_FORMAT resource type that should be optional
-                var is_alternative_format_resource = resource.key.resource_type == ResourceType.ALTERNATIVE_FORMAT_LIBRARY || resource.key.resource_type == ResourceType.ALTERNATIVE_FORMAT_LIBRARY_RESOURCE;
-                var alternative_format_resource_path_conflicts = false;
-                if(is_alternative_format_resource){
-                    alternative_format_resource_path_conflicts = provides.any(r => r != resource && path == paths.get_suggested_path_for_resource(r.key));
-                } 
-                
                 if(resource.key.resource_type == ResourceType.TAG) {
                     // Ensure parent directories are created first
                     var parent_dir = File.new_for_path(Path.get_basename(path));
@@ -416,12 +409,12 @@ namespace Usm {
 
                     // Don't throw if an alternative format resource wasn't built
                     var source_exists = src.query_exists();
-                    if(!source_exists && !is_alternative_format_resource) {
+                    if(!source_exists) {
                         throw new ManifestError.INVALID_FILE_PATH(@"Expected to find file listed in manifest at \"$(src.get_path())\", but no such file was found.");
                     }
                     
                     // Don't copy an alternative format resource if it has the same path as the non-alternative resource
-                    if(source_exists && !dry_run && (!is_alternative_format_resource  || !alternative_format_resource_path_conflicts)) {
+                    if(source_exists && !dry_run) {
                         if(dest.query_exists()) {
                             dest.delete();
                         }

+ 0 - 3
src/lib/Paths.vala

@@ -71,9 +71,6 @@ namespace Usm {
                     return Path.build_filename(destination, prefix, lib);
                 case Usm.ResourceType.LIBRARY_EXECUTABLE:
                     return Path.build_filename(destination, prefix, libexec);
-                case Usm.ResourceType.ALTERNATIVE_FORMAT_LIBRARY:
-                case Usm.ResourceType.ALTERNATIVE_FORMAT_LIBRARY_RESOURCE:
-                    return Path.build_filename(destination, prefix, altlib);
                 case Usm.ResourceType.CANONICAL_LIBRARY:
                 case Usm.ResourceType.CANONICAL_LIBRARY_RESOURCE:
                     return Path.build_filename(destination, prefix, canonlib);

+ 0 - 34
src/lib/ResourceRef.vala

@@ -13,8 +13,6 @@ namespace Usm {
         LIBRARY,
         LIBRARY_RESOURCE,
         LIBRARY_EXECUTABLE,
-        ALTERNATIVE_FORMAT_LIBRARY,
-        ALTERNATIVE_FORMAT_LIBRARY_RESOURCE,
         CANONICAL_LIBRARY,
         CANONICAL_LIBRARY_RESOURCE,
         INFO_PAGE,
@@ -50,10 +48,6 @@ namespace Usm {
                     return "libexec";
                 case ResourceType.LIBRARY_RESOURCE:
                     return "libres";
-                case ResourceType.ALTERNATIVE_FORMAT_LIBRARY:
-                    return "altlib";
-                case ResourceType.ALTERNATIVE_FORMAT_LIBRARY_RESOURCE:
-                    return "altlibres";
                 case ResourceType.CANONICAL_LIBRARY:
                     return "canonlib";
                 case ResourceType.CANONICAL_LIBRARY_RESOURCE:
@@ -105,10 +99,6 @@ namespace Usm {
                     return ResourceType.LIBRARY_EXECUTABLE;
                 case "libres":
                     return ResourceType.LIBRARY_RESOURCE;
-                case "altlib":
-                    return ResourceType.ALTERNATIVE_FORMAT_LIBRARY;
-                case "altlibres":
-                    return ResourceType.ALTERNATIVE_FORMAT_LIBRARY_RESOURCE;
                 case "canonlib":
                     return ResourceType.CANONICAL_LIBRARY;
                 case "canonlibres":
@@ -150,8 +140,6 @@ namespace Usm {
                 LIBRARY,
                 LIBRARY_EXECUTABLE,
                 LIBRARY_RESOURCE,
-                ALTERNATIVE_FORMAT_LIBRARY,
-                ALTERNATIVE_FORMAT_LIBRARY_RESOURCE,
                 CANONICAL_LIBRARY,
                 CANONICAL_LIBRARY_RESOURCE,
                 INFO_PAGE,
@@ -234,10 +222,6 @@ namespace Usm {
                     return check_libexec();
                 case ResourceType.LIBRARY_RESOURCE:
                     return check_libres();
-                case ResourceType.ALTERNATIVE_FORMAT_LIBRARY:
-                    return check_altlib();
-                case ResourceType.ALTERNATIVE_FORMAT_LIBRARY_RESOURCE:
-                    return check_altlibres();
                 case ResourceType.CANONICAL_LIBRARY:
                     return check_canonlib();
                 case ResourceType.CANONICAL_LIBRARY_RESOURCE:
@@ -314,15 +298,6 @@ namespace Usm {
             return false;
         }
 
-        private bool check_altlib() {
-            // XXX: need a more robust test for this as not all 64bit archetctures have alternative formats
-            if(sizeof(void*) == 8) {
-                return check_canonlib();
-            }
-            // Return false on 32 bit systems that won't have alternative formats
-            return false;
-        }
-
         private bool check_bin() {
             var paths = Environment.get_variable("PATH").split(":");
             foreach (var path in paths) {
@@ -381,15 +356,6 @@ namespace Usm {
             return false;
         }
 
-        private bool check_altlibres() {
-            // XXX: need a more robust test for this as not all 64bit archetctures have alternative formats
-            if(sizeof(void*) == 8) {
-                return check_canonlibres();
-            }
-            // Return false on 32 bit systems that won't have alternative formats
-            return false;
-        }
-
         private bool check_app() {
             var file = File.new_build_filename("/usr/share/applications", resource);
             return file.query_exists();