Skip to content

Commit

Permalink
pref:研发商店通用化接口封装优化 TencentBlueKing#11049
Browse files Browse the repository at this point in the history
  • Loading branch information
carlyin0801 committed Oct 29, 2024
1 parent d52c48e commit afed3db
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit afed3db

Please sign in to comment.