--- debfoster-2.7.orig/README.git +++ debfoster-2.7/README.git @@ -0,0 +1,61 @@ +Some notes on the GIT repository +================================ + +Location +-------- + +The repository is available at: + + http://neualius.turmzimmer.net/~fw/debfoster.git/ + http://git.enyo.de/fw/debian/debfoster.git/ + +Branches +-------- + +* master: The main branch for Debian unstable. + +* upstream: The "upstream" version, lacks the Debian packaging. + +Tags +---- + +Upstream versions are tagged v2.6 and so on (without a hyphen), Debian +versions are tagged v2.6-1 and so on (with a hyphen). + +Steps to prepare a new upstream version +--------------------------------------- + +1. Run "git tag -u KEY-ID VERSION" to create a signed tag (VERSION + should start with a small "v", see above). + +2. Push it to the official repository: "git push neualius VERSION" + +3. Create the upstream tar ball: + + git tar-tree VERSION debfoster-VERSION | + gzip --best > ../debfoster_VERSION.orig.tar.gz + + (Here, the "v" is dropped from the VERSION string, of course.) + +4. Merge it into the Debian branch: + + git checkout master + git merge "Merge from upstream" master upstream + +Steps to prepare a new Debian version +------------------------------------- + +1. Update the Debian changelog, based on the GIT log. It is best to + do this directly before the release of a new version, otherwise you + risk tons of conflicts during development. + +2. Create a tag, this time with a hyphen, and push it to the official + repository (steps 1 and 2 from the upstream version release + procedure). + +3. Make sure that the upstream tarball is present in the parent + directory. + +4. Build binary and source packages using: + + dpkg-buildpackage -i.git -rfakeroot -kKEY-ID --- debfoster-2.7.orig/po/Makefile.in.in +++ debfoster-2.7/po/Makefile.in.in @@ -1,5 +1,5 @@ # Makefile for PO directory in any package using GNU gettext. -# Copyright (C) 1995-1997, 2000-2005 by Ulrich Drepper +# Copyright (C) 1995-1997, 2000-2007 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public @@ -8,7 +8,8 @@ # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # -# Origin: gettext-0.14.4 +# Origin: gettext-0.17 +GETTEXT_MACRO_VERSION = 0.17 PACKAGE = @PACKAGE@ VERSION = @VERSION@ @@ -23,18 +24,38 @@ prefix = @prefix@ exec_prefix = @exec_prefix@ +datarootdir = @datarootdir@ datadir = @datadir@ -localedir = $(datadir)/locale +localedir = @localedir@ gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ -MKINSTALLDIRS = @MKINSTALLDIRS@ -mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) -GMSGFMT = @GMSGFMT@ -MSGFMT = @MSGFMT@ -XGETTEXT = @XGETTEXT@ +# We use $(mkdir_p). +# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as +# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, +# @install_sh@ does not start with $(SHELL), so we add it. +# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined +# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake +# versions, $(mkinstalldirs) and $(install_sh) are unused. +mkinstalldirs = $(SHELL) @install_sh@ -d +install_sh = $(SHELL) @install_sh@ +MKDIR_P = @MKDIR_P@ +mkdir_p = @mkdir_p@ + +GMSGFMT_ = @GMSGFMT@ +GMSGFMT_no = @GMSGFMT@ +GMSGFMT_yes = @GMSGFMT_015@ +GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) +MSGFMT_ = @MSGFMT@ +MSGFMT_no = @MSGFMT@ +MSGFMT_yes = @MSGFMT_015@ +MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) +XGETTEXT_ = @XGETTEXT@ +XGETTEXT_no = @XGETTEXT@ +XGETTEXT_yes = @XGETTEXT_015@ +XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit @@ -75,11 +96,18 @@ mv t-$@ $@ -all: all-@USE_NLS@ +all: check-macro-version all-@USE_NLS@ all-yes: stamp-po all-no: +# Ensure that the gettext macros and this Makefile.in.in are in sync. +check-macro-version: + @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ + || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ + exit 1; \ + } + # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that @@ -110,16 +138,34 @@ # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed + if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ + package_gnu='GNU '; \ + else \ + package_gnu=''; \ + fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ - $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ - --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ - --files-from=$(srcdir)/POTFILES.in \ - --copyright-holder='$(COPYRIGHT_HOLDER)' \ - --msgid-bugs-address="$$msgid_bugs_address" + case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + ;; \ + *) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --package-name="$${package_gnu}@PACKAGE@" \ + --package-version='@VERSION@' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + ;; \ + esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ @@ -158,7 +204,7 @@ install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ - $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ @@ -171,13 +217,13 @@ fi install-data-no: all install-data-yes: all - $(mkinstalldirs) $(DESTDIR)$(datadir) + $(mkdir_p) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ - $(mkinstalldirs) $(DESTDIR)$$dir; \ + $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ @@ -217,19 +263,19 @@ installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ - $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ + $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: - $(mkinstalldirs) $(DESTDIR)$(datadir) + $(mkdir_p) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ - $(mkinstalldirs) $(DESTDIR)$$dir; \ + $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ @@ -374,8 +420,7 @@ Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ - $(SHELL) ./config.status + && $(SHELL) ./config.status $(subdir)/$@.in po-directories force: --- debfoster-2.7.orig/doc/debfoster.8 +++ debfoster-2.7/doc/debfoster.8 @@ -54,7 +54,7 @@ removed as soon as .Nm is done asking questions. -If your choises cause other packages to become orphaned more +If your choices cause other packages to become orphaned more questions will ensue. .Pp Whenever --- debfoster-2.7.orig/debian/debfoster2aptitude +++ debfoster-2.7/debian/debfoster2aptitude @@ -0,0 +1,53 @@ +#! /usr/bin/perl -w + +use strict; +use utf8; + +system qw(debfoster + -o MaxPriority=required + -o UseHold=no + -o UsePreDepends=yes + -o UseRecommends=no + -o UseSuggests=no + -o UseEssential=no + -o UseTasks=no + -o KeepSections= + -o NokeepSections= + -o GuessDepends=no) and die; + +my %debfoster; + +open KEEPERS, '<', '/var/lib/debfoster/keepers' + or die "/var/lib/debfoster/keepers: $!"; + +while() { + next if /^-/; + chomp; + undef $debfoster{$_} +} + +close KEEPERS or die $!; + +open PKG, '<', '/var/lib/aptitude/pkgstates' + or die "/var/lib/aptitude/pkgstates: $!"; + +open NEW, '>', '/var/lib/aptitude/pkgstates.new' + or die "/var/lib/aptitude/pkgstates.new: $!"; + +my $name; + +while() { + $name = $1 if /^Package:\s+(\S+)/; + + if(/Last-Change:/) { + $_ = 'Last-Change: '.(exists $debfoster{$name} ? 0 : 1)."\n" + } + print NEW + or die "/var/lib/aptitude/pkgstates.new: $!"; +} + +close NEW or die $!; +close PKG or die $!; + +rename '/var/lib/aptitude/pkgstates.new', '/var/lib/aptitude/pkgstates' + or die "rename(/var/lib/aptitude/pkgstates): $!" --- debfoster-2.7.orig/debian/copyright +++ debfoster-2.7/debian/copyright @@ -0,0 +1,12 @@ +This package was debianized by Ivo Timmermans on +Tue, 9 Jan 2001 23:02:44 +0100. + +It was downloaded from http://www.fruit.eu.org/debfoster/ + +Upstream Author: Wessel Dankers + +Copyright: GPL version 2 and LGPL versions 2 and 2.1. On Debian +GNU/Linux systems, the complete text of the GNU General Public License +can be found in /usr/share/common-licenses/GPL. +The text to the GNU Lesser General Public License can be found in +/usr/share/common-licenses/LGPL-2 or LGPL-2.1. --- debfoster-2.7.orig/debian/compat +++ debfoster-2.7/debian/compat @@ -0,0 +1 @@ +4 --- debfoster-2.7.orig/debian/control +++ debfoster-2.7/debian/control @@ -0,0 +1,25 @@ +Source: debfoster +Section: admin +Priority: optional +Maintainer: debfoster Maintainer Team +Uploaders: Andreas Barth , Marc Haber , Florian Weimer +Build-Depends: debhelper (>> 4.0.0), gettext, libgc-dev +Standards-Version: 3.7.2 + +Package: debfoster +Architecture: any +Depends: ${shlibs:Depends} +Recommends: apt +Description: Install only wanted Debian packages + debfoster is a wrapper program for apt and dpkg. When first run, it + will ask you which of the installed packages you want to keep + installed. + . + After that, it maintains a list of packages that you want to have + installed on your system. It uses this list to detect packages that + have been installed only because other packages depended on them. If + one of these dependencies changes, debfoster will take notice, and + ask if you want to remove the old package. + . + This helps you to maintain a clean Debian install, without old + (mainly library) packages lying around that aren't used any more. --- debfoster-2.7.orig/debian/rules +++ debfoster-2.7/debian/rules @@ -0,0 +1,86 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + ./configure --prefix=/usr --sysconfdir=/etc \ + --mandir=/usr/share/man --localstatedir=/var + + touch configure-stamp + +build: configure-stamp build-stamp +build-stamp: + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #/usr/bin/docbook-to-man debian/debfoster.sgml > debfoster.1 + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) distclean + rm -f po/*.gmo po/stamp-po + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/debfoster. + \$(MAKE) install DESTDIR=$(CURDIR)/debian/debfoster + install debian/debfoster2aptitude debian/debfoster/usr/sbin/ + install -m 644 debian/debfoster.bash_completion \ + debian/debfoster/etc/bash_completion.d/debfoster + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot +# dh_installdebconf + dh_installdocs + dh_installexamples + dh_installmenu +# dh_installemacsen +# dh_installpam +# dh_installinit + dh_installcron + dh_installman + dh_installinfo +# dh_undocumented + dh_installchangelogs + dh_link + dh_strip + dh_compress + dh_fixperms + # You may want to make some executables suid here. +# dh_suidregister +# dh_makeshlibs + dh_installdeb +# dh_perl + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- debfoster-2.7.orig/debian/dirs +++ debfoster-2.7/debian/dirs @@ -0,0 +1,6 @@ +usr/bin +usr/sbin +var +var/lib +var/lib/debfoster +etc/bash_completion.d --- debfoster-2.7.orig/debian/docs +++ debfoster-2.7/debian/docs @@ -0,0 +1 @@ +README --- debfoster-2.7.orig/debian/postrm +++ debfoster-2.7/debian/postrm @@ -0,0 +1,11 @@ +#!/bin/sh + +if [ "$1" = "purge" ] ; then + rm -f "/var/lib/debfoster/keepers" +fi + +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- debfoster-2.7.orig/debian/changelog +++ debfoster-2.7/debian/changelog @@ -0,0 +1,196 @@ +debfoster (2.7-1.1) unstable; urgency=low + + * Non-maintainer upload. + * debian/{postinst,postrm}: remove policy-violating prompts for old + keepers file location that has not existed for 9 years now, and + unconditionally remove new keepers on purge (Closes: 553286). + + -- Kees Cook Sun, 24 Jan 2010 17:09:13 -0800 + +debfoster (2.7-1) unstable; urgency=low + + * New upstream version. Closes: #448501. + + -- Florian Weimer Sat, 19 Apr 2008 17:14:49 +0200 + +debfoster (2.6-2) unstable; urgency=low + + * Bump Standards-Version. No changes required. + * Add README file for a few GIT-related topics. + * Retroactively edit the Debian changelog, following the new + release process. + * Add bash completion support. Thanks to Eric Hansander + . Closes: #349035. + * Fix typo in manual page. Spotted by A Costa . + Closes: #307022. + + -- Florian Weimer Sun, 30 Jul 2006 18:32:36 +0200 + +debfoster (2.6-1) unstable; urgency=low + + * New upstream version, new maintainer team. + * Revert deprecation. Closes: #366518. + + -- Florian Weimer Sat, 22 Jul 2006 18:40:16 +0200 + +debfoster (2.5-6) unstable; urgency=low + + * Debfoster is deprecated: include a tool to convert debfoster's database to + aptitude's, and display a warning with debconf. + + -- Guus Sliepen Fri, 5 May 2006 15:40:38 +0200 + +debfoster (2.5-5) unstable; urgency=low + + * Adopting package. + * Update config.guess and config.sub. Closes: #342386 + + -- Guus Sliepen Wed, 7 Dec 2005 17:59:22 +0100 + +debfoster (2.5-4) unstable; urgency=low + + * src/conffile.c, etc/debfoster.conf: Set NegativeKeepers to "no" by + default. + * po/da.po: Updated Danish translation. (Closes: #262650) + + -- Ivo Timmermans Tue, 3 Aug 2004 19:37:04 +0200 + +debfoster (2.5-3) unstable; urgency=low + + * configure.in: Added AM_MAINTAINER_MODE. (Closes: #180142) + * etc/debfoster.conf: Fix typos. (Closes: #174277) + + -- Ivo Timmermans Sun, 9 Feb 2003 15:57:02 +0100 + +debfoster (2.5-2) unstable; urgency=low + + * Add Danish translation. (Closes: #174073) + + -- Ivo Timmermans Fri, 7 Feb 2003 10:40:58 +0100 + +debfoster (2.5-1) unstable; urgency=low + + * New upstream release (Closes: #127829, #123749) + + -- Ivo Timmermans Thu, 17 Jan 2002 23:08:39 +0100 + +debfoster (2.4-1) unstable; urgency=low + + * New upstream release (Closes: #122325, #115255, #91736) + + -- Ivo Timmermans Tue, 4 Dec 2001 14:35:41 +0100 + +debfoster (2.3-1) unstable; urgency=low + + * New upstream release (Closes: #116255): + - correct handling of --show-depend.* (Closes: #113520) + + -- Ivo Timmermans Sun, 21 Oct 2001 14:37:22 +0200 + +debfoster (2.2-1) unstable; urgency=low + + * New upstream release, fixes segfaut with package names that end in + `+'. (Closes: #109868) + + -- Ivo Timmermans Fri, 24 Aug 2001 14:40:40 +0200 + +debfoster (2.1-1) unstable; urgency=low + + * New upstream release: + - includes the patch to make debfoster compile on HURD. + (Closes: #108215) + - includes -f switch to let debfoster install all missing packages + that are in the keepers file (Closes: #108329) + - includes a way of saying `ask me later' (Closes: #91871) + - includes an undo option (Closes: #88320, #89539) + - includes an option to install/upgrade dependencies + (Closes: #101911) + + -- Ivo Timmermans Wed, 15 Aug 2001 23:39:15 +0200 + +debfoster (2.0-2) unstable; urgency=low + + * Changed the last references to the old location of the keepers file to + the new location. (Closes: #106394) + + -- Ivo Timmermans Mon, 30 Jul 2001 22:53:39 +0200 + +debfoster (2.0-1) unstable; urgency=low + + * New upstream release. (Closes: #100303) + * Changed location of the keepers file in the manpage. + (Closes: #101058) + + -- Ivo Timmermans Wed, 27 Jun 2001 02:25:09 +0200 + +debfoster (1.99+2.0pre8-2) unstable; urgency=low + + * Added build dependencies on gettext. (Closes: #90657) + + -- Ivo Timmermans Sun, 25 Mar 2001 12:43:24 +0200 + +debfoster (1.99+2.0pre8-1) unstable; urgency=low + + * New upstream release. (Closes: #89346) + * Don't call dh_testversion. + * Call make distclean in the clean target. + * Patch po/Makefile.in.in to support DESTDIR if needed each time the + Debian package is rebuilt. + + -- Ivo Timmermans Mon, 19 Mar 2001 00:06:41 +0100 + +debfoster (1.99+2.0pre7-2) unstable; urgency=low + + * Changed location of the keepers file from /etc/apt/keepers to + /var/lib/debfoster/keepers (Closes: #85630, #85649). + * Have the postinst ask if the user wants to move the keepers file + to its new location; postrm also recognizes the new location. + * Fixed grammatical error in manpage (Closes: #85631). + * Fixed spelling error in the package description. + + -- Ivo Timmermans Mon, 12 Feb 2001 11:14:07 +0100 + +debfoster (1.99+2.0pre7-1) unstable; urgency=low + + * New upstream release + + -- Ivo Timmermans Sun, 11 Feb 2001 14:19:47 +0100 + +debfoster (1.99+2.0pre6-2) unstable; urgency=low + + * Changed prerm script: debhelper can now add its own stuff as well, + and two suggestions from Peter Palfrader. + * Set UsePreDepends to yes by default. + + -- Ivo Timmermans Mon, 5 Feb 2001 22:20:31 +0100 + +debfoster (1.99+2.0pre6-1) unstable; urgency=low + + * New upstream release. + * Changed package description (Closes: #83718). + * Remove /etc/apt/keepers on removal if wanted. + * Added a big fat warning in debfoster.conf to prevent people from + unknowingly setting UseEssential to `no'. + + -- Ivo Timmermans Fri, 2 Feb 2001 22:23:17 +0100 + +debfoster (1.99+2.0pre5-1) unstable; urgency=low + + * New upstream release (Closes: #83299). + * Added /etc/debfoster.conf to conffiles + + -- Ivo Timmermans Wed, 24 Jan 2001 16:35:59 +0100 + +debfoster (1.5-2) unstable; urgency=low + + * package rename, and fixes + + -- Mark Glines Tue, 16 Jan 2001 06:53:45 -0800 + +dep (1.5-1) unstable; urgency=low + + * Initial Release. + + -- Ivo Timmermans Tue, 9 Jan 2001 23:02:44 +0100 + + --- debfoster-2.7.orig/debian/debfoster.bash_completion +++ debfoster-2.7/debian/debfoster.bash_completion @@ -0,0 +1,41 @@ +# -*- sh -*- + +# Provided by Eric Hansander in +# + +have debfoster && +_debfoster() +{ + local cur prev options + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + options='-v --verbose -V --version -h --help -q --quiet -f --force \ + -m --mark-only -u --upgrade -c --config -k --keeperfile -n \ + --no-keeperfile -i --ignore-default-rules -a --show-keepers -s \ + --show-orphans -d --show-depends -e --show-dependents -p \ + --show-providers -r --show-related -t --use-tasks -o --option' + + case $prev in + -@(c|-config|k|-keeperfile)) + _filedir + return 0 + ;; + -@(d|-show-depends|e|-show-dependents|r|-show-related)) + COMPREPLY=( $( _comp_dpkg_installed_packages $cur ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W "$options" -- $cur ) ) + else + # This is just an approximation. Actually, debfoster can + # install new packages, which won't appear in that list. + COMPREPLY=( $( _comp_dpkg_installed_packages $cur ) ) + fi + + return 0 +} +test "$have" && complete -F _debfoster $default debfoster