aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Magorsch <arzano@gentoo.org>2020-05-31 14:38:19 +0200
committerMax Magorsch <arzano@gentoo.org>2020-05-31 14:38:19 +0200
commitf75bb7f29ec8264125596a123c6f712d26ce27ae (patch)
treeb1df86a54e976536834e93229316bc16dca79fb7 /pkg/app/handler/packages/utils.go
parentUse the gorilla feeds for the arches feeds (diff)
downloadsoko-f75bb7f29ec8264125596a123c6f712d26ce27ae.tar.gz
soko-f75bb7f29ec8264125596a123c6f712d26ce27ae.tar.bz2
soko-f75bb7f29ec8264125596a123c6f712d26ce27ae.zip
Clean up redundant code
Signed-off-by: Max Magorsch <arzano@gentoo.org>
Diffstat (limited to 'pkg/app/handler/packages/utils.go')
-rw-r--r--pkg/app/handler/packages/utils.go25
1 files changed, 0 insertions, 25 deletions
diff --git a/pkg/app/handler/packages/utils.go b/pkg/app/handler/packages/utils.go
index dfece1a..d9ce6e1 100644
--- a/pkg/app/handler/packages/utils.go
+++ b/pkg/app/handler/packages/utils.go
@@ -5,8 +5,6 @@ package packages
import (
"crypto/md5"
"encoding/hex"
- "fmt"
- "github.com/gorilla/feeds"
"github.com/go-pg/pg"
"github.com/go-pg/pg/v9/orm"
"html/template"
@@ -19,7 +17,6 @@ import (
"sort"
"strings"
textTemplate "text/template"
- "time"
)
// getAddedPackages returns a list of recently added
@@ -128,28 +125,6 @@ func GetKeywordedVersions(n int) []*models.Version {
return keywordedVersions
}
-// addFeedItems is a helper to add items to a feed; most of the feeds use []*models.Version as the entity.
-func addFeedItems(f *feeds.Feed, versions []*models.Version) {
- for _, version := range versions {
- cpv := fmt.Sprintf("%s-%s", version.Atom, version.Version)
- item := &feeds.Item{
- Title: cpv,
- Link: &feeds.Link{Href: fmt.Sprintf("https://packages.gentoo.org/package/%s", version.Atom)},
- Description: version.Description,
- Author: &feeds.Author{Name: "unknown"},
- Created: time.Now(),
- }
- if len(version.Commits) > 0 {
- lastCommit := version.Commits[0]
- item.Author = &feeds.Author{Name: lastCommit.CommitterName}
- item.Created = lastCommit.CommitterDate
- item.Content = fmt.Sprintf("%s is now available in Gentoo on these architectures: %s. See <a href='https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=%s'>Gitweb</a>",
- cpv, version.Keywords, lastCommit.Id)
- }
- f.Add(item)
- }
-}
-
// RenderPackageTemplates renders the given templates using the given data
// One pattern can be used to specify templates
func renderPackageTemplate(page string, templatepattern string, funcMap template.FuncMap, data interface{}, w http.ResponseWriter) {