Skip to content

Commit

Permalink
Fix pockets order
Browse files Browse the repository at this point in the history
  • Loading branch information
upils committed Oct 25, 2023
1 parent d725ead commit fa7cde3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions internal/imagedefinition/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The following specification defines what is supported in the YAML:
# archive-tasks, or tarball.
rootfs:
# Components are a list of apt sources, such as main,
# universe, and restricted. Defaults to "main".
# universe, and restricted. Defaults to "main,restricted".
components: (optional)
- <string>
- <string>
Expand Down Expand Up @@ -131,7 +131,7 @@ The following specification defines what is supported in the YAML:
# This is only supported for classic image building
customization: (optional)
# Components are a list of apt sources, such as main,
# universe, and restricted. Defaults to "main".
# universe, and restricted. Defaults to "main, restricted, universe".
# These are used in the resulting img, not to build it.
components: (optional)
- <string>
Expand Down
9 changes: 3 additions & 6 deletions internal/imagedefinition/image_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,7 @@ func (imageDef ImageDefinition) securityMirror() string {
}

func generatePocketList(series string, components []string, mirror string, securityMirror string, pocket string) []string {
baseList := fmt.Sprintf("deb %%s %s%%s %s\n",
series,
strings.Join(components, " "),
)
baseList := fmt.Sprintf("deb %%s %s%%s %s\n", series, strings.Join(components, " "))

releaseList := fmt.Sprintf(baseList, mirror, "")
securityList := fmt.Sprintf(baseList, securityMirror, "-security")
Expand All @@ -326,9 +323,9 @@ func generatePocketList(series string, components []string, mirror string, secur
case "security":
pocketList = append(pocketList, releaseList, securityList)
case "updates":
pocketList = append(pocketList, releaseList, updatesList, securityList)
pocketList = append(pocketList, releaseList, securityList, updatesList)
case "proposed":
pocketList = append(pocketList, releaseList, updatesList, securityList, proposedList)
pocketList = append(pocketList, releaseList, securityList, updatesList, proposedList)
}

return pocketList
Expand Down
2 changes: 1 addition & 1 deletion internal/statemachine/classic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3378,8 +3378,8 @@ func TestCreateChroot(t *testing.T) {
asserter.AssertErrNil(err, true)

pockets := []string{
fmt.Sprintf("%s-updates", stateMachine.ImageDef.Series),
fmt.Sprintf("%s-security", stateMachine.ImageDef.Series),
fmt.Sprintf("%s-updates", stateMachine.ImageDef.Series),
fmt.Sprintf("%s-proposed", stateMachine.ImageDef.Series),
}

Expand Down

0 comments on commit fa7cde3

Please sign in to comment.