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