Allow to add a new component to a published repo

This commit modifies the behavior of the publish switch method in the way, that also new components can be added to an already published repository. It is no longer necessary to drop and recreate the whole publish.

Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
This commit is contained in:
Christoph Fiehe
2024-09-20 13:58:12 +02:00
committed by André Roth
parent eaa363eb82
commit 4195ad90bc
5 changed files with 22 additions and 17 deletions

View File

@@ -1 +1,8 @@
ERROR: unable to switch: component c is not in published repository
Loading packages...
Generating metadata files and linking package files...
Finalizing metadata files...
Signing file 'Release' with gpg, please enter your passphrase when prompted:
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
Cleaning up prefix "." components a, c...
Publish for snapshot ./maverick [i386] publishes {a: [snap2]: Created as empty}, {b: [snap2]: Created as empty}, {c: [snap3]: Created as empty} has been successfully switched to new snapshot.

View File

@@ -424,15 +424,22 @@ class PublishSwitch11Test(BaseTest):
class PublishSwitch12Test(BaseTest):
"""
publish switch: wrong component names
publish switch: add new component to publish
"""
fixtureCmds = [
"aptly snapshot create snap1 empty",
"aptly snapshot create snap2 empty",
"aptly snapshot create snap3 empty",
"aptly publish snapshot -architectures=i386 -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick -component=a,b snap1 snap2",
]
runCmd = "aptly publish switch -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -component=a,c maverick snap2 snap1"
expectedCode = 1
runCmd = "aptly publish switch -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -component=a,c maverick snap2 snap3"
gold_processor = BaseTest.expand_environ
def check(self):
super(PublishSwitch12Test, self).check()
self.check_exists('public/dists/maverick/a/binary-i386/Packages')
self.check_exists('public/dists/maverick/c/binary-i386/Packages')
class PublishSwitch13Test(BaseTest):