summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@debian.org>2019-01-08 00:50:39 -0500
committerJames McCoy <jamessan@debian.org>2019-01-08 01:00:35 -0500
commitdc297e19b36e7385b649eb7f02b2ddc8f9554edb (patch)
tree35f31ffe374eca4d6809c4303b489d258b87c9c3
parent548f239cce23d2f14e35d1b746d8c17434678f27 (diff)
Use a single substvar, vim-addon:Depends
This will include the relevant versions of vim and/or neovim, depending on what the Debian package is providing. Signed-off-by: James McCoy <jamessan@debian.org>
-rwxr-xr-xdh_vim-addon16
1 files changed, 12 insertions, 4 deletions
diff --git a/dh_vim-addon b/dh_vim-addon
index c3db332..2cbff8b 100755
--- a/dh_vim-addon
+++ b/dh_vim-addon
@@ -72,7 +72,7 @@ Debian package's name), then it is recommended to supply the addon name. This
ensures that common conventions, like C<packadd addon-name> and C<let
g:loaded_addon = 1> work as the user expects.
-The C<${vim:Depends}> substvar will be set with any required dependencies.
+The C<${vim-addon:Depends}> substvar will be set with any required dependencies.
=item debian/I<package>.vim-opt-addon
@@ -81,7 +81,7 @@ The C<${vim:Depends}> substvar will be set with any required dependencies.
This file follows the same format as F<vim-addon>, however the directories will
be installed as optional addons in I<package>.
-The C<${neovim:Depends}> substvar will be set with any required dependencies.
+The C<${vim-addon:Depends}> substvar will be set with any required dependencies.
=back
@@ -175,6 +175,7 @@ on_items_in_parallel(\@packages, sub {
foreach my $package (@_) {
my $tmp = tmpdir($package);
+ my %substvar;
foreach my $pkgfilebase (keys %pkgfiledir) {
my $pkgfile = pkgfile($package, $pkgfilebase);
my $skip_process = process_pkg($package) ? 0 : 1;
@@ -213,11 +214,18 @@ on_items_in_parallel(\@packages, sub {
if ($pkgfilebase =~ m/neovim/) {
# First version with good "packages" support
- addsubstvar($package, 'neovim:Depends', 'neovim', '>= 0.2.2-1~');
+ $substvar{neovim} = '0.2.2-1~';
} else {
# First version with $VIM/vimfiles as a directory instead of a symlink to /etc/vim
- addsubstvar($package, 'vim:Depends', 'vim', '>= 2:8.1.0693-2~');
+ $substvar{vim} = '2:8.1.0693-2~';
}
}
+
+ if (%substvar) {
+ my $depinfo = join '|', map { "$_ (>= $substvar{$_})" }
+ # Put vim first when both vim/neovim are supported
+ reverse sort keys %substvar;
+ addsubstvar($package, 'vim-addon:Depends', $depinfo);
+ }
}
});