~sircmpwn/sr.ht-dev

git.sr.ht: Warn when we'd submit duplicate-basename manifest v1 PROPOSED

наб: 1
 Warn when we'd submit duplicate-basename manifest

 1 files changed, 7 insertions(+), 1 deletions(-)
#304923 alpine.yml failed
#304924 archlinux.yml failed
#304925 debian.yml failed
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/13899/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH git.sr.ht] Warn when we'd submit duplicate-basename manifest Export this patch

---
 gitsrht-update-hook/submitter.go | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gitsrht-update-hook/submitter.go b/gitsrht-update-hook/submitter.go
index e50174c..5c96857 100644
--- a/gitsrht-update-hook/submitter.go
+++ b/gitsrht-update-hook/submitter.go
@@ -162,6 +162,12 @@ func (submitter GitBuildSubmitter) FindManifests() (map[string]string, error) {

	manifests := make(map[string]string)
	for _, file := range files {
		basename := path.Base(file.Name)
		if _, ok := manifests[basename]; ok {
			log.Printf("Not submitting duplicate manifest %s [%s]\n", file.Name, basename)
			continue
		}

		var (
			reader  io.Reader
			content []byte
@@ -175,7 +181,7 @@ func (submitter GitBuildSubmitter) FindManifests() (map[string]string, error) {
		if !utf8.Valid(content) {
			return nil, errors.Wrap(err, "manifest is not valid UTF-8 file")
		}
		manifests[path.Base(file.Name)] = string(content)
		manifests[basename] = string(content)
	}
	return manifests, nil
}
-- 
2.20.1
Thanks!

To git@git.sr.ht:~sircmpwn/git.sr.ht
   5dae4f3..0c45d64  master -> master
builds.sr.ht
git.sr.ht/patches: FAILED in 23m7s

[Warn when we'd submit duplicate-basename manifest][0] from [наб][1]

[0]: https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/13899
[1]: mailto:nabijaczleweli@nabijaczleweli.xyz

✗ #304923 FAILED git.sr.ht/patches/alpine.yml    https://builds.sr.ht/~sircmpwn/job/304923
✗ #304924 FAILED git.sr.ht/patches/archlinux.yml https://builds.sr.ht/~sircmpwn/job/304924
✗ #304925 FAILED git.sr.ht/patches/debian.yml    https://builds.sr.ht/~sircmpwn/job/304925