Skip to content

Commit

Permalink
Use wnpp-check to check for existing wnpp bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Maytha8 committed Dec 11, 2023
1 parent e701253 commit f7d6017
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions make.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"bufio"
"errors"
"flag"
"fmt"
Expand Down Expand Up @@ -742,6 +743,24 @@ func copyFile(src, dest string) error {
return output.Close()
}

func checkWnpp(name string) {
cmd := exec.Command("wnpp-check", name)
cmd.Stderr = os.Stderr
out, err := cmd.Output()
if err != nil {
fmt.Fprintf(os.Stderr, "The following wnpp bug entries were found for \"%s\":\n%s", name, out)
fmt.Fprint(os.Stderr, "Would you like to proceed? (Y/n): ")
r := bufio.NewReader(os.Stdin)
input, err := r.ReadString('\n')
if err != nil {
log.Fatalf("error occurred while reading input: %v", err)
}
if strings.TrimSpace(input) == "n" {
log.Fatalf("Exiting...")
}
}
}

func execMake(args []string, usage func()) {
fs := flag.NewFlagSet("make", flag.ExitOnError)
if usage != nil {
Expand Down Expand Up @@ -929,6 +948,9 @@ func execMake(args []string, usage func()) {
gopkg, strings.ToLower(gopkg))
}

// Check if wnpp bug exists (using wnpp-check from devscripts)
checkWnpp(debsrc)

var (
eg errgroup.Group
golangBinaries map[string]string // map[goImportPath]debianBinaryPackage
Expand Down

0 comments on commit f7d6017

Please sign in to comment.