summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorDavid Paleino <d.paleino@gmail.com>2008-06-17 22:28:54 +0200
committerDavid Paleino <d.paleino@gmail.com>2008-06-17 22:28:54 +0200
commit351121fc395c747fdf6f731d25bd339e924e3062 (patch)
treeae2f1ed2a9b98bb0b0d841bf7b1099dc3df6f1b1 /extra
parent23f6e76c6223b94b63e45cf2f733556d1e57dd9a (diff)
downloadbash-completion-351121fc395c747fdf6f731d25bd339e924e3062.tar.gz
added extra/dh_bash-completion to ease future rewrite of bc.
Diffstat (limited to 'extra')
-rwxr-xr-xextra/dh_bash-completion57
1 files changed, 57 insertions, 0 deletions
diff --git a/extra/dh_bash-completion b/extra/dh_bash-completion
new file mode 100755
index 00000000..d838a385
--- /dev/null
+++ b/extra/dh_bash-completion
@@ -0,0 +1,57 @@
+#!/usr/bin/perl -w
+
+=head1 NAME
+
+dh_bash-completion - install bash completions for package
+
+=cut
+
+use strict;
+use Debian::Debhelper::Dh_Lib;
+
+=head1 SYNOPSIS
+
+B<dh_bash-completion> [S<I<debhelper options>>]
+
+=head1 DESCRIPTION
+
+dh_bash-completion is a debhelper program that is responsible for installing
+completions for bash, usable installing the "bash-completion" package.
+
+If a file named debian/package.bash-completion exists, then it is
+installed into etc/bash_completion.d in the package build directory.
+This file is used to provide the user with proper completion for available
+commands.
+
+=cut
+
+init();
+
+foreach my $package (@{$dh{DOPACKAGES}}) {
+ next if is_udeb($package);
+
+ my $tmp = tmpdir($package);
+ my $bc_dir = "$tmp/etc/bash_completion.d";
+ my $completions = pkgfile($package,"bash-completion");
+
+ if ($completions ne '') {
+ if (! -d "$bc_dir") {
+ doit("install", "-d", "$bc_dir");
+ }
+ doit("install", "-p", "-m644", $completions, "$bc_dir/$package");
+ }
+}
+
+=head1 SEE ALSO
+
+L<debhelper(1)>
+
+This program is a part of debhelper.
+
+L<bash(1)>
+
+=head1 AUTHOR
+
+David Paleino <d.paleino@gmail.com>
+
+=cut