diff options
-rw-r--r-- | d1pkgweb.go | 23 | ||||
-rw-r--r-- | 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; +} + + + </style> <div class="pkgname">{{.Name}} {{.Version}}</div> <div class="description"> @@ -61,10 +72,18 @@ li.dep_item{ <div class="dep_list"> Depends: <ul> -{{range .Depends}}<li class="dep_item">{{ . }}</li> -{{else}}<div>No depends</div>{{end}} +{{range .Depends}}<li class="dep_item">{{ . }}</li>{{end}} </ul> </div> + +<div class="rec_list"> +Recommends: +<ul> +{{range .Recommends}}<li class="rec_item">{{ . }}</li>{{end}} +</ul> +</div> + + <div class="maintainer"> Maintainer: {{.Maintainer}} </div> 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 } |