mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-12 03:21:33 +00:00
Merge pull request #613 from smira/607-trim-slashes
Trim slashes while parsing publish prefix
This commit is contained in:
@@ -78,6 +78,7 @@ func ParsePrefix(param string) (storage, prefix string) {
|
||||
} else {
|
||||
prefix = param
|
||||
}
|
||||
prefix = strings.TrimPrefix(strings.TrimSuffix(prefix, "/"), "/")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
4
system/t06_publish/PublishDrop7Test_gold
Normal file
4
system/t06_publish/PublishDrop7Test_gold
Normal file
@@ -0,0 +1,4 @@
|
||||
Removing ${HOME}/.aptly/public/ppa/smira/dists...
|
||||
Removing ${HOME}/.aptly/public/ppa/smira/pool...
|
||||
|
||||
Published repository has been removed successfully.
|
||||
@@ -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/')
|
||||
|
||||
Reference in New Issue
Block a user