diff --git a/api/publish.go b/api/publish.go index 2e3b431a8..79543f889 100644 --- a/api/publish.go +++ b/api/publish.go @@ -225,7 +225,7 @@ func apiPublishRepoOrSnapshot(c *gin.Context) { return &task.ProcessReturnValue{Code: http.StatusBadRequest, Value: nil}, fmt.Errorf("prefix/distribution already used by another published repo: %s", duplicate) } - err := published.Publish(context.PackagePool(), context, collectionFactory, signer, context.AddonPath(), publishOutput, b.ForceOverwrite) + err := published.Publish(context.PackagePool(), context, collectionFactory, signer, context.SkelPath(), publishOutput, b.ForceOverwrite) if err != nil { return &task.ProcessReturnValue{Code: http.StatusInternalServerError, Value: nil}, fmt.Errorf("unable to publish: %s", err) } @@ -340,7 +340,7 @@ func apiPublishUpdateSwitch(c *gin.Context) { resources = append(resources, string(published.Key())) taskName := fmt.Sprintf("Update published %s (%s): %s", published.SourceKind, strings.Join(updatedComponents, " "), strings.Join(updatedSnapshots, ", ")) maybeRunTaskInBackground(c, taskName, resources, func(out aptly.Progress, detail *task.Detail) (*task.ProcessReturnValue, error) { - err := published.Publish(context.PackagePool(), context, collectionFactory, signer, context.AddonPath(), out, b.ForceOverwrite) + err := published.Publish(context.PackagePool(), context, collectionFactory, signer, context.SkelPath(), out, b.ForceOverwrite) if err != nil { return &task.ProcessReturnValue{Code: http.StatusInternalServerError, Value: nil}, fmt.Errorf("unable to update: %s", err) } diff --git a/cmd/publish_snapshot.go b/cmd/publish_snapshot.go index 113b8c444..12c66ffac 100644 --- a/cmd/publish_snapshot.go +++ b/cmd/publish_snapshot.go @@ -166,7 +166,7 @@ func aptlyPublishSnapshotOrRepo(cmd *commander.Command, args []string) error { "the same package pool.\n") } - err = published.Publish(context.PackagePool(), context, collectionFactory, signer, context.AddonPath(), context.Progress(), forceOverwrite) + err = published.Publish(context.PackagePool(), context, collectionFactory, signer, context.SkelPath(), context.Progress(), forceOverwrite) if err != nil { return fmt.Errorf("unable to publish: %s", err) } diff --git a/cmd/publish_switch.go b/cmd/publish_switch.go index 9e0704847..041342cb4 100644 --- a/cmd/publish_switch.go +++ b/cmd/publish_switch.go @@ -100,7 +100,7 @@ func aptlyPublishSwitch(cmd *commander.Command, args []string) error { published.SkipBz2 = context.Flags().Lookup("skip-bz2").Value.Get().(bool) } - err = published.Publish(context.PackagePool(), context, collectionFactory, signer, context.AddonPath(), context.Progress(), forceOverwrite) + err = published.Publish(context.PackagePool(), context, collectionFactory, signer, context.SkelPath(), context.Progress(), forceOverwrite) if err != nil { return fmt.Errorf("unable to publish: %s", err) } diff --git a/cmd/publish_update.go b/cmd/publish_update.go index de7dcf5e1..f8e84817f 100644 --- a/cmd/publish_update.go +++ b/cmd/publish_update.go @@ -64,7 +64,7 @@ func aptlyPublishUpdate(cmd *commander.Command, args []string) error { published.SkipBz2 = context.Flags().Lookup("skip-bz2").Value.Get().(bool) } - err = published.Publish(context.PackagePool(), context, collectionFactory, signer, context.AddonPath(), context.Progress(), forceOverwrite) + err = published.Publish(context.PackagePool(), context, collectionFactory, signer, context.SkelPath(), context.Progress(), forceOverwrite) if err != nil { return fmt.Errorf("unable to publish: %s", err) } diff --git a/context/context.go b/context/context.go index 4d3b9dc1e..5343dbc1f 100644 --- a/context/context.go +++ b/context/context.go @@ -496,9 +496,9 @@ func (context *AptlyContext) GetVerifier() pgp.Verifier { return pgp.NewGpgVerifier(context.getGPGFinder(provider)) } -// AddonPath builds the local addon folder -func (context *AptlyContext) AddonPath() string { - return filepath.Join(context.config().RootDir, "addon") +// SkelPath builds the local skeleton folder +func (context *AptlyContext) SkelPath() string { + return filepath.Join(context.config().RootDir, "skel") } // UpdateFlags sets internal copy of flags in the context diff --git a/deb/index_files.go b/deb/index_files.go index a23f688f0..4ff03d36e 100644 --- a/deb/index_files.go +++ b/deb/index_files.go @@ -384,8 +384,8 @@ func (files *indexFiles) LegacyContentsIndex(arch string, udeb bool) *indexFile return file } -func (files *indexFiles) AddonIndex(component, path string) *indexFile { - key := fmt.Sprintf("ai-%s-%s", component, path) +func (files *indexFiles) SkelIndex(component, path string) *indexFile { + key := fmt.Sprintf("si-%s-%s", component, path) file, ok := files.indexes[key] if !ok { diff --git a/deb/publish.go b/deb/publish.go index 6445ec50d..389892965 100644 --- a/deb/publish.go +++ b/deb/publish.go @@ -549,16 +549,16 @@ func (p *PublishedRepo) GetCodename() string { return p.Codename } -// GetAddonFiles returns a map of files to be added to a repo. Key being the relative +// GetSkelFiles returns a map of files to be added to a repo. Key being the relative // path from component folder, and value being the full local FS path. -func (p *PublishedRepo) GetAddonFiles(addonDir string, component string) (map[string]string, error) { +func (p *PublishedRepo) GetSkelFiles(skelDir string, component string) (map[string]string, error) { files := make(map[string]string) - if addonDir == "" { + if skelDir == "" { return files, nil } - fsPath := filepath.Join(addonDir, p.Prefix, "dists", p.Distribution, component) + fsPath := filepath.Join(skelDir, p.Prefix, "dists", p.Distribution, component) if err := filepath.Walk(fsPath, func(path string, info os.FileInfo, err error) error { if err != nil { return err @@ -589,7 +589,7 @@ func (p *PublishedRepo) GetAddonFiles(addonDir string, component string) (map[st // Publish publishes snapshot (repository) contents, links package files, generates Packages & Release files, signs them func (p *PublishedRepo) Publish(packagePool aptly.PackagePool, publishedStorageProvider aptly.PublishedStorageProvider, - collectionFactory *CollectionFactory, signer pgp.Signer, addonDirectory string, progress aptly.Progress, forceOverwrite bool) error { + collectionFactory *CollectionFactory, signer pgp.Signer, skelDir string, progress aptly.Progress, forceOverwrite bool) error { publishedStorage := publishedStorageProvider.GetPublishedStorage(p.Storage) err := publishedStorage.MkDir(filepath.Join(p.Prefix, "pool")) @@ -790,25 +790,25 @@ func (p *PublishedRepo) Publish(packagePool aptly.PackagePool, publishedStorageP } for component := range p.sourceItems { - addonFiles, err := p.GetAddonFiles(addonDirectory, component) + skelFiles, err := p.GetSkelFiles(skelDir, component) if err != nil { - return fmt.Errorf("unable to get addon files: %v", err) + return fmt.Errorf("unable to get skeleton files: %v", err) } - for relPath, absPath := range addonFiles { - bufWriter, err := indexes.AddonIndex(component, relPath).BufWriter() + for relPath, absPath := range skelFiles { + bufWriter, err := indexes.SkelIndex(component, relPath).BufWriter() if err != nil { - return fmt.Errorf("unable to generate addon index: %v", err) + return fmt.Errorf("unable to generate skeleton index: %v", err) } file, err := os.Open(absPath) if err != nil { - return fmt.Errorf("unable to read addon file: %v", err) + return fmt.Errorf("unable to read skeleton file: %v", err) } _, err = bufio.NewReader(file).WriteTo(bufWriter) if err != nil { - return fmt.Errorf("unable to write addon file: %v", err) + return fmt.Errorf("unable to write skeleton file: %v", err) } } } diff --git a/man/aptly.1.ronn.tmpl b/man/aptly.1.ronn.tmpl index c75897d48..99fad0ea4 100644 --- a/man/aptly.1.ronn.tmpl +++ b/man/aptly.1.ronn.tmpl @@ -106,7 +106,7 @@ Options: * `rootDir`: is root of directory storage to store database (`rootDir`/db), downloaded packages (`rootDir`/pool), - the default for published repositories (`rootDir`/public) and addon files (`rootDir`/addon) + the default for published repositories (`rootDir`/public) and skeleton files (`rootDir`/skel) * `downloadConcurrency`: is a number of parallel download threads to use when downloading packages diff --git a/system/t06_publish/repo.py b/system/t06_publish/repo.py index 006e70064..9d46ad824 100644 --- a/system/t06_publish/repo.py +++ b/system/t06_publish/repo.py @@ -892,7 +892,7 @@ def check(self): class PublishRepo34Test(BaseTest): """ - publish repo: addon files + publish repo: skeleton files """ fixtureCmds = [ "aptly repo create local-repo", @@ -904,7 +904,7 @@ class PublishRepo34Test(BaseTest): def prepare_fixture(self): super(PublishRepo34Test, self).prepare_fixture() - self.write_file(os.path.join('addon', 'dists', 'maverick', 'main', 'dep11', 'README'), 'README test file') + self.write_file(os.path.join('skel', 'dists', 'maverick', 'main', 'dep11', 'README'), 'README test file') def check(self): super(PublishRepo34Test, self).check()