Skip to content

Commit

Permalink
feat: 修复字段顺序变更导致索引更新失败问题TencentBlueKing#2725
Browse files Browse the repository at this point in the history
  • Loading branch information
zacYL authored Nov 1, 2024
1 parent 4f902ea commit a96e0fe
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class RpmLocalRepository(
rpmMetadata.packages[0].format.changeLogs
)
),
1L
packageNum = 1L
)
stopWatch.start("storeOthers")
storeIndexMarkFile(
Expand All @@ -256,7 +256,7 @@ class RpmLocalRepository(
rpmMetadata.packages[0].format.files
)
),
1L
packageNum = 1L
)
stopWatch.start("storeFilelists")
storeIndexMarkFile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ object RpmMetadataUtils {
)
)
),
1L
packageNum = 1L
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ class RpmMetadata(
@XStreamImplicit(itemFieldName = "package")
override val packages: List<RpmPackage>,
@XStreamAsAttribute
@XStreamAlias("packages")
override var packageNum: Long
) : RpmXmlMetadata(packages, packageNum) {
@XStreamAsAttribute
val xmlns: String = "http://linux.duke.edu/metadata/common"
val xmlns: String = "http://linux.duke.edu/metadata/common",
@XStreamAsAttribute
@XStreamAlias("xmlns:rpm")
val rpm: String = "http://linux.duke.edu/metadata/rpm"
val rpm: String = "http://linux.duke.edu/metadata/rpm",
@XStreamAsAttribute
@XStreamAlias("packages")
override var packageNum: Long,
) : RpmXmlMetadata(packages, packageNum) {

fun filterRpmFileLists() {
packages[0].format.files = packages[0].format.files.filter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ class RpmMetadataChangeLog(
@XStreamImplicit(itemFieldName = "package")
override val packages: List<RpmPackageChangeLog>,
@XStreamAsAttribute
val xmlns: String = "http://linux.duke.edu/metadata/other",
@XStreamAsAttribute
@XStreamAlias("packages")
override var packageNum: Long
) : RpmXmlMetadata(packages, packageNum) {
@XStreamAsAttribute
val xmlns: String = "http://linux.duke.edu/metadata/other"
}
) : RpmXmlMetadata(packages, packageNum)
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ class RpmMetadataFileList(
@XStreamImplicit(itemFieldName = "package")
override val packages: List<RpmPackageFileList>,
@XStreamAsAttribute
val xmlns: String = "http://linux.duke.edu/metadata/filelists",
@XStreamAsAttribute
@XStreamAlias("packages")
override var packageNum: Long
) : RpmXmlMetadata(packages, packageNum) {
@XStreamAsAttribute
val xmlns: String = "http://linux.duke.edu/metadata/filelists"
}
) : RpmXmlMetadata(packages, packageNum)

0 comments on commit a96e0fe

Please sign in to comment.