protected Path buildPackage()

in src/main/java/org/apache/netbeans/nbpackage/deb/DebTask.java [93:107]


    protected Path buildPackage(Path image) throws Exception {
        String targetName = image.getFileName().toString() + ".deb";
        Path target = context().destination().resolve(targetName).toAbsolutePath();
        if (Files.exists(target)) {
            throw new FileAlreadyExistsException(target.toString());
        }
        int result = context().exec(FAKEROOT, DPKG_DEB, "--build",
                image.toAbsolutePath().toString(),
                target.toString());
        if (result != 0) {
            throw new Exception();
        } else {
            return target;
        }
    }