mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-13 15:52:01 +07:00
CPP-31989 IJI-971 checking executable permissions for .snap
GitOrigin-RevId: c3407564db904a7c915f72a0df8614d4f91723a0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
afe509dba1
commit
bfebcb4443
@@ -10,6 +10,7 @@ RUN apt-get update && \
|
||||
zip \
|
||||
unzip \
|
||||
libgl1-mesa-glx \
|
||||
squashfs-tools \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
# Maven cache to reuse
|
||||
VOLUME /root/.m2
|
||||
|
||||
@@ -27,9 +27,9 @@ fun moveFile(source: Path, target: Path) {
|
||||
Files.move(source, target)
|
||||
}
|
||||
|
||||
fun moveFileToDir(file: Path, targetDir: Path) {
|
||||
fun moveFileToDir(file: Path, targetDir: Path): Path {
|
||||
Files.createDirectories(targetDir)
|
||||
Files.move(file, targetDir.resolve(file.fileName))
|
||||
return Files.move(file, targetDir.resolve(file.fileName))
|
||||
}
|
||||
|
||||
fun copyFile(file: Path, target: Path) {
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.nio.file.Path
|
||||
import java.nio.file.StandardCopyOption
|
||||
import java.nio.file.attribute.PosixFilePermissions
|
||||
import kotlin.io.path.name
|
||||
import kotlin.io.path.nameWithoutExtension
|
||||
import kotlin.time.Duration.Companion.minutes
|
||||
|
||||
class LinuxDistributionBuilder(override val context: BuildContext,
|
||||
@@ -282,8 +283,9 @@ class LinuxDistributionBuilder(override val context: BuildContext,
|
||||
workingDir = snapDir,
|
||||
timeout = context.options.snapDockerBuildTimeoutMin.minutes,
|
||||
)
|
||||
moveFileToDir(resultDir.resolve(snapArtifact), context.paths.artifactDir)
|
||||
context.notifyArtifactBuilt(context.paths.artifactDir.resolve(snapArtifact))
|
||||
val snapArtifactPath = moveFileToDir(resultDir.resolve(snapArtifact), context.paths.artifactDir)
|
||||
context.notifyArtifactBuilt(snapArtifactPath)
|
||||
checkExecutablePermissions(unSquashSnap(snapArtifactPath), root = "", includeRuntime = true, arch = arch)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,6 +334,15 @@ class LinuxDistributionBuilder(override val context: BuildContext,
|
||||
|
||||
copyInspectScript(context, distBinDir)
|
||||
}
|
||||
|
||||
private suspend fun unSquashSnap(snap: Path): Path {
|
||||
val unSquashed = context.paths.tempDir.resolve("unSquashed-${snap.nameWithoutExtension}")
|
||||
NioFiles.deleteRecursively(unSquashed)
|
||||
Files.createDirectories(unSquashed)
|
||||
runProcess(listOf("unsquashfs", "$snap"), workingDir = unSquashed, inheritOut = true)
|
||||
return unSquashed.resolve("squashfs-root")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private const val NO_JBR_SUFFIX = "-no-jbr"
|
||||
|
||||
Reference in New Issue
Block a user