On Sat, 2022-02-26 at 14:05 -0600, William Hubbs wrote: > On Sat, Feb 26, 2022 at 01:45:24PM -0500, Ionen Wolkens wrote: > > On Sat, Feb 26, 2022 at 11:55:10AM -0600, William Hubbs wrote: > > > If I change the instructions as you suggest to re-package upstream's > > > tarball the name wouldn't need the -vendor suffix since the tarball would > > > be a > > > fork, but I'm not asking people to fork and repackage upstream's > > > tarballs, just > > > the vendor folder. Fortunately, there is no reason to fork since it is > > > very > > > easy to package the vendor folder with Go's tools. > > > > Doing: > > tar ... project-1.0-vendor.tar.xz project-1.0/vendor > > > > would only package the "vendor" directory and not the whole > > project directory. Then when auto-unpacked by src_unpack, the > > vendor directory is added under project-1.0/ > > > > So this isn't repacking upstream's or a fork. > > Ok, I get what you are saying, but normally the directory you have the > package in doesn't have a version number if you are working from a git > repository, so I don't know how to get around this: > > cd path/to/project > # note, no version number in "project" > go mod vendor > cd .. > tar -acf project/vendor project-1.0-vendor.tar.xz > > This will put everything in the tarball under "project/" instead of > "project-1.0/". > > Does tar have an option to change that top level path that I don't know > about? >
If you're working from a git repo, you should use 'git archive' and it has --prefix= option that does what you need. git archive --prefix=project-1.0/ vendor | xz -9 > project-1.0-vendor.tar.xz -- Best regards, Michał Górny