Added option --skip-existing-packages to speed up mirror update.

This commit is contained in:
Clemens Rabe
2017-03-23 22:01:11 +01:00
8 changed files with 406 additions and 112 deletions
+4 -1
View File
@@ -81,8 +81,10 @@ func aptlyMirrorUpdate(cmd *commander.Command, args []string) error {
queue []deb.PackageDownloadTask
)
skip_existing_packages := context.Flags().Lookup("skip-existing-packages").Value.Get().(bool)
context.Progress().Printf("Building download queue...\n")
queue, downloadSize, err = repo.BuildDownloadQueue(context.PackagePool())
queue, downloadSize, err = repo.BuildDownloadQueue(context.PackagePool(), skip_existing_packages)
if err != nil {
return fmt.Errorf("unable to update: %s", err)
}
@@ -188,6 +190,7 @@ Example:
cmd.Flag.Bool("force", false, "force update mirror even if it is locked by another process")
cmd.Flag.Bool("ignore-checksums", false, "ignore checksum mismatches while downloading package files and metadata")
cmd.Flag.Bool("ignore-signatures", false, "disable verification of Release file signatures")
cmd.Flag.Bool("skip-existing-packages", false, "do not check file existance for packages listed in the internal database of the mirror")
cmd.Flag.Int64("download-limit", 0, "limit download speed (kbytes/sec)")
cmd.Flag.Int("max-tries", 1, "max download tries till process fails with download error")
cmd.Flag.Var(&keyRingsFlag{}, "keyring", "gpg keyring to use when verifying Release file (could be specified multiple times)")