Skip to content

Commit

Permalink
Merge pull request #613 from smira/607-trim-slashes
Browse files Browse the repository at this point in the history
Trim slashes while parsing publish prefix
  • Loading branch information
smira committed Aug 9, 2017
2 parents e70ef0a + 84ef963 commit 587bfd7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions deb/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func ParsePrefix(param string) (storage, prefix string) {
} else {
prefix = param
}
prefix = strings.TrimPrefix(strings.TrimSuffix(prefix, "/"), "/")
return
}

Expand Down
4 changes: 4 additions & 0 deletions system/t06_publish/PublishDrop7Test_gold
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Removing ${HOME}/.aptly/public/ppa/smira/dists...
Removing ${HOME}/.aptly/public/ppa/smira/pool...

Published repository has been removed successfully.
21 changes: 21 additions & 0 deletions system/t06_publish/drop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/')

0 comments on commit 587bfd7

Please sign in to comment.