When contents generation fails, don't bail out

This replaces `panic` which aborts aptly execution with warning
message on console. So aptly continues publishing actions, but
`Contents` indexes might be incomplete.

Error will be printed every time contents generation is triggered.
This commit is contained in:
Andrey Smirnov
2017-03-31 00:40:38 +03:00
parent e6bad637fd
commit 7a5be6736d
7 changed files with 48 additions and 12 deletions
+14
View File
@@ -0,0 +1,14 @@
Loading packages...
Generating metadata files and linking package files...
[!] Failed to generate package contents: unable to read .tar archive from ${HOME}/.aptly/pool/3a/0a/libboost-broken-program-options-dev_1.49.0.1_i386.deb: unexpected EOF
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:
Local repo local-repo has been successfully published.
Please setup your webserver to serve directory '${HOME}/.aptly/public' with autoindexing.
Now you can add following line to apt sources:
deb http://your-server/ maverick main
Don't forget to add your GPG key to apt with apt-key.
You can also use `aptly serve` to publish your repositories over HTTP quickly.
+12
View File
@@ -694,3 +694,15 @@ class PublishRepo28Test(BaseTest):
self.check_not_exists('public/dists/maverick/main/Contents-i386.gz')
self.check_exists('public/dists/maverick/main/debian-installer/binary-i386/Release')
self.check_not_exists('public/dists/maverick/main/Contents-udeb-i386.gz')
class PublishRepo29Test(BaseTest):
"""
publish repo: broken .deb file for contents
"""
fixtureCmds = [
"aptly repo create local-repo",
"aptly repo add local-repo ${testfiles}",
]
runCmd = "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick local-repo"
gold_processor = BaseTest.expand_environ