Richard W.M. Jones
2014-Oct-24 08:14 UTC
[Libguestfs] [PATCH 0/2] bash-completion: Install symbolic links instead of copies of files (RHBZ#1156298).
Previously we copied the files instead of the symlinks.
Richard W.M. Jones
2014-Oct-24 08:14 UTC
[Libguestfs] [PATCH 1/2] bash-completion: Replace 'ln -sf' commands with rm; $(LN_S).
--- bash/Makefile.am | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/bash/Makefile.am b/bash/Makefile.am index 2da6726..e8c33d4 100644 --- a/bash/Makefile.am +++ b/bash/Makefile.am @@ -41,28 +41,39 @@ EXTRA_DIST = \ # Some of the scripts are simply symbolic links. virt-cat: - ln -sf virt-alignment-scan $@ + rm -f $@ + $(LN_S) virt-alignment-scan $@ virt-df: - ln -sf virt-alignment-scan $@ + rm -f $@ + $(LN_S) virt-alignment-scan $@ virt-edit: - ln -sf virt-alignment-scan $@ + rm -f $@ + $(LN_S) virt-alignment-scan $@ virt-filesystems: - ln -sf virt-alignment-scan $@ + rm -f $@ + $(LN_S) virt-alignment-scan $@ virt-format: - ln -sf virt-alignment-scan $@ + rm -f $@ + $(LN_S) virt-alignment-scan $@ virt-inspector: - ln -sf virt-alignment-scan $@ + rm -f $@ + $(LN_S) virt-alignment-scan $@ virt-log: - ln -sf virt-alignment-scan $@ + rm -f $@ + $(LN_S) virt-alignment-scan $@ virt-ls: - ln -sf virt-alignment-scan $@ + rm -f $@ + $(LN_S) virt-alignment-scan $@ virt-sysprep: - ln -sf virt-alignment-scan $@ + rm -f $@ + $(LN_S) virt-alignment-scan $@ virt-builder: - ln -sf virt-resize $@ + rm -f $@ + $(LN_S) virt-resize $@ virt-sparsify: - ln -sf virt-resize $@ + rm -f $@ + $(LN_S) virt-resize $@ if HAVE_BASH_COMPLETION -- 2.0.4
Richard W.M. Jones
2014-Oct-24 08:14 UTC
[Libguestfs] [PATCH 2/2] bash-completion: Install symbolic links instead of copies of files (RHBZ#1156298).
--- bash/Makefile.am | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bash/Makefile.am b/bash/Makefile.am index e8c33d4..10f0861 100644 --- a/bash/Makefile.am +++ b/bash/Makefile.am @@ -35,9 +35,14 @@ scripts = \ virt-sparsify \ virt-sysprep +# Note: Don't distribute the symbolic links, only the real files. EXTRA_DIST = \ README \ - $(scripts) + guestfish \ + guestmount \ + virt-alignment-scan \ + virt-rescue \ + virt-resize # Some of the scripts are simply symbolic links. virt-cat: @@ -80,6 +85,12 @@ if HAVE_BASH_COMPLETION # Bash completion script. bashcompletiondir = $(BASH_COMPLETIONS_DIR) -bashcompletion_DATA = $(scripts) +#bashcompletion_DATA = $(scripts) + +all-local: $(scripts) + +install-data-local: $(scripts) + $(mkdir_p) $(DESTDIR)$(bashcompletiondir) + cp -d $(scripts) $(DESTDIR)$(bashcompletiondir) endif -- 2.0.4
Pino Toscano
2014-Oct-24 08:37 UTC
Re: [Libguestfs] [PATCH 0/2] bash-completion: Install symbolic links instead of copies of files (RHBZ#1156298).
On Friday 24 October 2014 09:14:29 Richard W.M. Jones wrote:> Previously we copied the files instead of the symlinks.This series LGTM. On the other hand, given that the symlinks in the builddir are not used at all, why not just create them only at install time? -- Pino Toscano
Pino Toscano
2014-Oct-24 08:59 UTC
[Libguestfs] [PATCH] bash-completion: install symlinks instead of copies of files (RHBZ#1156298).
Create the symlinks only at install time, directly in the installation directory. The installation of non-symlink completion files is unchanged. --- bash/Makefile.am | 46 +++++++++++++++++----------------------------- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/bash/Makefile.am b/bash/Makefile.am index 2da6726..7251e11 100644 --- a/bash/Makefile.am +++ b/bash/Makefile.am @@ -21,7 +21,10 @@ scripts = \ guestfish \ guestmount \ virt-alignment-scan \ - virt-builder \ + virt-rescue \ + virt-resize + +links_to_virt_alignment_scan = \ virt-cat \ virt-df \ virt-edit \ @@ -30,40 +33,16 @@ scripts = \ virt-inspector \ virt-log \ virt-ls \ - virt-rescue \ - virt-resize \ - virt-sparsify \ virt-sysprep +links_to_virt_resize = \ + virt-builder \ + virt-sparsify + EXTRA_DIST = \ README \ $(scripts) -# Some of the scripts are simply symbolic links. -virt-cat: - ln -sf virt-alignment-scan $@ -virt-df: - ln -sf virt-alignment-scan $@ -virt-edit: - ln -sf virt-alignment-scan $@ -virt-filesystems: - ln -sf virt-alignment-scan $@ -virt-format: - ln -sf virt-alignment-scan $@ -virt-inspector: - ln -sf virt-alignment-scan $@ -virt-log: - ln -sf virt-alignment-scan $@ -virt-ls: - ln -sf virt-alignment-scan $@ -virt-sysprep: - ln -sf virt-alignment-scan $@ - -virt-builder: - ln -sf virt-resize $@ -virt-sparsify: - ln -sf virt-resize $@ - if HAVE_BASH_COMPLETION # Bash completion script. @@ -71,4 +50,13 @@ if HAVE_BASH_COMPLETION bashcompletiondir = $(BASH_COMPLETIONS_DIR) bashcompletion_DATA = $(scripts) +install-data-local: + $(mkdir_p) $(DESTDIR)$(bashcompletiondir) + for l in $(links_to_virt_alignment_scan); do \ + $(LN_S) virt-alignment-scan $(DESTDIR)$(bashcompletiondir)/$$l; \ + done + for l in $(links_to_virt_resize); do \ + $(LN_S) virt-resize $(DESTDIR)$(bashcompletiondir)/$$l; \ + done + endif -- 1.9.3
Richard W.M. Jones
2014-Oct-24 09:31 UTC
Re: [Libguestfs] [PATCH 0/2] bash-completion: Install symbolic links instead of copies of files (RHBZ#1156298).
On Fri, Oct 24, 2014 at 10:37:34AM +0200, Pino Toscano wrote:> On Friday 24 October 2014 09:14:29 Richard W.M. Jones wrote: > > Previously we copied the files instead of the symlinks. > > This series LGTM. > > On the other hand, given that the symlinks in the builddir are not used > at all, why not just create them only at install time?I guess because it's nice to look at the build directory and have a good idea what the install directory will look like, instead of having to decode some shell script in the Makefile. Also because (in some alternate universe) you could add bash completion paths in './run'. This is not possible at the moment however ... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Seemingly Similar Threads
- [PATCH] Fix, simplify out-of-tree build/install for bash completions
- [PATCH] bash: fix build/clean when srcdir==builddir
- [p2v PATCH] Add bash completion scripts
- Re: [PATCH] Fix, simplify out-of-tree build/install for bash completions
- Re: [PATCH 0/2] bash-completion: Install symbolic links instead of copies of files (RHBZ#1156298).