From e1751ab0a8d8ef7fbc5c69bfd1a14573e6aa080a Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Sun, 3 Jun 2018 23:45:03 +0100 Subject: added Origin: in package page --- config.go | 7 ++++--- config.yml | 2 ++ deb822/package.go | 3 +++ template.go | 8 ++++---- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/config.go b/config.go index 72a5665..33c4e9f 100644 --- a/config.go +++ b/config.go @@ -17,9 +17,10 @@ type SuiteCfg struct { } type ReleaseCfg struct { - Release string `yaml:"Release"` - RepoURL string `yaml:"RepoURL"` - Suites []SuiteCfg `yaml:"Suites"` + Release string `yaml:"Release"` + RepoURL string `yaml:"RepoURL"` + ReleaseIndex string `yaml:"ReleaseIndex"` + Suites []SuiteCfg `yaml:"Suites"` } type PkgwebCfg struct { diff --git a/config.yml b/config.yml index 127ec8d..6802e2f 100644 --- a/config.yml +++ b/config.yml @@ -4,6 +4,7 @@ PkgSets: { Release: "ascii", RepoURL: "http://pkgmaster.devuan.org", + ReleaseIndex: "index_ascii.txt", Suites: [ { Name: "ascii", @@ -19,6 +20,7 @@ PkgSets: { Release: "experimental", RepoURL: "http://pkgmaster.devuan.org", + ReleaseIndex: "index_experimental.txt", Suites: [ { diff --git a/deb822/package.go b/deb822/package.go index 525f112..f7352a7 100644 --- a/deb822/package.go +++ b/deb822/package.go @@ -24,6 +24,7 @@ type Package struct { Component string Section string Priority string + Origin string } var regexpRemove = regexp.MustCompile("(DEVUAN/|DEBIAN/|[0-9]+:)") @@ -61,6 +62,8 @@ func NewPackage(s Stanza) (Package, error) { } p.Section = s["Section"] p.Priority = s["Priority"] + p.Origin = strings.Title(strings.ToLower(strings.Split(s["Filename"], "/")[1])) + fmt.Printf("p.Origin: %s\n", p.Origin) return p, nil } diff --git a/template.go b/template.go index 85a93f8..5e30f06 100644 --- a/template.go +++ b/template.go @@ -70,9 +70,9 @@ div.provides{ Search Devuan Packages for: in release @@ -80,7 +80,7 @@ Search Devuan Packages for: in release
{{.Name}} {{.Version}} [{{.Section}} - {{.Priority}}]
-
[{{.Suite}} - {{.Component}}]
+
[Origin: {{.Origin}} - {{.Suite}} - {{.Component}}]
{{.Description}}
-- cgit v1.2.3