@@ -142,6 +142,13 @@ func trackerLink(pkg string) string {
142
142
return fmt .Sprintf ("\033 ]8;;https://tracker.debian.org/pkg/%[1]s\033 \\ %[1]s\033 ]8;;\033 \\ " , pkg )
143
143
}
144
144
145
+ // newPackageLine generates a line for packages in NEW, including an OSC 8
146
+ // hyperlink to the FTP masters website for the given Debian package.
147
+ func newPackageLine (indent int , mod , debpkg , version string ) string {
148
+ const format = "%s\033 [36m%s (\033 ]8;;https://ftp-master.debian.org/new/%s_%s.html\033 \\ in NEW\033 ]8;;\033 \\ )\033 [0m"
149
+ return fmt .Sprintf (format , strings .Repeat (" " , indent ), mod , debpkg , version )
150
+ }
151
+
145
152
func estimate (importpath , revision string ) error {
146
153
removeTemp := func (path string ) {
147
154
if err := forceRemoveAll (path ); err != nil {
@@ -267,8 +274,8 @@ func estimate(importpath, revision string) error {
267
274
return
268
275
}
269
276
if pkg , ok := golangBinaries [mod ]; ok {
270
- if _ , ok := sourcesInNew [pkg .source ]; ok {
271
- line := fmt . Sprintf ( "%s \033 [36m%s (in NEW) \033 [0m" , strings . Repeat ( " " , indent ), mod )
277
+ if version , ok := sourcesInNew [pkg .source ]; ok {
278
+ line := newPackageLine ( indent , mod , pkg . source , version )
272
279
lines = append (lines , line )
273
280
}
274
281
return // already packaged in Debian
@@ -291,8 +298,8 @@ func estimate(importpath, revision string) error {
291
298
} else {
292
299
log .Printf ("%s is v%d in Debian (%s)" , mod , v , trackerLink (pkg .source ))
293
300
}
294
- if _ , ok := sourcesInNew [pkg .source ]; ok {
295
- line := fmt . Sprintf ( "%s \033 [36m%s (in NEW) \033 [0m" , strings . Repeat ( " " , indent ), mod )
301
+ if version , ok := sourcesInNew [pkg .source ]; ok {
302
+ line := newPackageLine ( indent , mod , pkg . source , version )
296
303
lines = append (lines , line )
297
304
}
298
305
return
@@ -304,8 +311,8 @@ func estimate(importpath, revision string) error {
304
311
// Log info to indicate that it is an approximate match
305
312
// but consider that it is packaged and skip the children.
306
313
log .Printf ("%s is packaged as %s in Debian (%s)" , mod , repoRoot , trackerLink (pkg .source ))
307
- if _ , ok := sourcesInNew [pkg .source ]; ok {
308
- line := fmt . Sprintf ( "%s \033 [36m%s (in NEW) \033 [0m" , strings . Repeat ( " " , indent ), mod )
314
+ if version , ok := sourcesInNew [pkg .source ]; ok {
315
+ line := newPackageLine ( indent , mod , pkg . source , version )
309
316
lines = append (lines , line )
310
317
}
311
318
return
0 commit comments