diff --git a/AUTHORS b/AUTHORS index 2a42fb9a..114fe886 100644 --- a/AUTHORS +++ b/AUTHORS @@ -64,3 +64,4 @@ List of contributors, in chronological order: * Golf Hu (https://github.com/hudeng-go) * Cookie Fei (https://github.com/wuhuang26) * Andrey Loukhnov (https://github.com/aol-nnov) +* Christoph Fiehe (https://github.com/cfiehe) diff --git a/api/publish.go b/api/publish.go index e51ceaba..2d71f539 100644 --- a/api/publish.go +++ b/api/publish.go @@ -30,9 +30,9 @@ type signingParams struct { type sourceParams struct { // Name of the component - Component string `binding:"required" json:"Component" example:"contrib"` + Component string `binding:"required" json:"Component"` // Name of the local repository/snapshot - Name string `binding:"required" json:"Name" example:"snap1"` + Name string `binding:"required" json:"Name"` } func getSigner(options *signingParams) (pgp.Signer, error) { @@ -77,7 +77,7 @@ func apiPublishList(c *gin.Context) { collectionFactory := context.NewCollectionFactory() collection := collectionFactory.PublishedRepoCollection() - result := make([]*deb.PublishedRepo, 0, collection.Len()) + repos := make([]*deb.PublishedRepo, 0, collection.Len()) err := collection.ForEach(func(repo *deb.PublishedRepo) error { err := collection.LoadShallow(repo, collectionFactory) @@ -85,7 +85,7 @@ func apiPublishList(c *gin.Context) { return err } - result = append(result, repo) + repos = append(repos, repo) return nil }) @@ -95,17 +95,16 @@ func apiPublishList(c *gin.Context) { return } - c.JSON(http.StatusOK, result) + c.JSON(http.StatusOK, repos) } // @Summary Show published repository -// @Description **Get published repository by name** +// @Description **Get details of a published repository** // @Tags Publish -// @Consume json // @Produce json // @Param prefix path string true "publishing prefix, use `:.` instead of `.` because it is ambigious in URLs" // @Param distribution path string true "distribution name" -// @Success 200 {object} deb.RemoteRepo +// @Success 200 {object} deb.PublishedRepo // @Failure 404 {object} Error "Published repository not found" // @Failure 500 {object} Error "Internal Error" // @Router /api/publish/{prefix}/{distribution} [get] @@ -165,14 +164,15 @@ type publishedRepoCreateParams struct { } // @Summary Create published repository -// @Description Publish local repository or snapshot under specified prefix. Storage might be passed in prefix as well, e.g. `s3:packages/`. -// @Description To supply empty prefix, just remove last part (`POST /api/publish`). +// @Description **Publish local repository or snapshot under specified prefix** +// @Description +// @Description Storage might be passed in prefix as well, e.g. `s3:packages/`. To supply empty prefix, just remove last part (`POST /api/publish`). // @Tags Publish // @Param prefix path string true "publishing prefix" // @Consume json // @Param request body publishedRepoCreateParams true "Parameters" // @Produce json -// @Success 200 {object} deb.RemoteRepo +// @Success 200 {object} deb.PublishedRepo // @Failure 400 {object} Error "Bad Request" // @Failure 404 {object} Error "Source not found" // @Failure 500 {object} Error "Internal Error" @@ -337,14 +337,40 @@ func apiPublishRepoOrSnapshot(c *gin.Context) { }) } +type publishedRepoUpdateSwitchParams struct { + // when publishing, overwrite files in pool/ directory without notice + ForceOverwrite bool ` json:"ForceOverwrite"` + // GPG options + Signing signingParams ` json:"Signing"` + // Don't generate contents indexes + SkipContents *bool ` json:"SkipContents"` + // Skip bz2 compression for index files + SkipBz2 *bool ` json:"SkipBz2"` + // Don't remove unreferenced files in prefix/component + SkipCleanup *bool ` json:"SkipCleanup"` + // only when updating published snapshots, list of objects 'Component/Name' + Snapshots []sourceParams `binding:"required" json:"Snapshots"` + // Provide index files by hash + AcquireByHash *bool ` json:"AcquireByHash"` + // Enable multiple packages with the same filename in different distributions + MultiDist *bool ` json:"MultiDist"` +} + // @Summary Update published repository -// @Description Update a published repository. +// @Description **Update a published local repository or switch published snapshot** +// @Description +// @Description API action depends on published repository contents: +// @Description * if local repository has been published, published repository would be updated to match local repository contents +// @Description * if snapshots have been been published, it is possible to switch each component to new snapshot // @Tags Publish // @Accept json // @Produce json // @Param prefix path string true "publishing prefix" // @Param distribution path string true "distribution name" -// @Success 200 {object} deb.RemoteRepo +// @Consume json +// @Param request body publishedRepoUpdateSwitchParams true "Parameters" +// @Produce json +// @Success 200 {object} deb.PublishedRepo // @Failure 400 {object} Error "Bad Request" // @Failure 404 {object} Error "Published repository or source not found" // @Failure 500 {object} Error "Internal Error" @@ -354,20 +380,7 @@ func apiPublishUpdateSwitch(c *gin.Context) { storage, prefix := deb.ParsePrefix(param) distribution := slashEscape(c.Params.ByName("distribution")) - var b struct { - ForceOverwrite bool - Signing signingParams - SkipContents *bool - SkipBz2 *bool - SkipCleanup *bool - Snapshots []struct { - Component string `binding:"required"` - Name string `binding:"required"` - } - AcquireByHash *bool - MultiDist *bool - } - + var b publishedRepoUpdateSwitchParams if c.Bind(&b) != nil { return } @@ -393,7 +406,7 @@ func apiPublishUpdateSwitch(c *gin.Context) { if published.SourceKind == deb.SourceLocalRepo { if len(b.Snapshots) > 0 { - AbortWithJSONError(c, 400, fmt.Errorf("snapshots shouldn't be given when updating local repo")) + AbortWithJSONError(c, http.StatusBadRequest, fmt.Errorf("snapshots shouldn't be given when updating local repo")) return } updatedComponents = published.Components() @@ -483,8 +496,9 @@ func apiPublishUpdateSwitch(c *gin.Context) { } if b.SkipCleanup == nil || !*b.SkipCleanup { - err = collection.CleanupPrefixComponentFiles(context, published, result.AddedComponents(), result.UpdatedComponents(), result.RemovedComponents(), - collectionFactory, out) + cleanComponents := make([]string, 0, len(result.UpdatedSources)+len(result.RemovedSources)) + cleanComponents = append(append(cleanComponents, result.UpdatedComponents()...), result.RemovedComponents()...) + err = collection.CleanupPrefixComponentFiles(context, published, cleanComponents, collectionFactory, out) if err != nil { return &task.ProcessReturnValue{Code: http.StatusInternalServerError, Value: nil}, fmt.Errorf("unable to update: %s", err) } @@ -495,7 +509,9 @@ func apiPublishUpdateSwitch(c *gin.Context) { } // @Summary Delete published repository -// @Description Delete a published repository. +// @Description **Delete a published repository** +// @Description +// @Description Delete published repository, clean up files in published directory. // @Tags Publish // @Accept json // @Produce json @@ -503,7 +519,7 @@ func apiPublishUpdateSwitch(c *gin.Context) { // @Param distribution path string true "distribution name" // @Param force query int true "force: 1 to enable" // @Param skipCleanup query int true "skipCleanup: 1 to enable" -// @Success 200 {object} task.ProcessReturnValue +// @Success 200 // @Failure 400 {object} Error "Bad Request" // @Failure 404 {object} Error "Published repository not found" // @Failure 500 {object} Error "Internal Error" @@ -538,6 +554,16 @@ func apiPublishDrop(c *gin.Context) { }) } +// @Summary Add staged source +// @Description **Create and add a staged source** +// @Tags Publish +// @Param prefix path string true "publishing prefix" +// @Param distribution path string true "distribution name" +// @Produce json +// @Success 200 {object} sourceParams +// @Failure 400 {object} Error "Bad Request" +// @Failure 404 {object} Error "Published repository not found" +// @Failure 500 {object} Error "Internal Error" // @Router /api/publish/{prefix}/{distribution}/sources [post] func apiPublishSourcesCreate(c *gin.Context) { var ( @@ -576,7 +602,7 @@ func apiPublishSourcesCreate(c *gin.Context) { _, exists := sources[component] if exists { - AbortWithJSONError(c, http.StatusBadRequest, fmt.Errorf("unable to create: Component %q already exists", component)) + AbortWithJSONError(c, http.StatusBadRequest, fmt.Errorf("unable to create: Component '%s' already exists", component)) return } @@ -594,6 +620,16 @@ func apiPublishSourcesCreate(c *gin.Context) { }) } +// @Summary Get staged sources +// @Description **Get the staged source list** +// @Tags Publish +// @Param prefix path string true "publishing prefix" +// @Param distribution path string true "distribution name" +// @Produce json +// @Success 200 {array} sourceParams +// @Failure 400 {object} Error "Bad Request" +// @Failure 404 {object} Error "Published repository not found or no source changes exist" +// @Failure 500 {object} Error "Internal Error" // @Router /api/publish/{prefix}/{distribution}/sources [get] func apiPublishSourcesList(c *gin.Context) { param := slashEscape(c.Params.ByName("prefix")) @@ -624,6 +660,18 @@ func apiPublishSourcesList(c *gin.Context) { c.JSON(http.StatusOK, revision.SourceList()) } +// @Summary Set staged sources +// @Description **Set the staged source list** +// @Tags Publish +// @Param prefix path string true "publishing prefix" +// @Param distribution path string true "distribution name" +// @Consume json +// @Param request body publishedRepoUpdateParams true "Parameters" +// @Produce json +// @Success 200 {array} sourceParams +// @Failure 400 {object} Error "Bad Request" +// @Failure 404 {object} Error "Published repository not found" +// @Failure 500 {object} Error "Internal Error" // @Router /api/publish/{prefix}/{distribution}/sources [put] func apiPublishSourcesUpdate(c *gin.Context) { var ( @@ -640,13 +688,13 @@ func apiPublishSourcesUpdate(c *gin.Context) { published, err := collection.ByStoragePrefixDistribution(storage, prefix, distribution) if err != nil { - AbortWithJSONError(c, http.StatusNotFound, fmt.Errorf("unable to show: %s", err)) + AbortWithJSONError(c, http.StatusNotFound, fmt.Errorf("unable to update: %s", err)) return } err = collection.LoadComplete(published, collectionFactory) if err != nil { - AbortWithJSONError(c, http.StatusInternalServerError, fmt.Errorf("unable to show: %s", err)) + AbortWithJSONError(c, http.StatusInternalServerError, fmt.Errorf("unable to update: %s", err)) return } @@ -672,10 +720,22 @@ func apiPublishSourcesUpdate(c *gin.Context) { return &task.ProcessReturnValue{Code: http.StatusInternalServerError, Value: nil}, fmt.Errorf("unable to save to DB: %s", err) } - return &task.ProcessReturnValue{Code: http.StatusOK, Value: published}, nil + return &task.ProcessReturnValue{Code: http.StatusOK, Value: revision.SourceList()}, nil }) } +// @Summary Delete staged sources +// @Description **Delete the staged source list** +// @Description +// @Description Delete staged sources and keep existing sources of published repository. +// @Tags Publish +// @Param prefix path string true "publishing prefix" +// @Param distribution path string true "distribution name" +// @Produce json +// @Success 200 +// @Failure 400 {object} Error "Bad Request" +// @Failure 404 {object} Error "Published repository not found" +// @Failure 500 {object} Error "Internal Error" // @Router /api/publish/{prefix}/{distribution}/sources [delete] func apiPublishSourcesDelete(c *gin.Context) { param := slashEscape(c.Params.ByName("prefix")) @@ -707,10 +767,21 @@ func apiPublishSourcesDelete(c *gin.Context) { return &task.ProcessReturnValue{Code: http.StatusInternalServerError, Value: nil}, fmt.Errorf("unable to save to DB: %s", err) } - return &task.ProcessReturnValue{Code: http.StatusOK, Value: published}, nil + return &task.ProcessReturnValue{Code: http.StatusOK, Value: gin.H{}}, nil }) } +// @Summary Update staged source +// @Description **Update the staged source of a component** +// @Tags Publish +// @Param prefix path string true "publishing prefix" +// @Param distribution path string true "distribution name" +// @Param component path string true "component name" +// @Produce json +// @Success 200 +// @Failure 400 {object} Error "Bad Request" +// @Failure 404 {object} Error "Published repository/component not found" +// @Failure 500 {object} Error "Internal Error" // @Router /api/publish/{prefix}/{distribution}/sources/{component} [put] func apiPublishSourceUpdate(c *gin.Context) { var ( @@ -743,7 +814,7 @@ func apiPublishSourceUpdate(c *gin.Context) { _, exists := sources[component] if !exists { - AbortWithJSONError(c, http.StatusNotFound, fmt.Errorf("unable to update: Component %q does not exist", component)) + AbortWithJSONError(c, http.StatusNotFound, fmt.Errorf("unable to update: Component '%s' does not exist", component)) return } @@ -770,10 +841,21 @@ func apiPublishSourceUpdate(c *gin.Context) { return &task.ProcessReturnValue{Code: http.StatusInternalServerError, Value: nil}, fmt.Errorf("unable to save to DB: %s", err) } - return &task.ProcessReturnValue{Code: http.StatusOK, Value: published}, nil + return &task.ProcessReturnValue{Code: http.StatusOK, Value: gin.H{}}, nil }) } +// @Summary Delete staged source +// @Description **Delete the staged source** +// @Tags Publish +// @Param prefix path string true "publishing prefix" +// @Param distribution path string true "distribution name" +// @Param component path string true "component name" +// @Produce json +// @Success 200 +// @Failure 400 {object} Error "Bad Request" +// @Failure 404 {object} Error "Published repository not found" +// @Failure 500 {object} Error "Internal Error" // @Router /api/publish/{prefix}/{distribution}/sources/{component} [delete] func apiPublishSourceDelete(c *gin.Context) { var err error @@ -788,19 +870,25 @@ func apiPublishSourceDelete(c *gin.Context) { published, err := collection.ByStoragePrefixDistribution(storage, prefix, distribution) if err != nil { - AbortWithJSONError(c, http.StatusNotFound, fmt.Errorf("unable to show: %s", err)) + AbortWithJSONError(c, http.StatusNotFound, fmt.Errorf("unable to delete: %s", err)) return } err = collection.LoadComplete(published, collectionFactory) if err != nil { - AbortWithJSONError(c, http.StatusInternalServerError, fmt.Errorf("unable to show: %s", err)) + AbortWithJSONError(c, http.StatusInternalServerError, fmt.Errorf("unable to delete: %s", err)) return } revision := published.ObtainRevision() sources := revision.Sources + _, exists := sources[component] + if !exists { + AbortWithJSONError(c, http.StatusNotFound, fmt.Errorf("unable to delete: Component '%s' does not exist", component)) + return + } + delete(sources, component) resources := []string{string(published.Key())} @@ -811,10 +899,41 @@ func apiPublishSourceDelete(c *gin.Context) { return &task.ProcessReturnValue{Code: http.StatusInternalServerError, Value: nil}, fmt.Errorf("unable to save to DB: %s", err) } - return &task.ProcessReturnValue{Code: http.StatusOK, Value: published}, nil + return &task.ProcessReturnValue{Code: http.StatusOK, Value: gin.H{}}, nil }) } +type publishedRepoUpdateParams struct { + // when publishing, overwrite files in pool/ directory without notice + ForceOverwrite bool ` json:"ForceOverwrite"` + // GPG options + Signing signingParams ` json:"Signing"` + // Don't generate contents indexes + SkipContents *bool ` json:"SkipContents"` + // Skip bz2 compression for index files + SkipBz2 *bool ` json:"SkipBz2"` + // Don't remove unreferenced files in prefix/component + SkipCleanup *bool ` json:"SkipCleanup"` + // Provide index files by hash + AcquireByHash *bool ` json:"AcquireByHash"` + // Enable multiple packages with the same filename in different distributions + MultiDist *bool ` json:"MultiDist"` +} + +// @Summary Update content of published repository +// @Description **Update the content of a published repository** +// @Description +// @Description Replace the sources of the published repository (if available) and (re-)publish new content. +// @Tags Publish +// @Param prefix path string true "publishing prefix" +// @Param distribution path string true "distribution name" +// @Consume json +// @Param request body publishedRepoUpdateParams true "Parameters" +// @Produce json +// @Success 200 {object} deb.PublishedRepo +// @Failure 400 {object} Error "Bad Request" +// @Failure 404 {object} Error "Published repository/component not found" +// @Failure 500 {object} Error "Internal Error" // @Router /api/publish/{prefix}/{distribution}/update [post] func apiPublishUpdate(c *gin.Context) { param := slashEscape(c.Params.ByName("prefix")) @@ -891,8 +1010,9 @@ func apiPublishUpdate(c *gin.Context) { } if b.SkipCleanup == nil || !*b.SkipCleanup { - err = collection.CleanupPrefixComponentFiles(context, published, - result.AddedComponents(), result.UpdatedComponents(), result.RemovedComponents(), collectionFactory, out) + cleanComponents := make([]string, 0, len(result.UpdatedSources)+len(result.RemovedSources)) + cleanComponents = append(append(cleanComponents, result.UpdatedComponents()...), result.RemovedComponents()...) + err = collection.CleanupPrefixComponentFiles(context, published, cleanComponents, collectionFactory, out) if err != nil { return &task.ProcessReturnValue{Code: http.StatusInternalServerError, Value: nil}, fmt.Errorf("unable to update: %s", err) } diff --git a/cmd/mirror_update.go b/cmd/mirror_update.go index 2e6df439..2aad8c53 100644 --- a/cmd/mirror_update.go +++ b/cmd/mirror_update.go @@ -267,7 +267,7 @@ func aptlyMirrorUpdate(cmd *commander.Command, args []string) error { return fmt.Errorf("unable to update: %s", err) } - context.Progress().Printf("\nMirror `%s` has been successfully updated.\n", repo.Name) + context.Progress().Printf("\nMirror `%s` has been updated successfully.\n", repo.Name) return err } diff --git a/cmd/publish_source_add.go b/cmd/publish_source_add.go index 2ee9e7ff..cf2b8570 100644 --- a/cmd/publish_source_add.go +++ b/cmd/publish_source_add.go @@ -44,9 +44,9 @@ func aptlyPublishSourceAdd(cmd *commander.Command, args []string) error { name := names[i] _, exists := sources[component] if exists { - return fmt.Errorf("unable to add: component %q has already been added", component) + return fmt.Errorf("unable to add: component '%s' has already been added", component) } - context.Progress().Printf("Adding component %q with source %q [%s]...\n", component, name, published.SourceKind) + context.Progress().Printf("Adding component '%s' with source '%s' [%s]...\n", component, name, published.SourceKind) sources[component] = names[i] } diff --git a/cmd/publish_source_remove.go b/cmd/publish_source_remove.go index 1d3892c4..5a0df7a6 100644 --- a/cmd/publish_source_remove.go +++ b/cmd/publish_source_remove.go @@ -42,9 +42,9 @@ func aptlyPublishSourceRemove(cmd *commander.Command, args []string) error { for _, component := range components { name, exists := sources[component] if !exists { - return fmt.Errorf("unable to remove: component %q does not exist", component) + return fmt.Errorf("unable to remove: component '%s' does not exist", component) } - context.Progress().Printf("Removing component %q with source %q [%s]...\n", component, name, published.SourceKind) + context.Progress().Printf("Removing component '%s' with source '%s' [%s]...\n", component, name, published.SourceKind) delete(sources, component) } diff --git a/cmd/publish_source_update.go b/cmd/publish_source_update.go index 66c27468..0dae6439 100644 --- a/cmd/publish_source_update.go +++ b/cmd/publish_source_update.go @@ -44,9 +44,9 @@ func aptlyPublishSourceUpdate(cmd *commander.Command, args []string) error { name := names[i] _, exists := sources[component] if !exists { - return fmt.Errorf("unable to update: component %q does not exist", component) + return fmt.Errorf("unable to update: component '%s' does not exist", component) } - context.Progress().Printf("Updating component %q with source %q [%s]...\n", component, name, published.SourceKind) + context.Progress().Printf("Updating component '%s' with source '%s' [%s]...\n", component, name, published.SourceKind) sources[component] = name } diff --git a/cmd/publish_switch.go b/cmd/publish_switch.go index eedb42d8..12d73f08 100644 --- a/cmd/publish_switch.go +++ b/cmd/publish_switch.go @@ -115,8 +115,7 @@ func aptlyPublishSwitch(cmd *commander.Command, args []string) error { skipCleanup := context.Flags().Lookup("skip-cleanup").Value.Get().(bool) if !skipCleanup { - err = collectionFactory.PublishedRepoCollection().CleanupPrefixComponentFiles(context, published, - []string{}, components, []string{}, collectionFactory, context.Progress()) + err = collectionFactory.PublishedRepoCollection().CleanupPrefixComponentFiles(context, published, components, collectionFactory, context.Progress()) if err != nil { return fmt.Errorf("unable to switch: %s", err) } diff --git a/cmd/publish_update.go b/cmd/publish_update.go index f4337865..589e35bf 100644 --- a/cmd/publish_update.go +++ b/cmd/publish_update.go @@ -76,14 +76,15 @@ func aptlyPublishUpdate(cmd *commander.Command, args []string) error { skipCleanup := context.Flags().Lookup("skip-cleanup").Value.Get().(bool) if !skipCleanup { - err = collectionFactory.PublishedRepoCollection().CleanupPrefixComponentFiles(context, published, - result.AddedComponents(), result.UpdatedComponents(), result.RemovedComponents(), collectionFactory, context.Progress()) + cleanComponents := make([]string, 0, len(result.UpdatedSources)+len(result.RemovedSources)) + cleanComponents = append(append(cleanComponents, result.UpdatedComponents()...), result.RemovedComponents()...) + err = collectionFactory.PublishedRepoCollection().CleanupPrefixComponentFiles(context, published, cleanComponents, collectionFactory, context.Progress()) if err != nil { return fmt.Errorf("unable to update: %s", err) } } - context.Progress().Printf("\nPublished %s repository %s has been successfully updated.\n", published.SourceKind, published.String()) + context.Progress().Printf("\nPublished %s repository %s has been updated successfully.\n", published.SourceKind, published.String()) return err } diff --git a/deb/publish.go b/deb/publish.go index 0cd481a9..9143e610 100644 --- a/deb/publish.go +++ b/deb/publish.go @@ -1462,73 +1462,127 @@ func (collection *PublishedRepoCollection) listReferencedFilesByComponent(prefix // CleanupPrefixComponentFiles removes all unreferenced files in published storage under prefix/component pair func (collection *PublishedRepoCollection) CleanupPrefixComponentFiles(publishedStorageProvider aptly.PublishedStorageProvider, - published *PublishedRepo, addedComponents, updatedComponents, removedComponents []string, - collectionFactory *CollectionFactory, progress aptly.Progress) error { + published *PublishedRepo, cleanComponents []string, collectionFactory *CollectionFactory, progress aptly.Progress) error { + + var err error collection.loadList() + storage := published.Storage prefix := published.Prefix distribution := published.Distribution - multiDist := published.MultiDist + + rootPath := filepath.Join(prefix, "dists", distribution) publishedStorage := publishedStorageProvider.GetPublishedStorage(published.Storage) - components := make([]string, 0, len(addedComponents)+len(updatedComponents)+len(removedComponents)) - components = append(append(append(components, addedComponents...), updatedComponents...), removedComponents...) - sort.Strings(components) + sort.Strings(cleanComponents) + publishedComponents := published.Components() + removedComponents := utils.StrSlicesSubstract(cleanComponents, publishedComponents) + updatedComponents := utils.StrSlicesSubstract(cleanComponents, removedComponents) + + if progress != nil { + progress.Printf("Cleaning up published repository %s/%s...\n", published.StoragePrefix(), distribution) + } for _, component := range removedComponents { if progress != nil { - progress.Printf("Removing component %q from prefix %q...\n", component, prefix) + progress.Printf("Removing component '%s'...\n", component) } - err := publishedStorage.RemoveDirs(filepath.Join(prefix, "dists", distribution, component), progress) + err = publishedStorage.RemoveDirs(filepath.Join(rootPath, component), progress) if err != nil { return err } - if multiDist { - for _, component := range removedComponents { - err = publishedStorage.RemoveDirs(filepath.Join(prefix, "pool", distribution, component), progress) + // Ensure that component does not exist in multi distribution pool + err = publishedStorage.RemoveDirs(filepath.Join(prefix, "pool", distribution, component), nil) + if err != nil { + return err + } + } + + referencedFiles := map[string][]string{} + + if published.MultiDist { + rootPath = filepath.Join(prefix, "pool", distribution) + + // Get all referenced files by component for determining orphaned pool files. + for _, component := range publishedComponents { + packageList, err := NewPackageListFromRefList(published.RefList(component), collectionFactory.PackageCollection(), progress) + if err != nil { + return err + } + + packageList.ForEach(func(p *Package) error { + poolDir, err := p.PoolDirectory() + if err != nil { + return err + } + + for _, file := range p.Files() { + referencedFiles[component] = append(referencedFiles[component], filepath.Join(poolDir, file.Filename)) + } + + return nil + }) + } + } else { + rootPath = filepath.Join(prefix, "pool") + + // In case of a shared component pool directory, we must check, if a component is no longer referenced by any other + // published repository within the same prefix. + referencedComponents := map[string]struct{}{} + for _, p := range collection.list { + if p.Prefix == prefix && p.Storage == storage && !p.MultiDist { + for _, component := range p.Components() { + referencedComponents[component] = struct{}{} + } + } + } + + // Remove orphaned component pool directories in the prefix. + for _, component := range removedComponents { + _, exists := referencedComponents[component] + if !exists { + err := publishedStorage.RemoveDirs(filepath.Join(rootPath, component), progress) if err != nil { return err } } } + + // Get all referenced files by component for determining orphaned pool files. + referencedFiles, err = collection.listReferencedFilesByComponent(prefix, publishedComponents, collectionFactory, progress) + if err != nil { + return err + } } - components = make([]string, 0, len(updatedComponents)+len(removedComponents)) - components = append(append(components, addedComponents...), updatedComponents...) - - referencedFiles, err := collection.listReferencedFilesByComponent(prefix, components, collectionFactory, progress) - if err != nil { - return err - } - - for _, component := range components { + for _, component := range updatedComponents { if progress != nil { - progress.Printf("Cleaning up component %q in prefix %q...\n", component, prefix) + progress.Printf("Cleaning up component '%s'...\n", component) } sort.Strings(referencedFiles[component]) - rootPath := filepath.Join(prefix, "pool", component) - existingFiles, err := publishedStorage.Filelist(rootPath) + path := filepath.Join(rootPath, component) + existingFiles, err := publishedStorage.Filelist(path) if err != nil { return err } sort.Strings(existingFiles) - filesToDelete := utils.StrSlicesSubstract(existingFiles, referencedFiles[component]) + orphanedFiles := utils.StrSlicesSubstract(existingFiles, referencedFiles[component]) - for _, file := range filesToDelete { - err = publishedStorage.Remove(filepath.Join(rootPath, file)) + for _, file := range orphanedFiles { + err = publishedStorage.Remove(filepath.Join(path, file)) if err != nil { return err } } } - return nil + return err } // Remove removes published repository, cleaning up directories, files @@ -1579,8 +1633,7 @@ func (collection *PublishedRepoCollection) Remove(publishedStorageProvider aptly nil, collection.list[len(collection.list)-1], collection.list[:len(collection.list)-1] if !skipCleanup && len(cleanComponents) > 0 { - err = collection.CleanupPrefixComponentFiles(publishedStorageProvider, repo, []string{}, cleanComponents, []string{}, - collectionFactory, progress) + err = collection.CleanupPrefixComponentFiles(publishedStorageProvider, repo, cleanComponents, collectionFactory, progress) if err != nil { if !force { return fmt.Errorf("cleanup failed, use -force-drop to override: %s", err) diff --git a/deb/publish_test.go b/deb/publish_test.go index 5243a41a..eec1601f 100644 --- a/deb/publish_test.go +++ b/deb/publish_test.go @@ -2,6 +2,7 @@ package deb import ( "bytes" + "encoding/json" "errors" "fmt" "io/ioutil" @@ -359,6 +360,25 @@ func (s *PublishedRepoSuite) TestDistributionComponentGuessing(c *C) { c.Check(err, ErrorMatches, "duplicate component name: main") } +func (s *PublishedRepoSuite) TestUpdate(c *C) { + revision := s.repo2.ObtainRevision() + sources := revision.Sources + sources["test"] = "local1" + + result, err := s.repo2.Update(s.factory, nil) + c.Assert(err, IsNil) + c.Assert(result, NotNil) + c.Assert(s.repo2.Revision, IsNil) + + c.Assert(result.AddedSources, DeepEquals, map[string]string{"test": "local1"}) + c.Assert(result.UpdatedSources, DeepEquals, map[string]string{"main": "local1"}) + c.Assert(result.RemovedSources, DeepEquals, map[string]string{}) + + c.Assert(result.AddedComponents(), DeepEquals, []string{"test"}) + c.Assert(result.UpdatedComponents(), DeepEquals, []string{"main"}) + c.Assert(result.RemovedComponents(), DeepEquals, []string{}) +} + func (s *PublishedRepoSuite) TestPublish(c *C) { err := s.repo.Publish(s.packagePool, s.provider, s.factory, &NullSigner{}, nil, false) c.Assert(err, IsNil) @@ -489,6 +509,30 @@ func (s *PublishedRepoSuite) TestEncodeDecode(c *C) { c.Assert(repo2, DeepEquals, s.repo2) } +func (s *PublishedRepoSuite) TestPublishedRepoRevision(c *C) { + revision := s.repo2.ObtainRevision() + c.Assert(revision, NotNil) + + sources := revision.Sources + c.Assert(sources, NotNil) + c.Assert(sources, DeepEquals, map[string]string{"main": "local1"}) + + sources["test1"] = "snap1" + sources["test2"] = "snap2" + + c.Assert(revision.Components(), DeepEquals, []string{"main", "test1", "test2"}) + c.Assert(revision.SourceNames(), DeepEquals, []string{"local1", "snap1", "snap2"}) + + bytes, err := json.Marshal(revision) + c.Assert(err, IsNil) + + json_expected := `{"Sources":[{"Component":"main","Name":"local1"},{"Component":"test1","Name":"snap1"},{"Component":"test2","Name":"snap2"}]}` + c.Assert(string(bytes), Equals, json_expected) + + c.Assert(s.repo2.DropRevision(), DeepEquals, revision) + c.Assert(s.repo2.Revision, IsNil) +} + type PublishedRepoCollectionSuite struct { PackageListMixinSuite db database.Storage diff --git a/system/t04_mirror/UpdateMirror10Test_gold b/system/t04_mirror/UpdateMirror10Test_gold index fa0f41f2..54251a64 100644 --- a/system/t04_mirror/UpdateMirror10Test_gold +++ b/system/t04_mirror/UpdateMirror10Test_gold @@ -18,7 +18,7 @@ Downloading: http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/d Downloading: http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/debian/bullseye-cran40/rkward-dbgsym_0.7.5-1~bullseyecran.0_i386.deb Downloading: http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/debian/bullseye-cran40/rkward_0.7.5-1~bullseyecran.0_amd64.deb Downloading: http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/debian/bullseye-cran40/rkward_0.7.5-1~bullseyecran.0_i386.deb -Mirror `flat-src` has been successfully updated. +Mirror `flat-src` has been updated successfully. Packages filtered: 110 -> 11. gpgv: using RSA key 7BA040A510E4E66ED3743EC1B8F25A8A73EACF41 gpgv: Good signature from "Johannes Ranke " diff --git a/system/t04_mirror/UpdateMirror11FTPTest_gold b/system/t04_mirror/UpdateMirror11FTPTest_gold index 24f61552..dc4bab13 100644 --- a/system/t04_mirror/UpdateMirror11FTPTest_gold +++ b/system/t04_mirror/UpdateMirror11FTPTest_gold @@ -13,7 +13,7 @@ Downloading: http://repo.aptly.info/system-tests/snapshot.debian.org/archive/deb Downloading: http://repo.aptly.info/system-tests/snapshot.debian.org/archive/debian/20220201T025006Z/pool/main/s/sensible-utils/sensible-utils_0.0.9+deb9u1_all.deb Downloading: http://repo.aptly.info/system-tests/snapshot.debian.org/archive/debian/20220201T025006Z/pool/main/s/sysvinit/sysvinit-utils_2.88dsf-59.9_i386.deb Error (retrying): HTTP code 404 while fetching http://repo.aptly.info/system-tests/snapshot.debian.org/archive/debian/20220201T025006Z/dists/stretch/InRelease -Mirror `stretch-main` has been successfully updated. +Mirror `stretch-main` has been updated successfully. Packages filtered: 50604 -> 3. Retrying 0 http://repo.aptly.info/system-tests/snapshot.debian.org/archive/debian/20220201T025006Z/dists/stretch/InRelease... gpgv: issuer "debian-release@lists.debian.org" diff --git a/system/t04_mirror/UpdateMirror12Test_gold b/system/t04_mirror/UpdateMirror12Test_gold index eff42e76..f9ad32d5 100644 --- a/system/t04_mirror/UpdateMirror12Test_gold +++ b/system/t04_mirror/UpdateMirror12Test_gold @@ -37,7 +37,7 @@ Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archi Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/pool/main/g/gnupg2/scdaemon_2.1.18-8~deb9u4_amd64.deb Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/pool/main/g/gnupg2/scdaemon_2.1.18-8~deb9u4_i386.deb Error (retrying): HTTP code 404 while fetching http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/InRelease -Mirror `stretch` has been successfully updated. +Mirror `stretch` has been updated successfully. Packages filtered: 78248 -> 20. Retrying 0 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/InRelease... gpgv: issuer "debian-release@lists.debian.org" diff --git a/system/t04_mirror/UpdateMirror13Test_gold b/system/t04_mirror/UpdateMirror13Test_gold index 63c166c8..b00c4ce3 100644 --- a/system/t04_mirror/UpdateMirror13Test_gold +++ b/system/t04_mirror/UpdateMirror13Test_gold @@ -58,4 +58,4 @@ Downloading: http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/va Downloading: http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/pool/wheezy/main/v/varnish/varnish-dbg_3.0.3-1~wheezy_i386.deb Downloading: http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/pool/wheezy/main/v/varnish/varnish_3.0.3-1~wheezy_amd64.deb Downloading: http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/pool/wheezy/main/v/varnish/varnish_3.0.3-1~wheezy_i386.deb -Mirror `varnish` has been successfully updated. \ No newline at end of file +Mirror `varnish` has been updated successfully. \ No newline at end of file diff --git a/system/t04_mirror/UpdateMirror14Test_gold b/system/t04_mirror/UpdateMirror14Test_gold index 0c1b5c59..edcc3695 100644 --- a/system/t04_mirror/UpdateMirror14Test_gold +++ b/system/t04_mirror/UpdateMirror14Test_gold @@ -6,4 +6,4 @@ Downloading & parsing package files... Downloading: http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/dists/wheezy/Release Downloading: http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/dists/wheezy/main/binary-amd64/Packages.bz2 Downloading: http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/dists/wheezy/main/binary-i386/Packages.bz2 -Mirror `varnish` has been successfully updated. \ No newline at end of file +Mirror `varnish` has been updated successfully. \ No newline at end of file diff --git a/system/t04_mirror/UpdateMirror15Test_gold b/system/t04_mirror/UpdateMirror15Test_gold index 3c11f1ff..d218085c 100644 --- a/system/t04_mirror/UpdateMirror15Test_gold +++ b/system/t04_mirror/UpdateMirror15Test_gold @@ -6,4 +6,4 @@ Downloading & parsing package files... Downloading https://dl.bintray.com/smira/deb/Packages.bz2... Downloading https://dl.bintray.com/smira/deb/Release... Downloading https://dl.bintray.com/smira/deb/libboost-program-options-dev_1.49.0.1_i386.deb... -Mirror `bintray` has been successfully updated. \ No newline at end of file +Mirror `bintray` has been updated successfully. \ No newline at end of file diff --git a/system/t04_mirror/UpdateMirror16Test_gold b/system/t04_mirror/UpdateMirror16Test_gold index 3c11f1ff..d218085c 100644 --- a/system/t04_mirror/UpdateMirror16Test_gold +++ b/system/t04_mirror/UpdateMirror16Test_gold @@ -6,4 +6,4 @@ Downloading & parsing package files... Downloading https://dl.bintray.com/smira/deb/Packages.bz2... Downloading https://dl.bintray.com/smira/deb/Release... Downloading https://dl.bintray.com/smira/deb/libboost-program-options-dev_1.49.0.1_i386.deb... -Mirror `bintray` has been successfully updated. \ No newline at end of file +Mirror `bintray` has been updated successfully. \ No newline at end of file diff --git a/system/t04_mirror/UpdateMirror17Test_gold b/system/t04_mirror/UpdateMirror17Test_gold index 6341c1de..cddc0d3e 100644 --- a/system/t04_mirror/UpdateMirror17Test_gold +++ b/system/t04_mirror/UpdateMirror17Test_gold @@ -6,5 +6,5 @@ Download queue: 0 items (0 B) Downloading & parsing package files... Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/Release Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/main/binary-i386/Packages.gz -Mirror `stretch` has been successfully updated. +Mirror `stretch` has been updated successfully. Packages filtered: 50604 -> 1. \ No newline at end of file diff --git a/system/t04_mirror/UpdateMirror18Test_gold b/system/t04_mirror/UpdateMirror18Test_gold index 0e0deb88..30dfc184 100644 --- a/system/t04_mirror/UpdateMirror18Test_gold +++ b/system/t04_mirror/UpdateMirror18Test_gold @@ -7,5 +7,5 @@ Downloading & parsing package files... Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/Release Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/main/binary-i386/Packages.gz Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/pool/main/b/boost-defaults/libboost-program-options-dev_1.62.0.1_i386.deb -Mirror `stretch` has been successfully updated. +Mirror `stretch` has been updated successfully. Packages filtered: 50604 -> 1. \ No newline at end of file diff --git a/system/t04_mirror/UpdateMirror19Test_gold b/system/t04_mirror/UpdateMirror19Test_gold index fcf7c33c..ef4a8634 100644 --- a/system/t04_mirror/UpdateMirror19Test_gold +++ b/system/t04_mirror/UpdateMirror19Test_gold @@ -12,4 +12,4 @@ Downloading: http://repo.aptly.info/system-tests/packages.pagerduty.com/pdagent/ Building download queue... Download queue: 23 items (3.46 MiB) -Mirror `pagerduty` has been successfully updated. +Mirror `pagerduty` has been updated successfully. diff --git a/system/t04_mirror/UpdateMirror1Test_gold b/system/t04_mirror/UpdateMirror1Test_gold index 63c166c8..b00c4ce3 100644 --- a/system/t04_mirror/UpdateMirror1Test_gold +++ b/system/t04_mirror/UpdateMirror1Test_gold @@ -58,4 +58,4 @@ Downloading: http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/va Downloading: http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/pool/wheezy/main/v/varnish/varnish-dbg_3.0.3-1~wheezy_i386.deb Downloading: http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/pool/wheezy/main/v/varnish/varnish_3.0.3-1~wheezy_amd64.deb Downloading: http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/pool/wheezy/main/v/varnish/varnish_3.0.3-1~wheezy_i386.deb -Mirror `varnish` has been successfully updated. \ No newline at end of file +Mirror `varnish` has been updated successfully. \ No newline at end of file diff --git a/system/t04_mirror/UpdateMirror20Test_gold b/system/t04_mirror/UpdateMirror20Test_gold index 3353fc5b..726afd93 100644 --- a/system/t04_mirror/UpdateMirror20Test_gold +++ b/system/t04_mirror/UpdateMirror20Test_gold @@ -8,7 +8,7 @@ Downloading: http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/d Downloading: http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/debian/bullseye-cran40/Packages.bz2 Downloading: http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/debian/bullseye-cran40/r-cran-class_7.3-22-2~bullseyecran.0_amd64.deb Downloading: http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/debian/bullseye-cran40/r-cran-class_7.3-22-2~bullseyecran.0_i386.deb -Mirror `flat` has been successfully updated. +Mirror `flat` has been updated successfully. Packages filtered: 89 -> 2. openpgp: Good signature from "Johannes Ranke " openpgp: RSA key ID B8F25A8A73EACF41 \ No newline at end of file diff --git a/system/t04_mirror/UpdateMirror21Test_gold b/system/t04_mirror/UpdateMirror21Test_gold index 869ec65b..e864bf91 100644 --- a/system/t04_mirror/UpdateMirror21Test_gold +++ b/system/t04_mirror/UpdateMirror21Test_gold @@ -11,4 +11,4 @@ Downloading: http://repo.aptly.info/system-tests/packages.pagerduty.com/pdagent/ Building download queue... Download queue: 23 items (3.46 MiB) -Mirror `pagerduty` has been successfully updated. +Mirror `pagerduty` has been updated successfully. diff --git a/system/t04_mirror/UpdateMirror22Test_gold b/system/t04_mirror/UpdateMirror22Test_gold index 6724bab1..9c76ac64 100644 --- a/system/t04_mirror/UpdateMirror22Test_gold +++ b/system/t04_mirror/UpdateMirror22Test_gold @@ -8,4 +8,4 @@ Applying filter... Building download queue... Download queue: 0 items (0 B) -Mirror `libnvidia-container` has been successfully updated. +Mirror `libnvidia-container` has been updated successfully. diff --git a/system/t04_mirror/UpdateMirror23Test_gold b/system/t04_mirror/UpdateMirror23Test_gold index 5e6157c7..5b172366 100644 --- a/system/t04_mirror/UpdateMirror23Test_gold +++ b/system/t04_mirror/UpdateMirror23Test_gold @@ -23,7 +23,7 @@ Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archi Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/non-free/installer-s390x/current/images/SHA256SUMS Error (retrying): HTTP code 404 while fetching http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/InRelease Error (retrying): HTTP code 404 while fetching http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/non-free/installer-s390x/current/images/SHA256SUMS -Mirror `stretch` has been successfully updated. +Mirror `stretch` has been updated successfully. Packages filtered: 49256 -> 1. Retrying 0 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/InRelease... Retrying 0 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/non-free/installer-s390x/current/images/SHA256SUMS... diff --git a/system/t04_mirror/UpdateMirror24Test_gold b/system/t04_mirror/UpdateMirror24Test_gold index e8ec96b9..dcc27631 100644 --- a/system/t04_mirror/UpdateMirror24Test_gold +++ b/system/t04_mirror/UpdateMirror24Test_gold @@ -53,7 +53,7 @@ Downloading: http://repo.aptly.info/system-tests/us.archive.ubuntu.com/ubuntu/di Downloading: http://repo.aptly.info/system-tests/us.archive.ubuntu.com/ubuntu/dists/trusty/restricted/installer-amd64/current/images/SHA256SUMS Error (retrying): HTTP code 404 while fetching http://repo.aptly.info/system-tests/us.archive.ubuntu.com/ubuntu/dists/trusty/InRelease Error (retrying): HTTP code 404 while fetching http://repo.aptly.info/system-tests/us.archive.ubuntu.com/ubuntu/dists/trusty/restricted/installer-amd64/current/images/SHA256SUMS -Mirror `trusty` has been successfully updated. +Mirror `trusty` has been updated successfully. Packages filtered: 8616 -> 1. Retrying 0 http://repo.aptly.info/system-tests/us.archive.ubuntu.com/ubuntu/dists/trusty/InRelease... Retrying 0 http://repo.aptly.info/system-tests/us.archive.ubuntu.com/ubuntu/dists/trusty/restricted/installer-amd64/current/images/SHA256SUMS... diff --git a/system/t04_mirror/UpdateMirror26Test_gold b/system/t04_mirror/UpdateMirror26Test_gold index aa6d212e..b460083f 100644 --- a/system/t04_mirror/UpdateMirror26Test_gold +++ b/system/t04_mirror/UpdateMirror26Test_gold @@ -14,7 +14,7 @@ Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archi Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/main/binary-i386/Packages.gz Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/pool/main/b/boost-defaults/libboost-program-options-dev_1.62.0.1_i386.deb Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/pool/main/b/boost-defaults/libboost-program-options-dev_1.62.0.1_i386.deb -Mirror `grab` has been successfully updated. +Mirror `grab` has been updated successfully. Packages filtered: 50604 -> 1. Retrying 0 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/InRelease Retrying 0 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/dists/stretch/InRelease diff --git a/system/t04_mirror/UpdateMirror6Test_gold b/system/t04_mirror/UpdateMirror6Test_gold index 84cb9694..000a38aa 100644 --- a/system/t04_mirror/UpdateMirror6Test_gold +++ b/system/t04_mirror/UpdateMirror6Test_gold @@ -18,4 +18,4 @@ Download queue: 1 items (30 B) Downloading: ${url}pool/main/a/amanda/amanda-client_3.3.1-3~bpo60+1_amd64.deb WARNING: ${url}pool/main/a/amanda/amanda-client_3.3.1-3~bpo60+1_amd64.deb: sha1 hash mismatch "8d3a014000038725d6daf8771b42a0784253688f" != "66b27417d37e024c46526c2f6d358a754fc552f3" -Mirror `failure` has been successfully updated. +Mirror `failure` has been updated successfully. diff --git a/system/t04_mirror/UpdateMirror7Test_gold b/system/t04_mirror/UpdateMirror7Test_gold index 14090853..bc1279d8 100644 --- a/system/t04_mirror/UpdateMirror7Test_gold +++ b/system/t04_mirror/UpdateMirror7Test_gold @@ -94,7 +94,7 @@ Downloading: http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/d Downloading: http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/debian/bullseye-cran40/rkward-dbgsym_0.7.5-1~bullseyecran.0_i386.deb Downloading: http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/debian/bullseye-cran40/rkward_0.7.5-1~bullseyecran.0_amd64.deb Downloading: http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/debian/bullseye-cran40/rkward_0.7.5-1~bullseyecran.0_i386.deb -Mirror `flat` has been successfully updated. +Mirror `flat` has been updated successfully. gpgv: using RSA key 7BA040A510E4E66ED3743EC1B8F25A8A73EACF41 gpgv: Good signature from "Johannes Ranke " gpgv: Signature made Thu Nov 2 07:43:52 2023 UTC \ No newline at end of file diff --git a/system/t04_mirror/UpdateMirror8Test_gold b/system/t04_mirror/UpdateMirror8Test_gold index 30dbccb9..382b15e2 100644 --- a/system/t04_mirror/UpdateMirror8Test_gold +++ b/system/t04_mirror/UpdateMirror8Test_gold @@ -15,4 +15,4 @@ Downloading: http://repo.aptly.info/system-tests/ppa.launchpad.net/gladky-anton/ Building download queue... Download queue: 0 items (0 B) -Mirror `gnuplot-maverick-src` has been successfully updated. +Mirror `gnuplot-maverick-src` has been updated successfully. diff --git a/system/t04_mirror/UpdateMirror9Test_gold b/system/t04_mirror/UpdateMirror9Test_gold index 1d898874..2c2dba87 100644 --- a/system/t04_mirror/UpdateMirror9Test_gold +++ b/system/t04_mirror/UpdateMirror9Test_gold @@ -157,7 +157,7 @@ Downloading: http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/d Downloading: http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/debian/bullseye-cran40/survival_3.5-7-1~bullseyecran.0.debian.tar.xz Downloading: http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/debian/bullseye-cran40/survival_3.5-7-1~bullseyecran.0.dsc Downloading: http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/debian/bullseye-cran40/survival_3.5-7.orig.tar.gz -Mirror `flat-src` has been successfully updated. +Mirror `flat-src` has been updated successfully. gpgv: using RSA key 7BA040A510E4E66ED3743EC1B8F25A8A73EACF41 gpgv: Good signature from "Johannes Ranke " gpgv: Signature made Thu Nov 2 07:43:52 2023 UTC \ No newline at end of file diff --git a/system/t06_publish/AzurePublish2Test_gold b/system/t06_publish/AzurePublish2Test_gold index ea8cafb9..0ac6b345 100644 --- a/system/t06_publish/AzurePublish2Test_gold +++ b/system/t06_publish/AzurePublish2Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository azure:test1:./maverick... +Cleaning up component 'main'... -Published local repository azure:test1:./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated. +Published local repository azure:test1:./maverick [i386, source] publishes {main: [local-repo]} has been updated successfully. diff --git a/system/t06_publish/AzurePublish3Test_gold b/system/t06_publish/AzurePublish3Test_gold index c1855169..a346b469 100644 --- a/system/t06_publish/AzurePublish3Test_gold +++ b/system/t06_publish/AzurePublish3Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository azure:test1:./maverick... +Cleaning up component 'main'... Published snapshot repository azure:test1:./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new source. diff --git a/system/t06_publish/AzurePublish5Test_gold b/system/t06_publish/AzurePublish5Test_gold index cadce02c..bef652cb 100644 --- a/system/t06_publish/AzurePublish5Test_gold +++ b/system/t06_publish/AzurePublish5Test_gold @@ -1,3 +1,4 @@ -Cleaning up prefix "." components main... +Cleaning up published repository azure:test1:./sq2... +Cleaning up component 'main'... Published repository has been removed successfully. diff --git a/system/t06_publish/PublishDrop3Test_gold b/system/t06_publish/PublishDrop3Test_gold index eb8ce9c0..1da15e9a 100644 --- a/system/t06_publish/PublishDrop3Test_gold +++ b/system/t06_publish/PublishDrop3Test_gold @@ -1,4 +1,5 @@ Removing ${HOME}/.aptly/public/dists/sq1... -Cleaning up prefix "." components main... +Cleaning up published repository ./sq1... +Cleaning up component 'main'... Published repository has been removed successfully. diff --git a/system/t06_publish/PublishDrop5Test_gold b/system/t06_publish/PublishDrop5Test_gold index 79be1a16..2313ec65 100644 --- a/system/t06_publish/PublishDrop5Test_gold +++ b/system/t06_publish/PublishDrop5Test_gold @@ -1,4 +1,5 @@ Removing ${HOME}/.aptly/public/dists/sq2... -Cleaning up prefix "." components main... +Cleaning up published repository ./sq2... +Cleaning up component 'main'... Published repository has been removed successfully. diff --git a/system/t06_publish/PublishDrop9Test_gold b/system/t06_publish/PublishDrop9Test_gold index eb8ce9c0..1da15e9a 100644 --- a/system/t06_publish/PublishDrop9Test_gold +++ b/system/t06_publish/PublishDrop9Test_gold @@ -1,4 +1,5 @@ Removing ${HOME}/.aptly/public/dists/sq1... -Cleaning up prefix "." components main... +Cleaning up published repository ./sq1... +Cleaning up component 'main'... Published repository has been removed successfully. diff --git a/system/t06_publish/PublishShow5Test_gold b/system/t06_publish/PublishShow5Test_gold new file mode 100644 index 00000000..7e6f4a2c --- /dev/null +++ b/system/t06_publish/PublishShow5Test_gold @@ -0,0 +1,5 @@ +Prefix: . +Distribution: wheezy +Architectures: i386 +Sources: + main: local-repo [local] diff --git a/system/t06_publish/PublishSnapshot42Test_gold b/system/t06_publish/PublishSnapshot42Test_gold new file mode 100644 index 00000000..8cf10f19 --- /dev/null +++ b/system/t06_publish/PublishSnapshot42Test_gold @@ -0,0 +1,13 @@ +Loading packages... +Generating metadata files and linking package files... +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: + +Snapshot snap1 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. diff --git a/system/t06_publish/PublishSourceAdd1Test_gold b/system/t06_publish/PublishSourceAdd1Test_gold index 8ac95d37..12c4aa07 100644 --- a/system/t06_publish/PublishSourceAdd1Test_gold +++ b/system/t06_publish/PublishSourceAdd1Test_gold @@ -1,3 +1,3 @@ -Adding component "test" with source "snap2" [snapshot]... +Adding component 'test' with source 'snap2' [snapshot]... You can run 'aptly publish update maverick .' to update the content of the published repository. diff --git a/system/t06_publish/PublishSourceAdd2Test_gold b/system/t06_publish/PublishSourceAdd2Test_gold index 904bfc81..fcdf6d02 100644 --- a/system/t06_publish/PublishSourceAdd2Test_gold +++ b/system/t06_publish/PublishSourceAdd2Test_gold @@ -1,4 +1,4 @@ -Adding component "test" with source "snap2" [snapshot]... -Adding component "other-test" with source "snap3" [snapshot]... +Adding component 'test' with source 'snap2' [snapshot]... +Adding component 'other-test' with source 'snap3' [snapshot]... You can run 'aptly publish update maverick .' to update the content of the published repository. diff --git a/system/t06_publish/PublishSourceAdd3Test_gold b/system/t06_publish/PublishSourceAdd3Test_gold index e5802b78..dd31661c 100644 --- a/system/t06_publish/PublishSourceAdd3Test_gold +++ b/system/t06_publish/PublishSourceAdd3Test_gold @@ -1 +1 @@ -ERROR: unable to add: component "main" has already been added +ERROR: unable to add: component 'main' has already been added diff --git a/system/t06_publish/PublishSourceRemove1Test_gold b/system/t06_publish/PublishSourceRemove1Test_gold index 761bf16b..40fcf4de 100644 --- a/system/t06_publish/PublishSourceRemove1Test_gold +++ b/system/t06_publish/PublishSourceRemove1Test_gold @@ -1,3 +1,3 @@ -Removing component "test" with source "snap2" [snapshot]... +Removing component 'test' with source 'snap2' [snapshot]... You can run 'aptly publish update maverick .' to update the content of the published repository. diff --git a/system/t06_publish/PublishSourceRemove2Test_gold b/system/t06_publish/PublishSourceRemove2Test_gold index 6692ca2e..f8270658 100644 --- a/system/t06_publish/PublishSourceRemove2Test_gold +++ b/system/t06_publish/PublishSourceRemove2Test_gold @@ -1,4 +1,4 @@ -Removing component "test" with source "snap2" [snapshot]... -Removing component "other-test" with source "snap3" [snapshot]... +Removing component 'test' with source 'snap2' [snapshot]... +Removing component 'other-test' with source 'snap3' [snapshot]... You can run 'aptly publish update maverick .' to update the content of the published repository. diff --git a/system/t06_publish/PublishSourceRemove3Test_gold b/system/t06_publish/PublishSourceRemove3Test_gold index 54507f25..d4ebcbb1 100644 --- a/system/t06_publish/PublishSourceRemove3Test_gold +++ b/system/t06_publish/PublishSourceRemove3Test_gold @@ -1 +1 @@ -ERROR: unable to remove: component "not-existent" does not exist +ERROR: unable to remove: component 'not-existent' does not exist diff --git a/system/t06_publish/PublishSourceUpdate1Test_gold b/system/t06_publish/PublishSourceUpdate1Test_gold index ea66b43f..2f218bf2 100644 --- a/system/t06_publish/PublishSourceUpdate1Test_gold +++ b/system/t06_publish/PublishSourceUpdate1Test_gold @@ -1,3 +1,3 @@ -Updating component "main" with source "snap2" [snapshot]... +Updating component 'main' with source 'snap2' [snapshot]... You can run 'aptly publish update maverick .' to update the content of the published repository. diff --git a/system/t06_publish/PublishSourceUpdate2Test_gold b/system/t06_publish/PublishSourceUpdate2Test_gold index 134f0d3f..88178e48 100644 --- a/system/t06_publish/PublishSourceUpdate2Test_gold +++ b/system/t06_publish/PublishSourceUpdate2Test_gold @@ -1,4 +1,4 @@ -Updating component "main" with source "snap2" [snapshot]... -Updating component "test" with source "snap3" [snapshot]... +Updating component 'main' with source 'snap2' [snapshot]... +Updating component 'test' with source 'snap3' [snapshot]... You can run 'aptly publish update maverick .' to update the content of the published repository. diff --git a/system/t06_publish/PublishSourceUpdate3Test_gold b/system/t06_publish/PublishSourceUpdate3Test_gold index 4d2fb4c8..c3e6eb88 100644 --- a/system/t06_publish/PublishSourceUpdate3Test_gold +++ b/system/t06_publish/PublishSourceUpdate3Test_gold @@ -1 +1 @@ -ERROR: unable to update: component "not-existent" does not exist +ERROR: unable to update: component 'not-existent' does not exist diff --git a/system/t06_publish/PublishSwitch11Test_gold b/system/t06_publish/PublishSwitch11Test_gold index 9d87127b..5f37e805 100644 --- a/system/t06_publish/PublishSwitch11Test_gold +++ b/system/t06_publish/PublishSwitch11Test_gold @@ -5,6 +5,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository ./maverick... +Cleaning up component 'main'... Published snapshot repository ./maverick [i386, source] publishes {main: [snap2]: Snapshot from local repo [local-repo2]} has been successfully switched to new source. diff --git a/system/t06_publish/PublishSwitch13Test_gold b/system/t06_publish/PublishSwitch13Test_gold index 271997f3..b9e7a75a 100644 --- a/system/t06_publish/PublishSwitch13Test_gold +++ b/system/t06_publish/PublishSwitch13Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository ./maverick... +Cleaning up component 'main'... Published snapshot repository ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new source. diff --git a/system/t06_publish/PublishSwitch15Test_gold b/system/t06_publish/PublishSwitch15Test_gold index 271997f3..b9e7a75a 100644 --- a/system/t06_publish/PublishSwitch15Test_gold +++ b/system/t06_publish/PublishSwitch15Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository ./maverick... +Cleaning up component 'main'... Published snapshot repository ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new source. diff --git a/system/t06_publish/PublishSwitch16Test_gold b/system/t06_publish/PublishSwitch16Test_gold index d3d1cd5b..6794c13d 100644 --- a/system/t06_publish/PublishSwitch16Test_gold +++ b/system/t06_publish/PublishSwitch16Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository ./bookworm... +Cleaning up component 'main'... Published snapshot repository ./bookworm (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new source. diff --git a/system/t06_publish/PublishSwitch1Test_gold b/system/t06_publish/PublishSwitch1Test_gold index 271997f3..b9e7a75a 100644 --- a/system/t06_publish/PublishSwitch1Test_gold +++ b/system/t06_publish/PublishSwitch1Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository ./maverick... +Cleaning up component 'main'... Published snapshot repository ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new source. diff --git a/system/t06_publish/PublishSwitch2Test_gold b/system/t06_publish/PublishSwitch2Test_gold index 7cc00d44..7cfc4f75 100644 --- a/system/t06_publish/PublishSwitch2Test_gold +++ b/system/t06_publish/PublishSwitch2Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "ppa" components main... +Cleaning up published repository ppa/maverick... +Cleaning up component 'main'... Published snapshot repository ppa/maverick [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick} has been successfully switched to new source. diff --git a/system/t06_publish/PublishSwitch3Test_gold b/system/t06_publish/PublishSwitch3Test_gold index 271997f3..b9e7a75a 100644 --- a/system/t06_publish/PublishSwitch3Test_gold +++ b/system/t06_publish/PublishSwitch3Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository ./maverick... +Cleaning up component 'main'... Published snapshot repository ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new source. diff --git a/system/t06_publish/PublishSwitch4Test_gold b/system/t06_publish/PublishSwitch4Test_gold index 899c3d53..74451164 100644 --- a/system/t06_publish/PublishSwitch4Test_gold +++ b/system/t06_publish/PublishSwitch4Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "ppa" components main... +Cleaning up published repository ppa/maverick... +Cleaning up component 'main'... Published snapshot repository ppa/maverick [i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick} has been successfully switched to new source. diff --git a/system/t06_publish/PublishSwitch8Test_gold b/system/t06_publish/PublishSwitch8Test_gold index a10e335f..44d1fdbe 100644 --- a/system/t06_publish/PublishSwitch8Test_gold +++ b/system/t06_publish/PublishSwitch8Test_gold @@ -3,6 +3,8 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components b, c... +Cleaning up published repository ./maverick... +Cleaning up component 'b'... +Cleaning up component 'c'... Published snapshot repository ./maverick [amd64, i386, source] publishes {a: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}, {b: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'}, {c: [local2]: Snapshot from local repo [local-repo]} has been successfully switched to new source. diff --git a/system/t06_publish/PublishUpdate10Test_gold b/system/t06_publish/PublishUpdate10Test_gold index 082275a3..010d5ec4 100644 --- a/system/t06_publish/PublishUpdate10Test_gold +++ b/system/t06_publish/PublishUpdate10Test_gold @@ -5,6 +5,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository ./maverick... +Cleaning up component 'main'... -Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated. +Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been updated successfully. diff --git a/system/t06_publish/PublishUpdate11Test_gold b/system/t06_publish/PublishUpdate11Test_gold index 05b56b2a..3be101c4 100644 --- a/system/t06_publish/PublishUpdate11Test_gold +++ b/system/t06_publish/PublishUpdate11Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository ./maverick... +Cleaning up component 'main'... -Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated. +Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been updated successfully. diff --git a/system/t06_publish/PublishUpdate12Test_gold b/system/t06_publish/PublishUpdate12Test_gold index 7488eec4..d3a202df 100644 --- a/system/t06_publish/PublishUpdate12Test_gold +++ b/system/t06_publish/PublishUpdate12Test_gold @@ -4,4 +4,4 @@ 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: -Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated. +Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been updated successfully. diff --git a/system/t06_publish/PublishUpdate13Test_gold b/system/t06_publish/PublishUpdate13Test_gold index 05b56b2a..3be101c4 100644 --- a/system/t06_publish/PublishUpdate13Test_gold +++ b/system/t06_publish/PublishUpdate13Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository ./maverick... +Cleaning up component 'main'... -Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated. +Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been updated successfully. diff --git a/system/t06_publish/PublishUpdate14Test_gold b/system/t06_publish/PublishUpdate14Test_gold index e0d3ab8c..12ddf71c 100644 --- a/system/t06_publish/PublishUpdate14Test_gold +++ b/system/t06_publish/PublishUpdate14Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository ./bookworm... +Cleaning up component 'main'... -Published local repository ./bookworm [i386, source] publishes {main: [local-repo]} has been successfully updated. +Published local repository ./bookworm [i386, source] publishes {main: [local-repo]} has been updated successfully. diff --git a/system/t06_publish/PublishUpdate15Test_gold b/system/t06_publish/PublishUpdate15Test_gold index ebd8ad24..a0624c8e 100644 --- a/system/t06_publish/PublishUpdate15Test_gold +++ b/system/t06_publish/PublishUpdate15Test_gold @@ -3,6 +3,6 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components ... +Cleaning up published repository ./maverick... -Published snapshot repository ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}, {other-test: [snap3]: Created as empty}, {test: [snap2]: Created as empty} has been successfully updated. +Published snapshot repository ./maverick (origin: LP-PPA-gladky-anton-gnuplot) [i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}, {other-test: [snap3]: Created as empty}, {test: [snap2]: Created as empty} has been updated successfully. diff --git a/system/t06_publish/PublishUpdate16Test_gold b/system/t06_publish/PublishUpdate16Test_gold index e989f216..927ac538 100644 --- a/system/t06_publish/PublishUpdate16Test_gold +++ b/system/t06_publish/PublishUpdate16Test_gold @@ -3,6 +3,12 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components ... +Cleaning up published repository ./maverick... +Removing component 'other-test'... +Removing ${HOME}/.aptly/public/dists/maverick/other-test... +Removing component 'test'... +Removing ${HOME}/.aptly/public/dists/maverick/test... +Removing ${HOME}/.aptly/public/pool/other-test... +Removing ${HOME}/.aptly/public/pool/test... -Published snapshot repository ./maverick [i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick} has been successfully updated. +Published snapshot repository ./maverick [i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick} has been updated successfully. diff --git a/system/t06_publish/PublishUpdate17Test_gold b/system/t06_publish/PublishUpdate17Test_gold index 9ad84577..69c0182f 100644 --- a/system/t06_publish/PublishUpdate17Test_gold +++ b/system/t06_publish/PublishUpdate17Test_gold @@ -3,6 +3,8 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components other-test, test... +Cleaning up published repository ./maverick... +Cleaning up component 'other-test'... +Cleaning up component 'test'... -Published snapshot repository ./maverick [i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}, {other-test: [snap5]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}, {test: [snap4]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick} has been successfully updated. +Published snapshot repository ./maverick [i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}, {other-test: [snap5]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}, {test: [snap4]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick} has been updated successfully. diff --git a/system/t06_publish/PublishUpdate18Test_gold b/system/t06_publish/PublishUpdate18Test_gold index 2e37b702..ca805720 100644 --- a/system/t06_publish/PublishUpdate18Test_gold +++ b/system/t06_publish/PublishUpdate18Test_gold @@ -3,6 +3,10 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components test... +Cleaning up published repository ./maverick... +Removing component 'main'... +Removing ${HOME}/.aptly/public/dists/maverick/main... +Removing ${HOME}/.aptly/public/pool/main... +Cleaning up component 'test'... -Published snapshot repository ./maverick [i386] publishes {other-test: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}, {test: [snap3]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick} has been successfully updated. +Published snapshot repository ./maverick [i386] publishes {other-test: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}, {test: [snap3]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick} has been updated successfully. diff --git a/system/t06_publish/PublishUpdate1Test_gold b/system/t06_publish/PublishUpdate1Test_gold index 05b56b2a..3be101c4 100644 --- a/system/t06_publish/PublishUpdate1Test_gold +++ b/system/t06_publish/PublishUpdate1Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository ./maverick... +Cleaning up component 'main'... -Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated. +Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been updated successfully. diff --git a/system/t06_publish/PublishUpdate2Test_gold b/system/t06_publish/PublishUpdate2Test_gold index 05b56b2a..3be101c4 100644 --- a/system/t06_publish/PublishUpdate2Test_gold +++ b/system/t06_publish/PublishUpdate2Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository ./maverick... +Cleaning up component 'main'... -Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated. +Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been updated successfully. diff --git a/system/t06_publish/PublishUpdate3Test_gold b/system/t06_publish/PublishUpdate3Test_gold index 05b56b2a..3be101c4 100644 --- a/system/t06_publish/PublishUpdate3Test_gold +++ b/system/t06_publish/PublishUpdate3Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository ./maverick... +Cleaning up component 'main'... -Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated. +Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been updated successfully. diff --git a/system/t06_publish/PublishUpdate4Test_gold b/system/t06_publish/PublishUpdate4Test_gold index 29502a02..c996227a 100644 --- a/system/t06_publish/PublishUpdate4Test_gold +++ b/system/t06_publish/PublishUpdate4Test_gold @@ -3,6 +3,6 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up component 'main' in prefix '.'... -Published local repository ./maverick [source] publishes {main: [local-repo]} has been successfully updated. +Published local repository ./maverick [source] publishes {main: [local-repo]} has been updated successfully. diff --git a/system/t06_publish/PublishUpdate7Test_gold b/system/t06_publish/PublishUpdate7Test_gold index a13b260c..b0f13d5c 100644 --- a/system/t06_publish/PublishUpdate7Test_gold +++ b/system/t06_publish/PublishUpdate7Test_gold @@ -3,6 +3,8 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components contrib, main... +Cleaning up published repository ./maverick... +Cleaning up component 'contrib'... +Cleaning up component 'main'... -Published local repository ./maverick [i386, source] publishes {contrib: [repo2]}, {main: [repo1]} has been successfully updated. +Published local repository ./maverick [i386, source] publishes {contrib: [repo2]}, {main: [repo1]} has been updated successfully. diff --git a/system/t06_publish/PublishUpdate8Test_gold b/system/t06_publish/PublishUpdate8Test_gold index 1a6ebd26..b69df45f 100644 --- a/system/t06_publish/PublishUpdate8Test_gold +++ b/system/t06_publish/PublishUpdate8Test_gold @@ -1,6 +1,8 @@ Loading packages... Generating metadata files and linking package files... Finalizing metadata files... -Cleaning up prefix "." components contrib, main... +Cleaning up published repository ./squeeze... +Cleaning up component 'contrib'... +Cleaning up component 'main'... -Published local repository ./squeeze [i386] publishes {contrib: [repo2]}, {main: [repo1]} has been successfully updated. +Published local repository ./squeeze [i386] publishes {contrib: [repo2]}, {main: [repo1]} has been updated successfully. diff --git a/system/t06_publish/S3Publish2Test_gold b/system/t06_publish/S3Publish2Test_gold index d6ffd382..cd68115c 100644 --- a/system/t06_publish/S3Publish2Test_gold +++ b/system/t06_publish/S3Publish2Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository s3:test1:./maverick... +Cleaning up component 'main'... -Published local repository s3:test1:./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated. +Published local repository s3:test1:./maverick [i386, source] publishes {main: [local-repo]} has been updated successfully. diff --git a/system/t06_publish/S3Publish3Test_gold b/system/t06_publish/S3Publish3Test_gold index 54c8a83e..348fbe81 100644 --- a/system/t06_publish/S3Publish3Test_gold +++ b/system/t06_publish/S3Publish3Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository s3:test1:./maverick... +Cleaning up component 'main'... Published snapshot repository s3:test1:./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new source. diff --git a/system/t06_publish/S3Publish5Test_gold b/system/t06_publish/S3Publish5Test_gold index cadce02c..0b8f635f 100644 --- a/system/t06_publish/S3Publish5Test_gold +++ b/system/t06_publish/S3Publish5Test_gold @@ -1,3 +1,4 @@ -Cleaning up prefix "." components main... +Cleaning up published repository s3:test1:./sq2... +Cleaning up component 'main'... Published repository has been removed successfully. diff --git a/system/t06_publish/S3Publish6Test_gold b/system/t06_publish/S3Publish6Test_gold index d6ffd382..cd68115c 100644 --- a/system/t06_publish/S3Publish6Test_gold +++ b/system/t06_publish/S3Publish6Test_gold @@ -3,6 +3,7 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up published repository s3:test1:./maverick... +Cleaning up component 'main'... -Published local repository s3:test1:./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated. +Published local repository s3:test1:./maverick [i386, source] publishes {main: [local-repo]} has been updated successfully. diff --git a/system/t06_publish/SwiftPublish2Test_gold b/system/t06_publish/SwiftPublish2Test_gold index 1ec018b6..40ce0140 100644 --- a/system/t06_publish/SwiftPublish2Test_gold +++ b/system/t06_publish/SwiftPublish2Test_gold @@ -3,6 +3,6 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up prefix '.' components main... -Published local repository swift:test1:./maverick [i386, source] publishes {main: [local-repo]} has been successfully updated. +Published local repository swift:test1:./maverick [i386, source] publishes {main: [local-repo]} has been updated successfully. diff --git a/system/t06_publish/SwiftPublish3Test_gold b/system/t06_publish/SwiftPublish3Test_gold index eab52653..d8334a59 100644 --- a/system/t06_publish/SwiftPublish3Test_gold +++ b/system/t06_publish/SwiftPublish3Test_gold @@ -3,6 +3,6 @@ Generating metadata files and linking package files... 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: -Cleaning up prefix "." components main... +Cleaning up prefix '.' components main... Published snapshot repository swift:test1:./maverick (origin: LP-PPA-gladky-anton-gnuplot) [amd64, i386] publishes {main: [snap3]: Pulled into 'snap2' with 'snap1' as source, pull request was: 'gnuplot-x11'} has been successfully switched to new snapshot. diff --git a/system/t06_publish/SwiftPublish5Test_gold b/system/t06_publish/SwiftPublish5Test_gold index cadce02c..b8a740ad 100644 --- a/system/t06_publish/SwiftPublish5Test_gold +++ b/system/t06_publish/SwiftPublish5Test_gold @@ -1,3 +1,3 @@ -Cleaning up prefix "." components main... +Cleaning up prefix '.' components main... Published repository has been removed successfully. diff --git a/system/t06_publish/show.py b/system/t06_publish/show.py index 7616b78e..a6f06824 100644 --- a/system/t06_publish/show.py +++ b/system/t06_publish/show.py @@ -51,3 +51,17 @@ class PublishShow4Test(BaseTest): "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 ppa/smira", ] runCmd = "aptly publish show -json maverick ppa/smira" + + +class PublishShow5Test(BaseTest): + """ + publish show: existing local repo + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly repo create -distribution=wheezy local-repo", + "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -architectures=i386 local-repo" + ] + runCmd = "aptly publish show wheezy" + gold_processor = BaseTest.expand_environ diff --git a/system/t06_publish/snapshot.py b/system/t06_publish/snapshot.py index 4514571d..aa3fb54e 100644 --- a/system/t06_publish/snapshot.py +++ b/system/t06_publish/snapshot.py @@ -1344,3 +1344,23 @@ class PublishSnapshot41Test(BaseTest): self.check_exists('public/pool/main/libx/libxslt/libxslt1.1_1.1.32-2.2~deb10u2_i386.deb') self.check_exists('public/pool/main/libz/libzstd/libzstd1_1.3.8+dfsg-3+deb10u2_i386.deb') self.check_exists('public/pool/main/z/zlib/zlib1g_1.2.11.dfsg-1+deb10u2_i386.deb') + + +class PublishSnapshot42Test(BaseTest): + """ + publish snapshot: mirror with multi-dist + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly snapshot create snap1 from mirror gnuplot-maverick", + ] + runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -multi-dist snap1" + gold_processor = BaseTest.expand_environ + + def check(self): + super(PublishSnapshot42Test, self).check() + self.check_not_exists( + 'public/pool/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb') + self.check_exists( + 'public/pool/maverick/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb') diff --git a/system/t08_db/CleanupDB9Test_publish_drop b/system/t08_db/CleanupDB9Test_publish_drop index c9303809..ee4bb6e3 100644 --- a/system/t08_db/CleanupDB9Test_publish_drop +++ b/system/t08_db/CleanupDB9Test_publish_drop @@ -1,4 +1,5 @@ Removing ${HOME}/.aptly/public/dists/def... -Cleaning up prefix "." components main... +Cleaning up published repository ./def... +Cleaning up component 'main'... Published repository has been removed successfully. diff --git a/system/t12_api/publish.py b/system/t12_api/publish.py index 4fe3f6f0..82751579 100644 --- a/system/t12_api/publish.py +++ b/system/t12_api/publish.py @@ -1402,6 +1402,58 @@ class PublishSourcesListAPITestRepo(APITest): self.check_equal(sources_expected, sources.json()) +class PublishSourceReplaceAPITestRepo(APITest): + """ + PUT /publish/:prefix/:distribution/sources/main + """ + fixtureGpg = True + + def check(self): + repo1_name = self.random_name() + self.check_equal(self.post( + "/api/repos", json={"Name": repo1_name, "DefaultDistribution": "wheezy"}).status_code, 201) + + d = self.random_name() + self.check_equal(self.upload("/api/files/" + d, + "libboost-program-options-dev_1.49.0.1_i386.deb", "pyspi_0.6.1-1.3.dsc", + "pyspi_0.6.1-1.3.diff.gz", "pyspi_0.6.1.orig.tar.gz", + "pyspi-0.6.1-1.3.stripped.dsc").status_code, 200) + + self.check_equal(self.post("/api/repos/" + repo1_name + "/file/" + d).status_code, 200) + + repo2_name = self.random_name() + self.check_equal(self.post( + "/api/repos", json={"Name": repo2_name, "DefaultDistribution": "wheezy"}).status_code, 201) + + d = self.random_name() + self.check_equal(self.upload("/api/files/" + d, + "libboost-program-options-dev_1.49.0.1_i386.deb").status_code, 200) + + self.check_equal(self.post("/api/repos/" + repo2_name + "/file/" + d).status_code, 200) + + # publishing under prefix, default distribution + prefix = self.random_name() + self.check_equal(self.post( + "/api/publish/" + prefix, + json={ + "SourceKind": "local", + "Sources": [{"Component": "main", "Name": repo1_name}], + "Signing": DefaultSigningOptions, + } + ).status_code, 201) + + # Actual test + self.check_equal(self.put( + "/api/publish/" + prefix + "/wheezy/sources/main", + json={"Component": "test", "Name": repo2_name} + ).status_code, 200) + + sources_expected = [{"Component": "test", "Name": repo2_name}] + sources = self.get("/api/publish/" + prefix + "/wheezy/sources") + self.check_equal(sources.status_code, 200) + self.check_equal(sources_expected, sources.json()) + + class PublishUpdateSourcesAPITestRepo(APITest): """ POST /publish/:prefix/:distribution/update