@@ -107,6 +107,7 @@ type upstream struct {
107
107
tarPath string // path to the downloaded or generated orig tarball tempfile
108
108
compression string // compression method, either "gz" or "xz"
109
109
version string // Debian package upstream version number, e.g. 0.0~git20180204.1d24609
110
+ tag string // Latest upstream tag, if any
110
111
commitIsh string // commit-ish corresponding to upstream version to be packaged
111
112
remote string // git remote, set to short hostname if upstream git history is included
112
113
firstMain string // import path of the first main package within repo, if any
@@ -144,16 +145,16 @@ func (u *upstream) tarballFromHoster() error {
144
145
145
146
switch repoU .Host {
146
147
case "github.com" :
147
- tarURL = fmt .Sprintf ("%s/archive/v %s.tar.%s" ,
148
- repo , u .version , u .compression )
148
+ tarURL = fmt .Sprintf ("%s/archive/%s.tar.%s" ,
149
+ repo , u .tag , u .compression )
149
150
case "gitlab.com" :
150
151
parts := strings .Split (repoU .Path , "/" )
151
152
if len (parts ) < 3 {
152
153
return fmt .Errorf ("Incomplete repo URL: %s" , u .rr .Repo )
153
154
}
154
155
project := parts [2 ]
155
- tarURL = fmt .Sprintf ("%s/-/archive/v%[3] s/%[2] s-%s.tar.%s" ,
156
- repo , project , u .version , u .compression )
156
+ tarURL = fmt .Sprintf ("%s/-/archive/% s/%s-%s.tar.%s" ,
157
+ repo , u . tag , project , u .tag , u .compression )
157
158
default :
158
159
return fmt .Errorf ("Unsupported hoster" )
159
160
}
0 commit comments