From ae0b7ac7d3d8b10fe5862a9d7268f559c4a4e445 Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Wed, 10 Jan 2018 23:23:10 +0000 Subject: added Recommends --- d1pkgweb.go | 23 +++++++++++++++++++++-- deb822/package.go | 9 ++++++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/d1pkgweb.go b/d1pkgweb.go index d416e27..60c761f 100644 --- a/d1pkgweb.go +++ b/d1pkgweb.go @@ -48,6 +48,17 @@ li.dep_item{ margin-left: 35px; } +div.rec_list { + margin-top:20px; + margin-left: 20px; +} + +li.rec_item{ + margin-left: 35px; +} + + +
{{.Name}} {{.Version}}
@@ -61,10 +72,18 @@ li.dep_item{
Depends:
    -{{range .Depends}}
  • {{ . }}
  • -{{else}}
    No depends
    {{end}} +{{range .Depends}}
  • {{ . }}
  • {{end}}
+ +
+Recommends: +
    +{{range .Recommends}}
  • {{ . }}
  • {{end}} +
+
+ +
Maintainer: {{.Maintainer}}
diff --git a/deb822/package.go b/deb822/package.go index df444ea..3c1c172 100644 --- a/deb822/package.go +++ b/deb822/package.go @@ -16,6 +16,7 @@ type Package struct { Description string LongDescription string Depends []string + Recommends []string Maintainer string Filename string } @@ -41,7 +42,13 @@ func NewPackage(s Stanza) (Package, error) { } p.Maintainer = s["Maintainer"] p.Depends = strings.Split(s["Depends"], ",") - + if len(p.Depends) == 0 { + p.Depends = nil + } + p.Recommends = strings.Split(s["Recommends"], ",") + if len(p.Recommends) == 0 { + p.Recommends = nil + } return p, nil } -- cgit v1.2.3