Compare commits

...

7 Commits

Author SHA1 Message Date
Andrey Smirnov 04588d7566 Fix keyring in system test. 2014-03-12 18:57:21 +04:00
Andrey Smirnov 8153c7e2e9 Version bump to 0.4.1 2014-03-12 18:47:59 +04:00
Andrey Smirnov b3e92717bd Test for https://github.com/smira/aptly/issues/5 2014-03-12 18:46:36 +04:00
Andrey Smirnov d61a77d6e3 With list of components for Release file, do filepath.Base. 2014-03-12 18:37:38 +04:00
Andrey Smirnov 91da3b2046 Don't exit if returnCode is 0: otherwise panic is not reported. 2014-03-12 18:15:18 +04:00
Andrey Smirnov aade09e74e Shutdown progress bar in any case. 2014-03-12 18:13:01 +04:00
Andrey Smirnov 4dcfd74323 Version bump to 0.5~dev 2014-03-11 16:12:51 +04:00
8 changed files with 54 additions and 7 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
package aptly package aptly
// Version of aptly // Version of aptly
const Version = "0.4" const Version = "0.4.1"
// Enable debugging features? // Enable debugging features?
const EnableDebug = false const EnableDebug = false
+4
View File
@@ -12,6 +12,7 @@ import (
"log" "log"
"net/url" "net/url"
"os" "os"
"path"
"strconv" "strconv"
"strings" "strings"
"time" "time"
@@ -246,6 +247,9 @@ ok:
} }
components := strings.Split(stanza["Components"], " ") components := strings.Split(stanza["Components"], " ")
for i := range components {
components[i] = path.Base(components[i])
}
if len(repo.Components) == 0 { if len(repo.Components) == 0 {
repo.Components = components repo.Components = components
} else { } else {
+2 -4
View File
@@ -218,20 +218,18 @@ func DownloadTempWithChecksum(downloader aptly.Downloader, url string, expected
if expected.Size != -1 && downloader.GetProgress() != nil { if expected.Size != -1 && downloader.GetProgress() != nil {
downloader.GetProgress().InitBar(expected.Size, true) downloader.GetProgress().InitBar(expected.Size, true)
defer downloader.GetProgress().ShutdownBar()
} }
ch := make(chan error, 1) ch := make(chan error, 1)
downloader.DownloadWithChecksum(url, tempfile, ch, expected, ignoreMismatch) downloader.DownloadWithChecksum(url, tempfile, ch, expected, ignoreMismatch)
err = <-ch err = <-ch
if err != nil { if err != nil {
return nil, err return nil, err
} }
if expected.Size != -1 && downloader.GetProgress() != nil {
downloader.GetProgress().ShutdownBar()
}
file, err := os.Open(tempfile) file, err := os.Open(tempfile)
if err != nil { if err != nil {
return nil, err return nil, err
+2
View File
@@ -60,7 +60,9 @@ func main() {
if errorMessage != "" { if errorMessage != "" {
fmt.Print(errorMessage) fmt.Print(errorMessage)
} }
if returnCode != 0 {
os.Exit(returnCode) os.Exit(returnCode)
}
}() }()
command := cmd.RootCommand() command := cmd.RootCommand()
+1 -1
View File
@@ -1 +1 @@
aptly version: 0.4 aptly version: 0.4.1
@@ -0,0 +1,6 @@
Downloading http://security.debian.org/dists/wheezy/updates/InRelease...
gpgv: RSA key ID 46925553
gpgv: Good signature from "Debian Archive Automatic Signing Key (7.0/wheezy) <ftpmaster@debian.org>"
Mirror [mirror19]: http://security.debian.org/ wheezy/updates [src] successfully added.
You can run 'aptly mirror update mirror19' to download repository contents.
@@ -0,0 +1,20 @@
Name: mirror19
Archive Root URL: http://security.debian.org/
Distribution: wheezy/updates
Components: main
Architectures: i386
Download Sources: yes
Last update: never
Information from release file:
Architectures: amd64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc s390 s390x sparc
Codename: wheezy
Components: updates/main updates/contrib updates/non-free
Date: Tue, 11 Mar 2014 21:11:28 UTC
Description: Debian 7.0 Security Updates
Label: Debian-Security
Origin: Debian
Suite: stable
Valid-Until: Fri, 21 Mar 2014 21:11:28 UTC
Version: 7.0
+17
View File
@@ -207,3 +207,20 @@ class CreateMirror18Test(BaseTest):
def check(self): def check(self):
self.check_output() self.check_output()
self.check_cmd_output("aptly mirror show mirror18", "mirror_show") self.check_cmd_output("aptly mirror show mirror18", "mirror_show")
class CreateMirror19Test(BaseTest):
"""
create mirror: mirror with / in components
"""
fixtureGpg = True
outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using', '', s)
runCmd = "aptly -architectures='i386' mirror create -keyring=aptlytest.gpg -with-sources mirror19 http://security.debian.org/ wheezy/updates main"
def check(self):
def removeDates(s):
return re.sub(r"(Date|Valid-Until): [,0-9:+A-Za-z -]+\n", "", s)
self.check_output()
self.check_cmd_output("aptly mirror show mirror19", "mirror_show", match_prepare=removeDates)