mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-09 06:04:12 +00:00
aptly exits with 2 on command/flag parse error. #52
This commit is contained in:
@@ -3,7 +3,7 @@ gom 'code.google.com/p/go.crypto/ssh/terminal', :commit => '7aa593ce8cea'
|
|||||||
gom 'code.google.com/p/gographviz', :commit => '212766062629'
|
gom 'code.google.com/p/gographviz', :commit => '212766062629'
|
||||||
gom 'code.google.com/p/snappy-go/snappy', :commit => '12e4b4183793'
|
gom 'code.google.com/p/snappy-go/snappy', :commit => '12e4b4183793'
|
||||||
gom 'github.com/cheggaaa/pb', :commit => '74be7a1388046f374ac36e93d46f5d56e856f827'
|
gom 'github.com/cheggaaa/pb', :commit => '74be7a1388046f374ac36e93d46f5d56e856f827'
|
||||||
gom 'github.com/smira/commander', :commit => '082a3ce267a8225a8ccf94deaf18901223d38fed'
|
gom 'github.com/smira/commander', :commit => 'f408b00e68d5d6e21b9f18bd310978dafc604e47'
|
||||||
gom 'github.com/smira/flag', :commit => '0d0aac2addb39050f45e92c5a6252926096dc841'
|
gom 'github.com/smira/flag', :commit => '0d0aac2addb39050f45e92c5a6252926096dc841'
|
||||||
gom 'github.com/mkrautz/goar', :commit => '36eb5f3452b1283a211fa35bc00c646fd0db5c4b'
|
gom 'github.com/mkrautz/goar', :commit => '36eb5f3452b1283a211fa35bc00c646fd0db5c4b'
|
||||||
gom 'github.com/syndtr/goleveldb/leveldb', :commit => 'ff3719c6816e2cd194f05058452d660608e178ac'
|
gom 'github.com/syndtr/goleveldb/leveldb', :commit => 'ff3719c6816e2cd194f05058452d660608e178ac'
|
||||||
|
|||||||
+6
-1
@@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/smira/aptly/files"
|
"github.com/smira/aptly/files"
|
||||||
"github.com/smira/aptly/http"
|
"github.com/smira/aptly/http"
|
||||||
"github.com/smira/aptly/utils"
|
"github.com/smira/aptly/utils"
|
||||||
|
"github.com/smira/commander"
|
||||||
"github.com/smira/flag"
|
"github.com/smira/flag"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@@ -48,7 +49,11 @@ type FatalError struct {
|
|||||||
|
|
||||||
// Fatal panics and aborts execution with exit code 1
|
// Fatal panics and aborts execution with exit code 1
|
||||||
func Fatal(err error) {
|
func Fatal(err error) {
|
||||||
panic(&FatalError{ReturnCode: 1, Message: err.Error()})
|
returnCode := 1
|
||||||
|
if err == commander.ErrFlagError || err == commander.ErrCommandError {
|
||||||
|
returnCode = 2
|
||||||
|
}
|
||||||
|
panic(&FatalError{ReturnCode: returnCode, Message: err.Error()})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Config loads and returns current configuration
|
// Config loads and returns current configuration
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ func aptlyDbCleanup(cmd *commander.Command, args []string) error {
|
|||||||
|
|
||||||
if len(args) != 0 {
|
if len(args) != 0 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
// collect information about references packages...
|
// collect information about references packages...
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ func aptlyDbRecover(cmd *commander.Command, args []string) error {
|
|||||||
|
|
||||||
if len(args) != 0 {
|
if len(args) != 0 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
context.Progress().Printf("Recovering database...\n")
|
context.Progress().Printf("Recovering database...\n")
|
||||||
|
|||||||
@@ -20,6 +20,11 @@ func graphvizEscape(s string) string {
|
|||||||
func aptlyGraph(cmd *commander.Command, args []string) error {
|
func aptlyGraph(cmd *commander.Command, args []string) error {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
|
if len(args) != 0 {
|
||||||
|
cmd.Usage()
|
||||||
|
return commander.ErrCommandError
|
||||||
|
}
|
||||||
|
|
||||||
graph := gographviz.NewGraph()
|
graph := gographviz.NewGraph()
|
||||||
graph.SetDir(true)
|
graph.SetDir(true)
|
||||||
graph.SetName("aptly")
|
graph.SetName("aptly")
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ func aptlyMirrorCreate(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if !(len(args) == 2 && strings.HasPrefix(args[1], "ppa:") || len(args) >= 3) {
|
if !(len(args) == 2 && strings.HasPrefix(args[1], "ppa:") || len(args) >= 3) {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadSources := context.Config().DownloadSourcePackages || context.flags.Lookup("with-sources").Value.Get().(bool)
|
downloadSources := context.Config().DownloadSourcePackages || context.flags.Lookup("with-sources").Value.Get().(bool)
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ func aptlyMirrorDrop(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
name := args[0]
|
name := args[0]
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ func aptlyMirrorList(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) != 0 {
|
if len(args) != 0 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
|
raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ func aptlyMirrorShow(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
name := args[0]
|
name := args[0]
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ func aptlyMirrorUpdate(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
name := args[0]
|
name := args[0]
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ func aptlyPublishDrop(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) < 1 || len(args) > 2 {
|
if len(args) < 1 || len(args) > 2 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
distribution := args[0]
|
distribution := args[0]
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ func aptlyPublishList(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) != 0 {
|
if len(args) != 0 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
|
raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ func aptlyPublishSnapshotOrRepo(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) < 1 || len(args) > 2 {
|
if len(args) < 1 || len(args) > 2 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
name := args[0]
|
name := args[0]
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ func aptlyPublishSwitch(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) < 2 || len(args) > 3 {
|
if len(args) < 2 || len(args) > 3 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
distribution := args[0]
|
distribution := args[0]
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ func aptlyPublishUpdate(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) < 1 || len(args) > 2 {
|
if len(args) < 1 || len(args) > 2 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
distribution := args[0]
|
distribution := args[0]
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ func aptlyRepoAdd(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) < 2 {
|
if len(args) < 2 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
name := args[0]
|
name := args[0]
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ func aptlyRepoCreate(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
repo := deb.NewLocalRepo(args[0], context.flags.Lookup("comment").Value.String())
|
repo := deb.NewLocalRepo(args[0], context.flags.Lookup("comment").Value.String())
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ func aptlyRepoDrop(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
name := args[0]
|
name := args[0]
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ func aptlyRepoEdit(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
repo, err := context.CollectionFactory().LocalRepoCollection().ByName(args[0])
|
repo, err := context.CollectionFactory().LocalRepoCollection().ByName(args[0])
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ func aptlyRepoList(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) != 0 {
|
if len(args) != 0 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
|
raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ func aptlyRepoMoveCopyImport(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) < 3 {
|
if len(args) < 3 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
command := cmd.Name()
|
command := cmd.Name()
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ func aptlyRepoRemove(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) < 2 {
|
if len(args) < 2 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
name := args[0]
|
name := args[0]
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ func aptlyRepoShow(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
name := args[0]
|
name := args[0]
|
||||||
|
|||||||
@@ -15,6 +15,11 @@ import (
|
|||||||
func aptlyServe(cmd *commander.Command, args []string) error {
|
func aptlyServe(cmd *commander.Command, args []string) error {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
|
if len(args) != 0 {
|
||||||
|
cmd.Usage()
|
||||||
|
return commander.ErrCommandError
|
||||||
|
}
|
||||||
|
|
||||||
if context.CollectionFactory().PublishedRepoCollection().Len() == 0 {
|
if context.CollectionFactory().PublishedRepoCollection().Len() == 0 {
|
||||||
fmt.Printf("No published repositories, unable to serve.\n")
|
fmt.Printf("No published repositories, unable to serve.\n")
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ func aptlySnapshotCreate(cmd *commander.Command, args []string) error {
|
|||||||
snapshot = deb.NewSnapshotFromPackageList(snapshotName, nil, packageList, "Created as empty")
|
snapshot = deb.NewSnapshotFromPackageList(snapshotName, nil, packageList, "Created as empty")
|
||||||
} else {
|
} else {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
err = context.CollectionFactory().SnapshotCollection().Add(snapshot)
|
err = context.CollectionFactory().SnapshotCollection().Add(snapshot)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ func aptlySnapshotDiff(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) != 2 {
|
if len(args) != 2 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
onlyMatching := context.flags.Lookup("only-matching").Value.Get().(bool)
|
onlyMatching := context.flags.Lookup("only-matching").Value.Get().(bool)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ func aptlySnapshotDrop(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
name := args[0]
|
name := args[0]
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ func aptlySnapshotList(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) != 0 {
|
if len(args) != 0 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
|
raw := cmd.Flag.Lookup("raw").Value.Get().(bool)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ func aptlySnapshotMerge(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) < 2 {
|
if len(args) < 2 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
sources := make([]*deb.Snapshot, len(args)-1)
|
sources := make([]*deb.Snapshot, len(args)-1)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ func aptlySnapshotPull(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) < 4 {
|
if len(args) < 4 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
noDeps := context.flags.Lookup("no-deps").Value.Get().(bool)
|
noDeps := context.flags.Lookup("no-deps").Value.Get().(bool)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ func aptlySnapshotShow(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
name := args[0]
|
name := args[0]
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ func aptlySnapshotVerify(cmd *commander.Command, args []string) error {
|
|||||||
var err error
|
var err error
|
||||||
if len(args) < 1 {
|
if len(args) < 1 {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
return err
|
return commander.ErrCommandError
|
||||||
}
|
}
|
||||||
|
|
||||||
snapshots := make([]*deb.Snapshot, len(args))
|
snapshots := make([]*deb.Snapshot, len(args))
|
||||||
|
|||||||
@@ -7,6 +7,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func aptlyVersion(cmd *commander.Command, args []string) error {
|
func aptlyVersion(cmd *commander.Command, args []string) error {
|
||||||
|
if len(args) != 0 {
|
||||||
|
cmd.Usage()
|
||||||
|
return commander.ErrCommandError
|
||||||
|
}
|
||||||
|
|
||||||
fmt.Printf("aptly version: %s\n", aptly.Version)
|
fmt.Printf("aptly version: %s\n", aptly.Version)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-1
@@ -979,7 +979,19 @@ $ aptly graph
|
|||||||
If environment variable \fBHTTP_PROXY\fR is set \fBaptly\fR would use its value to proxy all HTTP requests\.
|
If environment variable \fBHTTP_PROXY\fR is set \fBaptly\fR would use its value to proxy all HTTP requests\.
|
||||||
.
|
.
|
||||||
.SH "RETURN VALUES"
|
.SH "RETURN VALUES"
|
||||||
\fBaptly\fR exists with 0 on success and with 1 on failure\.
|
\fBaptly\fR exists with:
|
||||||
|
.
|
||||||
|
.TP
|
||||||
|
0
|
||||||
|
success
|
||||||
|
.
|
||||||
|
.TP
|
||||||
|
1
|
||||||
|
general failure
|
||||||
|
.
|
||||||
|
.TP
|
||||||
|
2
|
||||||
|
command parse failure
|
||||||
.
|
.
|
||||||
.SH "AUTHORS"
|
.SH "AUTHORS"
|
||||||
Andrey Smirnov (me@smira\.ru)
|
Andrey Smirnov (me@smira\.ru)
|
||||||
|
|||||||
+10
-1
@@ -139,7 +139,16 @@ to proxy all HTTP requests.
|
|||||||
|
|
||||||
## RETURN VALUES
|
## RETURN VALUES
|
||||||
|
|
||||||
`aptly` exists with 0 on success and with 1 on failure.
|
`aptly` exists with:
|
||||||
|
|
||||||
|
* 0:
|
||||||
|
success
|
||||||
|
|
||||||
|
* 1:
|
||||||
|
general failure
|
||||||
|
|
||||||
|
* 2:
|
||||||
|
command parse failure
|
||||||
|
|
||||||
## AUTHORS
|
## AUTHORS
|
||||||
|
|
||||||
|
|||||||
@@ -21,3 +21,4 @@ Options:
|
|||||||
-dep-follow-recommends=false: when processing dependencies, follow Recommends
|
-dep-follow-recommends=false: when processing dependencies, follow Recommends
|
||||||
-dep-follow-source=false: when processing dependencies, follow from binary to Source packages
|
-dep-follow-source=false: when processing dependencies, follow from binary to Source packages
|
||||||
-dep-follow-suggests=false: when processing dependencies, follow Suggests
|
-dep-follow-suggests=false: when processing dependencies, follow Suggests
|
||||||
|
ERROR: unable to parse command
|
||||||
|
|||||||
@@ -13,3 +13,4 @@ Options:
|
|||||||
-ignore-signatures=false: disable verification of Release file signatures
|
-ignore-signatures=false: disable verification of Release file signatures
|
||||||
-keyring=: gpg keyring to use when verifying Release file (could be specified multiple times)
|
-keyring=: gpg keyring to use when verifying Release file (could be specified multiple times)
|
||||||
-with-sources=false: download source packages in addition to binary packages
|
-with-sources=false: download source packages in addition to binary packages
|
||||||
|
ERROR: unable to parse command
|
||||||
|
|||||||
@@ -18,3 +18,4 @@ Options:
|
|||||||
-dep-follow-recommends=false: when processing dependencies, follow Recommends
|
-dep-follow-recommends=false: when processing dependencies, follow Recommends
|
||||||
-dep-follow-source=false: when processing dependencies, follow from binary to Source packages
|
-dep-follow-source=false: when processing dependencies, follow from binary to Source packages
|
||||||
-dep-follow-suggests=false: when processing dependencies, follow Suggests
|
-dep-follow-suggests=false: when processing dependencies, follow Suggests
|
||||||
|
ERROR: unable to parse command
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
flag provided but not defined: -fxz
|
||||||
|
Usage: aptly mirror create <name> <archive url> <distribution> [<component1> ...]
|
||||||
|
|
||||||
|
aptly mirror create - create new mirror
|
||||||
|
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-architectures="": list of architectures to consider during (comma-separated), default to all available
|
||||||
|
-config="": location of configuration file (default locations are /etc/aptly.conf, ~/.aptly.conf)
|
||||||
|
-dep-follow-all-variants=false: when processing dependencies, follow a & b if depdency is 'a|b'
|
||||||
|
-dep-follow-recommends=false: when processing dependencies, follow Recommends
|
||||||
|
-dep-follow-source=false: when processing dependencies, follow from binary to Source packages
|
||||||
|
-dep-follow-suggests=false: when processing dependencies, follow Suggests
|
||||||
|
-ignore-signatures=false: disable verification of Release file signatures
|
||||||
|
-keyring=: gpg keyring to use when verifying Release file (could be specified multiple times)
|
||||||
|
-with-sources=false: download source packages in addition to binary packages
|
||||||
|
ERROR: unable to parse flags
|
||||||
@@ -10,6 +10,7 @@ class MainTest(BaseTest):
|
|||||||
"""
|
"""
|
||||||
main
|
main
|
||||||
"""
|
"""
|
||||||
|
expectedCode = 2
|
||||||
runCmd = "aptly"
|
runCmd = "aptly"
|
||||||
|
|
||||||
outputMatchPrepare = lambda _, s: re.sub(r' -(cpuprofile|memprofile|memstats|meminterval)=.*\n', '', s, flags=re.MULTILINE)
|
outputMatchPrepare = lambda _, s: re.sub(r' -(cpuprofile|memprofile|memstats|meminterval)=.*\n', '', s, flags=re.MULTILINE)
|
||||||
@@ -19,6 +20,7 @@ class MirrorTest(BaseTest):
|
|||||||
"""
|
"""
|
||||||
main
|
main
|
||||||
"""
|
"""
|
||||||
|
expectedCode = 2
|
||||||
runCmd = "aptly mirror"
|
runCmd = "aptly mirror"
|
||||||
|
|
||||||
|
|
||||||
@@ -26,6 +28,7 @@ class MirrorCreateTest(BaseTest):
|
|||||||
"""
|
"""
|
||||||
main
|
main
|
||||||
"""
|
"""
|
||||||
|
expectedCode = 2
|
||||||
runCmd = "aptly mirror create"
|
runCmd = "aptly mirror create"
|
||||||
|
|
||||||
|
|
||||||
@@ -50,3 +53,11 @@ class MirrorCreateHelpTest(BaseTest):
|
|||||||
main
|
main
|
||||||
"""
|
"""
|
||||||
runCmd = "aptly help mirror create"
|
runCmd = "aptly help mirror create"
|
||||||
|
|
||||||
|
|
||||||
|
class WrongFlagTest(BaseTest):
|
||||||
|
"""
|
||||||
|
main
|
||||||
|
"""
|
||||||
|
expectedCode = 2
|
||||||
|
runCmd = "aptly mirror create -fxz=sss"
|
||||||
|
|||||||
Reference in New Issue
Block a user