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

Re: Using debian/vendor/ in Go packages?





Le sam. 12 avr. 2025 à 20:31, Otto Kekäläinen <otto@debian.org> a écrit :
> 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
```

This is all very interesting, because it shows how to do a quick and dirty debian package.
https://salsa.debian.org/go-team/packages/usql/-/merge_requests/3
mentions FTP masters rejection, and the other approach I mentionned would have worked.
Granted, uscan needs even more improvements (support for CType: golang) that would
have been time well spent, instead of reinventing the wheel.
But I'm really glad you did this, because today I want a quick-and-dirty vendored horror,
and thanks to you I can do it.

Jérémy
 

Reply to: