From afed3db7464e8c335e62d56321dd2cad0406ef1e Mon Sep 17 00:00:00 2001 From: carlyin Date: Tue, 29 Oct 2024 11:38:21 +0800 Subject: [PATCH] =?UTF-8?q?pref=EF=BC=9A=E7=A0=94=E5=8F=91=E5=95=86?= =?UTF-8?q?=E5=BA=97=E9=80=9A=E7=94=A8=E5=8C=96=E6=8E=A5=E5=8F=A3=E5=B0=81?= =?UTF-8?q?=E8=A3=85=E4=BC=98=E5=8C=96=20#11049?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ArchiveStorePkgServiceImpl.kt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/backend/ci/core/artifactory/biz-artifactory/src/main/kotlin/com/tencent/devops/artifactory/store/service/impl/ArchiveStorePkgServiceImpl.kt b/src/backend/ci/core/artifactory/biz-artifactory/src/main/kotlin/com/tencent/devops/artifactory/store/service/impl/ArchiveStorePkgServiceImpl.kt index 91d978cf5fc..8666512e8b2 100644 --- a/src/backend/ci/core/artifactory/biz-artifactory/src/main/kotlin/com/tencent/devops/artifactory/store/service/impl/ArchiveStorePkgServiceImpl.kt +++ b/src/backend/ci/core/artifactory/biz-artifactory/src/main/kotlin/com/tencent/devops/artifactory/store/service/impl/ArchiveStorePkgServiceImpl.kt @@ -138,15 +138,24 @@ abstract class ArchiveStorePkgServiceImpl : ArchiveStorePkgService { pkgLocalPath = disposition.fileName } val packageFile = File("$storeArchivePath/$pkgLocalPath") + val packageFileName = packageFile.name val packageFileInfo = PackageFileInfo( - packageFileName = packageFile.name, + packageFileName = packageFileName, packageFilePath = packageFile.absolutePath.removePrefix(getStoreArchiveBasePath()), packageFileSize = packageFile.length(), shaContent = packageFile.inputStream().use { ShaUtils.sha1InputStream(it) } ) - storePkgEnvInfo.pkgRepoPath = "$storeCode/$version/$pkgLocalPath" + val pkgRepoPathSb = StringBuilder("$storeCode/$version/") + if (!storePkgEnvInfo.osName.isNullOrBlank()) { + pkgRepoPathSb.append(storePkgEnvInfo.osName).append("/") + } + if (!storePkgEnvInfo.osArch.isNullOrBlank()) { + pkgRepoPathSb.append(storePkgEnvInfo.osArch).append("/") + } + pkgRepoPathSb.append(packageFileName) + storePkgEnvInfo.pkgRepoPath = pkgRepoPathSb.toString() storePkgEnvInfo.shaContent = packageFileInfo.shaContent - storePkgEnvInfo.pkgName = packageFileInfo.packageFileName + storePkgEnvInfo.pkgName = packageFileName packageFileInfos!!.add(packageFileInfo) } } finally {