@@ -125,6 +125,29 @@ func makeUpstreamSourceTarball(gopkg string) (string, string, map[string]bool, s
125
125
log .Printf ("WARNING: ignoring debian/ directory that came with the upstream sources\n " )
126
126
}
127
127
128
+ vendorpath := filepath .Join (tempdir , "src" , gopkg , "vendor" )
129
+
130
+ if _ , err := os .Stat (vendorpath ); err == nil {
131
+ files , _ := filepath .Glob (filepath .Join (vendorpath , "*.go" ))
132
+ if len (files ) == 0 {
133
+ log .Printf ("WARNING: ignoring vendor/ directory that came with the upstream sources, and reinstalling dependencies\n " )
134
+ os .RemoveAll (vendorpath )
135
+ go progressSize ("go get" , filepath .Join (tempdir , "src" ), done )
136
+ cmd := exec .Command ("go" , "get" , "-d" , "-t" , "./..." )
137
+ cmd .Stderr = os .Stderr
138
+ cmd .Env = append ([]string {
139
+ fmt .Sprintf ("GOPATH=%s" , tempdir ),
140
+ }, passthroughEnv ()... )
141
+ cmd .Dir = filepath .Join (tempdir , "src" , gopkg )
142
+ if err := cmd .Run (); err != nil {
143
+ done <- true
144
+ return "" , "" , dependencies , autoPkgType , err
145
+ }
146
+ done <- true
147
+ fmt .Printf ("\r " )
148
+ }
149
+ }
150
+
128
151
f , err := ioutil .TempFile ("" , "dh-make-golang" )
129
152
tempfile := f .Name ()
130
153
f .Close ()
@@ -136,7 +159,6 @@ func makeUpstreamSourceTarball(gopkg string) (string, string, map[string]bool, s
136
159
tempfile ,
137
160
"--exclude-vcs" ,
138
161
"--exclude=Godeps" ,
139
- "--exclude=vendor" ,
140
162
fmt .Sprintf ("--exclude=%s/debian" , base ),
141
163
base )
142
164
cmd .Dir = filepath .Join (tempdir , "src" , dir )
0 commit comments