diff options
author | KatolaZ <katolaz@freaknet.org> | 2018-01-13 23:44:19 +0000 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2018-01-13 23:44:19 +0000 |
commit | 704c8957b2d3958ff6e030c0badc75f808ea8a9f (patch) | |
tree | baa8ca4b2aa6a56b554f196cde54bc4f43958325 /deb822 | |
parent | 44e6a294f5aab03af34c8c7623443e41867bb921 (diff) |
Distinct dest dir for each release
Diffstat (limited to 'deb822')
-rw-r--r-- | deb822/package.go | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/deb822/package.go b/deb822/package.go index 41a9613..525f112 100644 --- a/deb822/package.go +++ b/deb822/package.go @@ -79,7 +79,7 @@ func PrintPackage(p Package, templ string, out io.Writer) { /*Stanza2HtmlPage Render the html webpage of a package and save it in the /* corresponding "pool" directory. */ -func Stanza2HtmlPage(s Stanza, templ string, baseDir string, suite string, component string) error { +func Stanza2HtmlPage(s Stanza, templ string, baseDir string, release string, suite string, component string) error { fname := s["Filename"] if fname == "" { @@ -91,21 +91,17 @@ func Stanza2HtmlPage(s Stanza, templ string, baseDir string, suite string, compo if err != nil { log.Fatal("empty package!!!") } - nameVersion := fmt.Sprintf("%s_%s", p.Name, p.Version) - //fmt.Printf(" nameVersion: %s\n", nameVersion) - //fmt.Printf(" baseDir: %s\n", baseDir) + //nameVersion := fmt.Sprintf("%s_%s", p.Name, p.Version) fname = regexpRemove.ReplaceAllString(fname, "") - //fmt.Printf(" fname: %s\n", fname) - - /// FIXME!!!! ERROR IN DETECTION OF PACKAGE NAME!!!! - dirName := fmt.Sprintf("%s/%s", baseDir, strings.Split(fname, nameVersion)[0]) + //dirName := fmt.Sprintf("%s/%s", baseDir, strings.Split(fname, nameVersion)[0]) + dirName := fmt.Sprintf("%s/%s/%s/", baseDir, release, suite) err = os.MkdirAll(dirName, 0755) if err == nil { - //fmt.Printf(" dirName: %s\n Package: %s\n Version: %s\n", dirName, p.Name, p.Version) + //htmlFile := fmt.Sprintf("%s%s_%s.html", dirName, p.Name, p.Version) htmlFile := fmt.Sprintf("%s%s_%s.html", dirName, p.Name, p.Version) - //fmt.Printf("Creating file: %s\n---------\n", htmlFile) + if f, err := os.Open(htmlFile); err == nil { f.Close() fmt.Fprintf(os.Stderr, " Skipping %s -- it exists\n", htmlFile) |