Skip to content

Commit 587bfd7

Browse files
authored
Merge pull request #613 from smira/607-trim-slashes
Trim slashes while parsing publish prefix
2 parents e70ef0a + 84ef963 commit 587bfd7

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

deb/publish.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ func ParsePrefix(param string) (storage, prefix string) {
7878
} else {
7979
prefix = param
8080
}
81+
prefix = strings.TrimPrefix(strings.TrimSuffix(prefix, "/"), "/")
8182
return
8283
}
8384

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Removing ${HOME}/.aptly/public/ppa/smira/dists...
2+
Removing ${HOME}/.aptly/public/ppa/smira/pool...
3+
4+
Published repository has been removed successfully.

system/t06_publish/drop.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,24 @@ class PublishDrop6Test(BaseTest):
122122
"""
123123
runCmd = "aptly publish drop sq1"
124124
expectedCode = 1
125+
126+
127+
class PublishDrop7Test(BaseTest):
128+
"""
129+
publish drop: under prefix with trailing & leading slashes
130+
"""
131+
fixtureDB = True
132+
fixturePool = True
133+
fixtureCmds = [
134+
"aptly snapshot create snap1 from mirror gnuplot-maverick",
135+
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 ppa/smira/",
136+
]
137+
runCmd = "aptly publish drop maverick /ppa/smira/"
138+
gold_processor = BaseTest.expand_environ
139+
140+
def check(self):
141+
super(PublishDrop7Test, self).check()
142+
143+
self.check_not_exists('public/ppa/smira/dists/')
144+
self.check_not_exists('public/ppa/smira/pool/')
145+
self.check_exists('public/ppa/smira/')

0 commit comments

Comments
 (0)