chutzpah 14/09/22 18:09:19
Added: lldpd-0.7.10-only-use-physical-for-chassis-id.patch
lldpd-0.7.10-completions.patch
lldpd-0.7.10-handle-read-errors.patch
lldpd-0.7.10-zsh-completion-dir.patch
Log:
Version bump, add json-c USE flag and rename json to jansson. Import bash and
zsh completions from upstream git. Import some bugfix patches from upstream.
(Portage version: 2.2.13/cvs/Linux x86_64, signed Manifest commit with key
0xE3F69979BB4B8928DA78E3D17CBF44EF)
Revision Changes Path
1.1
net-misc/lldpd/files/lldpd-0.7.10-only-use-physical-for-chassis-id.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/lldpd/files/lldpd-0.7.10-only-use-physical-for-chassis-id.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/lldpd/files/lldpd-0.7.10-only-use-physical-for-chassis-id.patch?rev=1.1&content-type=text/plain
Index: lldpd-0.7.10-only-use-physical-for-chassis-id.patch
===================================================================
commit 790752d0b5e7941a2e368cee6e30df6695162752
Author: Vincent Bernat <[email protected]>
Date: Thu Sep 18 11:27:21 2014 +0200
interfaces: only use physical interfaces to get a chassis ID
diff --git a/src/daemon/interfaces.c b/src/daemon/interfaces.c
index d29eacc..a52e99c 100644
--- a/src/daemon/interfaces.c
+++ b/src/daemon/interfaces.c
@@ -288,8 +288,8 @@ interfaces_helper_vlan(struct lldpd *cfg,
}
#endif
-/* Fill out chassis ID if not already done. This handler is special
- because we will only handle interfaces that are already handled. */
+/* Fill out chassis ID if not already done. Only physical interfaces are
+ * considered. */
void
interfaces_helper_chassis(struct lldpd *cfg,
struct interfaces_device_list *interfaces)
@@ -313,7 +313,7 @@ interfaces_helper_chassis(struct lldpd *cfg,
return; /* We already have one */
TAILQ_FOREACH(iface, interfaces, next) {
- if (iface->flags) continue;
+ if (!(iface->type & IFACE_PHYSICAL_T)) continue;
if (cfg->g_config.c_cid_pattern &&
!pattern_match(iface->name, cfg->g_config.c_cid_pattern,
0)) continue;
1.1 net-misc/lldpd/files/lldpd-0.7.10-completions.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/lldpd/files/lldpd-0.7.10-completions.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/lldpd/files/lldpd-0.7.10-completions.patch?rev=1.1&content-type=text/plain
Index: lldpd-0.7.10-completions.patch
===================================================================
diff --git a/src/client/Makefile.am b/src/client/Makefile.am
index af747ea..f7305db 100644
--- a/src/client/Makefile.am
+++ b/src/client/Makefile.am
@@ -39,3 +39,9 @@ lldpcli_SOURCES += jsonc_writer.c
lldpcli_CFLAGS += @JSONC_CFLAGS@
lldpcli_LDADD += @JSONC_LIBS@
endif
+
+# Completions
+bashcompletiondir = $(sysconfdir)/bash_completion.d
+bashcompletion_DATA = lldpcli.bash-completion
+zshcompletiondir = $(datadir)/zsh/vendor-completions
+zshcompletion_DATA = _lldpcli
diff --git a/src/client/_lldpcli b/src/client/_lldpcli
new file mode 100644
index 0000000..9f7a98a
--- /dev/null
+++ b/src/client/_lldpcli
@@ -0,0 +1,40 @@
+#compdef lldpcli
+#
+# zsh completion for lldpcli
+#
+# Copyright (c) 2014 Vincent Bernat <[email protected]>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+__lldpcli_command () {
+ local -a completions
+ completions=(${(f)"$(_call_program commands lldpcli complete
${words[1,$(($CURRENT-1))]})"})
+ completions=(${completions:s/ /:/})
+ _describe -t lldpcli-command "lldpcli completion" completions "$@"
+}
+
+_lldpcli () {
+ local curcontext="$curcontext" state line
+
+ _arguments -C \
+ '*-d[print more debugging information]' \
+ '(- *)-v[print version number and exit]' \
+ '-u[use an alternate socket with lldpd]:UNIX socket:_files' \
+ '-f[output format]:format:(plain xml json keyvalue)' \
+ '*-c[read a configuration file]:configuration file:_files' \
+ '(-)*::lldpcli command:__lldpcli_command'
+}
+
+
+_lldpcli "$@"
diff --git a/src/client/lldpcli.bash-completion
b/src/client/lldpcli.bash-completion
new file mode 100755
index 0000000..8ce68d7
--- /dev/null
+++ b/src/client/lldpcli.bash-completion
@@ -0,0 +1,19 @@
+# -*- sh -*-
+_lldpcli()
+{
+ COMPREPLY=()
+ COMP_WORDBREAKS=" "
+ local cur=${COMP_WORDS[COMP_CWORD]}
+ local cmd=(${COMP_WORDS[*]})
+
+ if [ "" != "$cur" ]; then
+ unset cmd[COMP_CWORD]
+ fi
+
+ local choices=$(${cmd[0]} complete ${cmd[@]:1} | \
+ cut -d " " -f 1)
+ COMPREPLY=($(compgen -W '${choices}' -- ${cur} ))
+ return 0
+}
+
+complete -F _lldpcli lldpcli
1.1 net-misc/lldpd/files/lldpd-0.7.10-handle-read-errors.patch
<<Binary file>>
1.1 net-misc/lldpd/files/lldpd-0.7.10-zsh-completion-dir.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/lldpd/files/lldpd-0.7.10-zsh-completion-dir.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/lldpd/files/lldpd-0.7.10-zsh-completion-dir.patch?rev=1.1&content-type=text/plain
Index: lldpd-0.7.10-zsh-completion-dir.patch
===================================================================
diff --git a/src/client/Makefile.am b/src/client/Makefile.am
index 8281555..994904c 100644
--- a/src/client/Makefile.am
+++ b/src/client/Makefile.am
@@ -43,5 +43,5 @@ endif
# Completions
bashcompletiondir = $(sysconfdir)/bash_completion.d
bashcompletion_DATA = lldpcli.bash-completion
-zshcompletiondir = $(datadir)/zsh/vendor-completions
+zshcompletiondir = $(datadir)/zsh/site-functions
zshcompletion_DATA = _lldpcli