src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java
branchJDK-8200758-branch
changeset 58791 fca9cb5f4953
parent 58762 0fe62353385b
equal deleted inserted replaced
58764:015949faea55 58791:fca9cb5f4953
   255             }
   255             }
   256             return otherPackages.stream();
   256             return otherPackages.stream();
   257         });
   257         });
   258     }
   258     }
   259 
   259 
       
   260     @Override
       
   261     protected List<ConfigException> verifyOutputBundle(
       
   262             Map<String, ? super Object> params, Path packageBundle) {
       
   263         List<ConfigException> errors = new ArrayList<>();
       
   264 
       
   265         String controlFileName = "control";
       
   266 
       
   267         List<PackageProperty> properties = List.of(
       
   268                 new PackageProperty("Package", PACKAGE_NAME.fetchFrom(params),
       
   269                         "APPLICATION_PACKAGE", controlFileName),
       
   270                 new PackageProperty("Version", String.format("%s-%s",
       
   271                         VERSION.fetchFrom(params), RELEASE.fetchFrom(params)),
       
   272                         "APPLICATION_VERSION-APPLICATION_RELEASE",
       
   273                         controlFileName),
       
   274                 new PackageProperty("Architecture", DEB_ARCH, "APPLICATION_ARCH",
       
   275                         controlFileName));
       
   276 
       
   277         List<String> cmdline = new ArrayList<>(List.of(TOOL_DPKG_DEB, "-f",
       
   278                 packageBundle.toString()));
       
   279         properties.forEach(property -> cmdline.add(property.name));
       
   280         try {
       
   281             Map<String, String> actualValues = Executor.of(cmdline.toArray(String[]::new))
       
   282                     .saveOutput(true)
       
   283                     .executeExpectSuccess()
       
   284                     .getOutput().stream()
       
   285                             .map(line -> line.split(":\\s+", 2))
       
   286                             .collect(Collectors.toMap(
       
   287                                     components -> components[0],
       
   288                                     components -> components[1]));
       
   289             properties.forEach(property -> errors.add(property.verifyValue(
       
   290                     actualValues.get(property.name))));
       
   291         } catch (IOException ex) {
       
   292             // Ignore error as it is not critical. Just report it.
       
   293             Log.verbose(ex);
       
   294         }
       
   295 
       
   296         return errors;
       
   297     }
       
   298 
   260     /*
   299     /*
   261      * set permissions with a string like "rwxr-xr-x"
   300      * set permissions with a string like "rwxr-xr-x"
   262      *
   301      *
   263      * This cannot be directly backport to 22u which is built with 1.6
   302      * This cannot be directly backport to 22u which is built with 1.6
   264      */
   303      */