[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lxc-devel
Subject:    [lxc-devel] [distrobuilder/master] sources: Use correct openSUSE tarball
From:       monstermunchkin on Github <lxc-bot () linuxcontainers ! org>
Date:       2019-02-28 13:03:04
Message-ID: 5c77dc08.1c69fb81.36a78.8a57SMTPIN_ADDED_MISSING () mx ! google ! com
[Download RAW message or body]

[Attachment #2 (text/x-mailbox)]

The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/distrobuilder/pull/143

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>

[Attachment #3 (text/plain)]

From 9298056d8fa1802bee753db103672a00f11eae2a Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp@canonical.com>
Date: Thu, 28 Feb 2019 14:01:07 +0100
Subject: [PATCH] sources: Use correct openSUSE tarball

Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
---
 sources/opensuse-http.go | 26 ++++----------------------
 1 file changed, 4 insertions(+), 22 deletions(-)

diff --git a/sources/opensuse-http.go b/sources/opensuse-http.go
index 4bb29c9..753e17d 100644
--- a/sources/opensuse-http.go
+++ b/sources/opensuse-http.go
@@ -12,9 +12,9 @@ import (
 	"path/filepath"
 	"strings"
 
-	"github.com/lxc/distrobuilder/shared"
 	lxd "github.com/lxc/lxd/shared"
-	"gopkg.in/antchfx/htmlquery.v1"
+
+	"github.com/lxc/distrobuilder/shared"
 )
 
 // OpenSUSEHTTP represents the OpenSUSE HTTP downloader.
@@ -102,25 +102,6 @@ func (s *OpenSUSEHTTP) Run(definition shared.Definition, \
rootfsDir string) error  return lxd.Unpack(filepath.Join(fpath, fname), rootfsDir, \
false, false, nil)  }
 
-func (s *OpenSUSEHTTP) getLatestBuild(URL string) string {
-	doc, err := htmlquery.LoadURL(URL)
-	if err != nil {
-		return ""
-	}
-
-	if doc == nil {
-		return ""
-	}
-
-	nodes := htmlquery.Find(doc, `//a[starts-with(text(),'opensuse')][ends-with(text(), \
                'tar.xz')][@href]/text()`)
-
-	if nodes == nil {
-		return ""
-	}
-
-	return nodes[len(nodes)-1].Data
-}
-
 func (s *OpenSUSEHTTP) getPathToTarball(baseURL string, release string, arch string) \
string {  u, err := url.Parse(baseURL)
 	if err != nil {
@@ -157,7 +138,8 @@ func (s *OpenSUSEHTTP) getPathToTarball(baseURL string, release \
string, arch str  u.Path = path.Join(u.Path, "containers_ports")
 		}
 
-		u.Path = path.Join(u.Path, s.getLatestBuild(u.String()))
+		u.Path = path.Join(u.Path, fmt.Sprintf("opensuse-leap-%s-image.%s-lxc.tar.xz", \
release, +			arch))
 	}
 
 	return u.String()


[Attachment #4 (text/plain)]

_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic