[Pkg-ocaml-maint-commits] [SCM] unison packaging branch, master, updated. debian/2.27.57-4

Sylvain Le Gall gildor at debian.org
Thu Feb 25 01:03:58 UTC 2010


The following commit has been merged in the master branch:
commit ef2d4dca6a658aa0c84fd97c95d9e0d2b9fd6b7e
Author: Sylvain Le Gall <gildor at debian.org>
Date:   Tue Feb 23 00:26:02 2010 +0000

    Add bash_completion (Closes: #349782, #481070)

diff --git a/debian/changelog b/debian/changelog
index 1c4369e..30f77d9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ unison (2.27.57-3) UNRELEASED; urgency=low
     * Use dh_ocaml 0.9 features (auto dependencies)
   * unison binaries are custom executables, so we can remove Depends on any
     ocaml-base* packages (Closes: #540481)
+  * Add bash_completion (Closes: #349782, #481070)
 
  -- Sylvain Le Gall <gildor at debian.org>  Tue, 16 Feb 2010 23:52:52 +0100
 
diff --git a/debian/rules b/debian/rules
index 1a21fe0..2c71127 100755
--- a/debian/rules
+++ b/debian/rules
@@ -38,16 +38,20 @@ PRIORITY=10
 PRIORITY_GTK=5
 endif
 
+TR=$(subst .,_,$(subst -,_,$1))
+
 UNISON=unison-$(VERSION)
 UNISON_MAJ=UNISON-$(VERSION)
 UNISON_PACKAGE=unison$(PACKAGE_VERSION)
 UNISON_ALTERNATIVE=$(if $(PACKAGE_VERSION),$(UNISON),unison-latest-stable)
 UNISON_VERSIONNO=unison-$(VERSIONNO)
+UNISON_VAR=$(call TR,$(UNISON))
 
 UNISON_GTK=unison-$(VERSION)-gtk
 UNISON_GTK_PACKAGE=$(UNISON_PACKAGE)-gtk
 UNISON_GTK_ALTERNATIVE=$(if $(PACKAGE_VERSION),$(UNISON_GTK),unison-latest-stable-gtk)
 UNISON_GTK_VERSIONNO=unison-$(VERSIONNO)-gtk
+UNISON_GTK_VAR=$(call TR,$(UNISON_GTK))
 
 RENAME := debian/unison.1.in 
 RENAME += debian/unison.dirs.in 
@@ -123,6 +127,64 @@ clean::
 	-$(RM) '$(CURDIR)/debian/$(UNISON_GTK_PACKAGE).xpm'
 
 #
+# Generate debhelper files using templates
+#
+
+SED_REPLACE += -e "s/@VERSION@/$(VERSION)/g"
+SED_REPLACE += -e "s/@PACKAGE_VERSION@/$(PACKAGE_VERSION)/g"
+
+SED_REPLACE += -e "s/@PRIORITY@/$(PRIORITY)/g"
+SED_REPLACE += -e "s/@UNISON@/$(UNISON)/g"
+SED_REPLACE += -e "s/@UNISON_PACKAGE@/$(UNISON_PACKAGE)/g"
+SED_REPLACE += -e "s/@UNISON_ALTERNATIVE@/$(UNISON_ALTERNATIVE)/g"
+SED_REPLACE += -e "s/@UNISON_VERSIONNO@/$(UNISON_VERSIONNO)/g"
+SED_REPLACE += -e "s/@UNISON_VAR@/$(UNISON_VAR)/g"
+SED_REPLACE += -e "s/@UNISON_MAJ@/$(UNISON_MAJ)/g"
+
+SED_REPLACE += -e "s/@PRIORITY_GTK@/$(PRIORITY_GTK)/g"
+SED_REPLACE += -e "s/@UNISON_GTK@/$(UNISON_GTK)/g"
+SED_REPLACE += -e "s/@UNISON_GTK_PACKAGE@/$(UNISON_GTK_PACKAGE)/g"
+SED_REPLACE += -e "s/@UNISON_GTK_ALTERNATIVE@/$(UNISON_GTK_ALTERNATIVE)/g"
+SED_REPLACE += -e "s/@UNISON_GTK_VERSIONNO@/$(UNISON_GTK_VERSIONNO)/g"
+SED_REPLACE += -e "s/@UNISON_GTK_VAR@/$(UNISON_GTK_VAR)/g"
+
+SED_REPLACE += -e "s/@PRIORITY_SELF@/$(PRIORITY_SELF)/g"
+SED_REPLACE += -e "s/@UNISON_SELF@/$(UNISON_SELF)/g"
+SED_REPLACE += -e "s/@UNISON_SELF_PACKAGE@/$(UNISON_SELF_PACKAGE)/g"
+SED_REPLACE += -e "s/@UNISON_SELF_ALTERNATIVE@/$(UNISON_SELF_ALTERNATIVE)/g"
+SED_REPLACE += -e "s/@UNISON_SELF_VERSIONNO@/$(UNISON_SELF_VERSIONNO)/g"
+SED_REPLACE += -e "s/@UNISON_SELF_VAR@/$(UNISON_SELF_VAR)/g"
+
+%-template-stamp:
+	for i in $(wildcard debian/templates/*); do   \
+	   sed $(SED_REPLACE) $$i > debian/$(UNISON_SELF_PACKAGE).$$(basename $$i); \
+	done;
+	touch $@
+
+clean::
+	for i in $(wildcard debian/templates/*); do \
+	   $(RM) -f debian/$(UNISON_GTK_PACKAGE).$$(basename $$i); \
+	   $(RM) -f debian/$(UNISON_PACKAGE).$$(basename $$i); \
+	done
+	-$(RM) unison-gtk-template-stamp unison-template-stamp
+
+unison-gtk-template-stamp: PRIORITY_SELF = $(PRIORITY_GTK)
+unison-gtk-template-stamp: UNISON_SELF = $(UNISON_GTK)
+unison-gtk-template-stamp: UNISON_SELF_PACKAGE = $(UNISON_GTK_PACKAGE)
+unison-gtk-template-stamp: UNISON_SELF_ALTERNATIVE = $(UNISON_GTK_ALTERNATIVE)
+unison-gtk-template-stamp: UNISON_SELF_VERSIONNO = $(UNISON_GTK_VERSIONNO)
+unison-gtk-template-stamp: UNISON_SELF_VAR = $(UNISON_GTK_VAR)
+
+unison-template-stamp: PRIORITY_SELF = $(PRIORITY)
+unison-template-stamp: UNISON_SELF = $(UNISON)
+unison-template-stamp: UNISON_SELF_PACKAGE = $(UNISON_PACKAGE)
+unison-template-stamp: UNISON_SELF_ALTERNATIVE = $(UNISON_ALTERNATIVE)
+unison-template-stamp: UNISON_SELF_VERSIONNO = $(UNISON_VERSIONNO)
+unison-template-stamp: UNISON_SELF_VAR = $(UNISON_VAR)
+
+template: unison-template-stamp unison-gtk-template-stamp
+
+#
 # Rename and substitute files
 #
 
diff --git a/debian/templates/completion.bash b/debian/templates/completion.bash
new file mode 100644
index 0000000..54c1c94
--- /dev/null
+++ b/debian/templates/completion.bash
@@ -0,0 +1,35 @@
+_ at UNISON_SELF_VAR@() {
+  local cur profiles
+
+  COMPREPLY=()
+  cur=${COMP_WORDS[COMP_CWORD]}
+
+  # Get option with unison -help | grep "^  -" | cut -f 3 -d " "
+
+  if [[ "$cur" == -* ]]; then
+      COMPREPLY=( $( compgen -W '-addprefsto -addversionno -auto -backup \
+      -backupcurrent -backupcurrentnot -backupdir -backuplocation -backupnot \
+      -backupprefix -backups -backupsuffix -batch -confirmbigdeletes \
+      -confirmmerge -contactquietly -debug -doc -dumbtty -fastcheck -follow \
+      -force -forcepartial -group -height -host -ignore -ignorecase \
+      -ignorelocks -ignorenot -immutable -immutablenot -key -killserver -label \
+      -log -logfile -maxbackups -maxthreads -merge -mountpoint -numericids \
+      -owner -path -perms -prefer -preferpartial -pretendwin -repeat -retry \
+      -root -rootalias -rsrc -rsync -selftest -servercmd -showarchive -silent \
+      -socket -sortbysize -sortfirst -sortlast -sortnewfirst -sshargs -sshcmd \
+      -terse -testserver -times -ui -version -xferbycopying' -- "$cur" ) )
+    else
+      if [ -d $HOME/.unison ]; then
+        for i in $HOME/.unison/*.prf; do
+          if test -e $i; then
+            profiles="$profiles $(basename ${i%.prf})"
+          fi
+        done
+      fi
+      COMPREPLY=( $( compgen -W '$profiles' -- $cur ) );
+    fi 
+
+    return 0
+}
+
+complete -o plusdirs -F _ at UNISON_SELF_VAR@ @UNISON_SELF@
diff --git a/debian/unison-gtk.dirs.in b/debian/unison-gtk.dirs.in
index 1893e7a..e029724 100644
--- a/debian/unison-gtk.dirs.in
+++ b/debian/unison-gtk.dirs.in
@@ -1,3 +1,4 @@
 usr/bin
 usr/share/doc
 usr/share/man/man1
+etc/bash_completion.d
diff --git a/debian/unison-gtk.install.in b/debian/unison-gtk.install.in
index 345fd13..71817d5 100644
--- a/debian/unison-gtk.install.in
+++ b/debian/unison-gtk.install.in
@@ -1,4 +1,5 @@
-debian/@UNISON_GTK_PACKAGE at .xpm     /usr/share/pixmaps/
-debian/@UNISON_GTK_PACKAGE at .svg     /usr/share/pixmaps/
- at UNISON_GTK@                        /usr/bin/
-debian/@UNISON_GTK_PACKAGE at .desktop /usr/share/applications/
+debian/@UNISON_GTK_PACKAGE at .xpm             /usr/share/pixmaps/
+debian/@UNISON_GTK_PACKAGE at .svg             /usr/share/pixmaps/
+ at UNISON_GTK@                                /usr/bin/
+debian/@UNISON_GTK_PACKAGE at .desktop         /usr/share/applications/
+debian/@UNISON_GTK_PACKAGE at .completion.bash /etc/bash_completion.d/@UNISON_GTK_PACKAGE@
diff --git a/debian/unison.dirs.in b/debian/unison.dirs.in
index 98d1583..fff498d 100644
--- a/debian/unison.dirs.in
+++ b/debian/unison.dirs.in
@@ -1,2 +1,3 @@
 usr/bin
 usr/share/man/man1
+etc/bash_completion.d
diff --git a/debian/unison.install.in b/debian/unison.install.in
index cbc6560..16a4afb 100644
--- a/debian/unison.install.in
+++ b/debian/unison.install.in
@@ -1 +1,2 @@
- at UNISON@   /usr/bin/
+ at UNISON@                                 /usr/bin/
+debian/@UNISON_PACKAGE at .completion.bash  /etc/bash_completion.d/@UNISON_PACKAGE@

-- 
unison packaging



More information about the Pkg-ocaml-maint-commits mailing list