[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Using debian/vendor/ in Go packages?



> Nice.  Could you describe with example commands how you do the import of
> the debian/vendor/?  I think I can understand the end result, but not
> how you get there.  Is it this step?
>
> https://salsa.debian.org/go-team/packages/usql/-/blob/60a45c4e5e18b89c297b6cb6adf62115041a9d8b/debian/vendor/README.md

Yes, the README.md is done in a way that you can just copy-paste it to
reproduce the steps (assumin you are running sid and have golang etc
installed):

# Vendoring dependencies

```bash
# Run this from project root directory
go mod vendor

# Download only the dependencies that are not yet available in Debian
MODULES=(
  "github.com/go-git/go-billy/v5"
  "github.com/gohxs/readline"
  "github.com/google/goexpect"
  "github.com/google/goterm"
  "github.com/jeandeaual/go-locale"
  "github.com/kenshaw/colors"
  "github.com/kenshaw/rasterm"
  "github.com/mattn/go-sixel"
  "github.com/nathan-fiscaletti/consolesize-go"
  "github.com/soniakeys/quant"
  "github.com/xo/dburl"
  "github.com/xo/tblfmt"
  "github.com/yookoala/realpath"
)

# Loop through each module
for MODULE in "${MODULES[@]}"
do
  mkdir -p debian/vendor/"$MODULE"
  cp --archive --update --verbose vendor/"$MODULE"/* debian/vendor/"$MODULE"/
done
```


Reply to: