diff --git a/deb/publish.go b/deb/publish.go index 9ff78bd6a..59d722aa8 100644 --- a/deb/publish.go +++ b/deb/publish.go @@ -78,6 +78,7 @@ func ParsePrefix(param string) (storage, prefix string) { } else { prefix = param } + prefix = strings.TrimPrefix(strings.TrimSuffix(prefix, "/"), "/") return } diff --git a/system/t06_publish/PublishDrop7Test_gold b/system/t06_publish/PublishDrop7Test_gold new file mode 100644 index 000000000..c3758e105 --- /dev/null +++ b/system/t06_publish/PublishDrop7Test_gold @@ -0,0 +1,4 @@ +Removing ${HOME}/.aptly/public/ppa/smira/dists... +Removing ${HOME}/.aptly/public/ppa/smira/pool... + +Published repository has been removed successfully. diff --git a/system/t06_publish/drop.py b/system/t06_publish/drop.py index 31e656c40..8660df10e 100644 --- a/system/t06_publish/drop.py +++ b/system/t06_publish/drop.py @@ -122,3 +122,24 @@ class PublishDrop6Test(BaseTest): """ runCmd = "aptly publish drop sq1" expectedCode = 1 + + +class PublishDrop7Test(BaseTest): + """ + publish drop: under prefix with trailing & leading slashes + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly snapshot create snap1 from mirror gnuplot-maverick", + "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 ppa/smira/", + ] + runCmd = "aptly publish drop maverick /ppa/smira/" + gold_processor = BaseTest.expand_environ + + def check(self): + super(PublishDrop7Test, self).check() + + self.check_not_exists('public/ppa/smira/dists/') + self.check_not_exists('public/ppa/smira/pool/') + self.check_exists('public/ppa/smira/')