Skip to content

Commit

Permalink
README.tarball: Overcome --transform problem with symlinks
Browse files Browse the repository at this point in the history
By doing the tarball using the parent directory ('pahole') and then
replacing ^pahole/ with dwarves-${version} we avoid tar replacing the
symlink destination, i.e. before we were getting:

  $ ls -la dwarves-1.22/lib/include/
  total 8
  drwxr-xr-x. 2 acme acme 4096 Aug 12 15:54 .
  drwxr-xr-x. 4 acme acme 4096 Aug 12 15:54 ..
  lrwxrwxrwx. 1 acme acme   23 Jun 18 17:56 bpf -> dwarves-1.22/../bpf/src
  $

Now we get:

  $ v=1.$(($(git tag | sort -V | tail -1 | cut -d. -f2) + 1)) ; tar cvfJ ~/rpmbuild/SOURCES/dwarves-${v}.tar.xz --transform "s,^pahole/,dwarves-${v}/," `sed s%^%../pahole/%g MANIFEST`
  $ tar tvf ~/rpmbuild/SOURCES/dwarves-1.22.tar.xz  | tail -3
  -rwxr-xr-x acme/acme      1132 2021-06-14 15:51 dwarves-1.22/lib/bpf/travis-ci/vmtest/run_vmtest.sh
  -rw-r--r-- acme/acme   2904227 2021-06-14 15:51 dwarves-1.22/lib/bpf/travis-ci/vmtest/vmlinux.h
  lrwxrwxrwx acme/acme         0 2021-08-11 08:55 dwarves-1.22/lib/include/bpf -> ../bpf/src
  $

And building from the resulting tarball succeeds.

See the references in the threads and bug reportgs in the Link tags
below for more details.

Link: https://lore.kernel.org/dwarves/[email protected]/
Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=775247
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
acmel committed Aug 20, 2021
1 parent 9fed416 commit bb02fec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.tarball
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v=1.$(($(git tag | sort -V | tail -1 | cut -d. -f2) + 1)) ; tar cvfJ ~/rpmbuild/SOURCES/dwarves-${v}.tar.xz --transform "s,^,dwarves-${v}/," `cat MANIFEST`
v=1.$(($(git tag | sort -V | tail -1 | cut -d. -f2) + 1)) ; tar cvfJ ~/rpmbuild/SOURCES/dwarves-${v}.tar.xz --transform "s,^pahole/,dwarves-${v}/," `sed s%^%../pahole/%g MANIFEST`

0 comments on commit bb02fec

Please sign in to comment.