From e43a426e5d402d36eb180935fbbf1430a4a86e3f Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 27 Feb 2014 16:46:05 +0100 Subject: initial version of apt-helper --- debian/rules | 3 +++ 1 file changed, 3 insertions(+) (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules index 1b3782ab6..eec016607 100755 --- a/debian/rules +++ b/debian/rules @@ -207,6 +207,9 @@ apt: build-binary build-manpages debian/apt.install #mv debian/$@/usr/bin/apt-report-mirror-failure \ # debian/$@/usr/lib/apt/apt-report-mirror-failure \ + # move the apt-helper in place + mv debian/$@/usr/bin/apt-helper debian/$@/usr/lib/apt/apt-helper + dh_bugfiles -p$@ dh_lintian -p$@ dh_installexamples -p$@ $(BLD)/docs/examples/* -- cgit v1.2.3-70-g09d2 From 697c9314c8ba24f3e393b5de11a3fad7adae4bfc Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 25 Apr 2014 15:16:46 +0200 Subject: add bash completion for the "apt" command --- debian/apt.dirs | 1 + debian/rules | 2 + share/bash-completions/apt | 95 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 share/bash-completions/apt (limited to 'debian/rules') diff --git a/debian/apt.dirs b/debian/apt.dirs index 6d492a30f..e4bb2c824 100644 --- a/debian/apt.dirs +++ b/debian/apt.dirs @@ -15,3 +15,4 @@ var/lib/apt/mirrors/partial var/lib/apt/periodic var/log/apt usr/share/bug/apt +usr/share/bash-completion/completions/ \ No newline at end of file diff --git a/debian/rules b/debian/rules index eec016607..196761444 100755 --- a/debian/rules +++ b/debian/rules @@ -189,6 +189,8 @@ apt: build-binary build-manpages debian/apt.install cp debian/apt.conf.autoremove debian/$@/etc/apt/apt.conf.d/01autoremove cp debian/apt.auto-removal.sh debian/$@/etc/kernel/postinst.d/apt-auto-removal chmod 755 debian/$@/etc/kernel/postinst.d/apt-auto-removal + # install bash completion + cp share/bash-completions/* debian/$@/usr/share/bash-completion/completions/ # make rosetta happy and remove pot files in po/ (but leave stuff # in po/domains/* untouched) and cp *.po into each domain dir diff --git a/share/bash-completions/apt b/share/bash-completions/apt new file mode 100644 index 000000000..9929bf755 --- /dev/null +++ b/share/bash-completions/apt @@ -0,0 +1,95 @@ +# Debian apt(8) completion -*- shell-script -*- + +_apt() +{ + local sourcesdir="/etc/apt/sources.list.d" + local cur prev words cword + _init_completion || return + + # see if the user selected a command already + local COMMANDS=("install" "remove" "purge" "show" "list" + "update" "upgrade" "full-upgrade" "dist-upgrade" + "edit-sources" "help") + + local command i + for (( i=0; i < ${#words[@]}-1; i++ )); do + if [[ ${COMMANDS[@]} =~ ${words[i]} ]]; then + command=${words[i]} + break + fi + done + + # supported options per command + if [[ "$cur" == -* ]]; then + case $command in + install|remove|purge|upgrade|full-upgrade) + COMPREPLY=( $( compgen -W '--show-progress + --fix-broken --purge --verbose-versions --auto-remove + --simulate --dry-run + --download + --fix-missing + --fix-policy + --ignore-hold + --force-yes + --trivial-only + --reinstall --solver' -- "$cur" ) ) + return 0 + ;; + update) + COMPREPLY=( $( compgen -W '--list-cleanup + ' -- "$cur" ) ) + return 0 + ;; + list) + COMPREPLY=( $( compgen -W '--installed --upgradable + --manual-installed + -v --verbose + -a --all-versions + ' -- "$cur" ) ) + return 0 + ;; + show) + COMPREPLY=( $( compgen -W '-a --all-versions + ' -- "$cur" ) ) + return 0 + ;; + esac + fi + + # specific command arguments + if [[ -n $command ]]; then + case $command in + remove|purge) + if [[ -f /etc/debian_version ]]; then + # Debian system + COMPREPLY=( $( \ + _xfunc dpkg _comp_dpkg_installed_packages $cur ) ) + else + # assume RPM based + _xfunc rpm _rpm_installed_packages + fi + return 0 + ;; + install|show|list) + COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \ + 2> /dev/null ) ) + return 0 + ;; + edit-sources) + COMPREPLY=( $( compgen -W '$( command ls $sourcesdir )' \ + -- "$cur" ) ) + return 0 + ;; + esac + fi + + # no command yet, show what commands we have + if [ "$command" = "" ]; then + COMPREPLY=( $( compgen -W '${COMMANDS[@]}' -- "$cur" ) ) + fi + + return 0 +} && +complete -F _apt apt + +# ex: ts=4 sw=4 et filetype=sh -- cgit v1.2.3-70-g09d2 From 12701ee3e5a637e5e45c633dc9aa2b16b81df0b8 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 25 Apr 2014 18:18:28 +0200 Subject: provide support for debian/apt.conf.$(lsb_release -i -s) vendor specific config files --- debian/apt.conf.Ubuntu | 6 ++++++ debian/apt.maintscript | 3 +++ debian/rules | 7 +++++++ 3 files changed, 16 insertions(+) create mode 100644 debian/apt.conf.Ubuntu create mode 100644 debian/apt.maintscript (limited to 'debian/rules') diff --git a/debian/apt.conf.Ubuntu b/debian/apt.conf.Ubuntu new file mode 100644 index 000000000..c4092ff44 --- /dev/null +++ b/debian/apt.conf.Ubuntu @@ -0,0 +1,6 @@ +// Server information for apt-changelog +APT { + Changelogs { + Server "http://changelogs.ubuntu.com/changelogs"; + }; +}; diff --git a/debian/apt.maintscript b/debian/apt.maintscript new file mode 100644 index 000000000..939769355 --- /dev/null +++ b/debian/apt.maintscript @@ -0,0 +1,3 @@ +rm_conffile /etc/apt/apt.conf.d/20changelog 1.0.3 -- "@" + + diff --git a/debian/rules b/debian/rules index 196761444..300c0f756 100755 --- a/debian/rules +++ b/debian/rules @@ -56,6 +56,9 @@ endif # APT Programs in apt-utils APT_UTILS=ftparchive sortpkgs extracttemplates +# get distro +APT_VENDOR_CONF := $(shell lsb_release -i -s) + # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 @@ -191,6 +194,10 @@ apt: build-binary build-manpages debian/apt.install chmod 755 debian/$@/etc/kernel/postinst.d/apt-auto-removal # install bash completion cp share/bash-completions/* debian/$@/usr/share/bash-completion/completions/ + # install distro specific apt conf + if [ -e debian/apt.conf.${APT_VENDOR_CONF} ]; then \ + cp debian/apt.conf.${APT_VENDOR_CONF} debian/$@/etc/apt/apt.conf.d/01-vendor-${APT_VENDOR_CONF}; \ + fi # make rosetta happy and remove pot files in po/ (but leave stuff # in po/domains/* untouched) and cp *.po into each domain dir -- cgit v1.2.3-70-g09d2 From c1b3d18934ce35f6a82b05207f53bf9b0cbfb961 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 26 Apr 2014 13:31:41 +0200 Subject: allow vendors to install configuration files Vendors like ubuntu need to change some options, so giving them a way to do this less painfully avoids reducing differences. --- debian/apt.conf.Ubuntu | 6 ------ debian/rules | 9 ++------- vendor/README | 6 ++++++ vendor/ubuntu/apt.conf-01-vendor-ubuntu | 6 ++++++ 4 files changed, 14 insertions(+), 13 deletions(-) delete mode 100644 debian/apt.conf.Ubuntu create mode 100644 vendor/ubuntu/apt.conf-01-vendor-ubuntu (limited to 'debian/rules') diff --git a/debian/apt.conf.Ubuntu b/debian/apt.conf.Ubuntu deleted file mode 100644 index c4092ff44..000000000 --- a/debian/apt.conf.Ubuntu +++ /dev/null @@ -1,6 +0,0 @@ -// Server information for apt-changelog -APT { - Changelogs { - Server "http://changelogs.ubuntu.com/changelogs"; - }; -}; diff --git a/debian/rules b/debian/rules index 300c0f756..fc0e9e8f6 100755 --- a/debian/rules +++ b/debian/rules @@ -56,9 +56,6 @@ endif # APT Programs in apt-utils APT_UTILS=ftparchive sortpkgs extracttemplates -# get distro -APT_VENDOR_CONF := $(shell lsb_release -i -s) - # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 @@ -194,10 +191,8 @@ apt: build-binary build-manpages debian/apt.install chmod 755 debian/$@/etc/kernel/postinst.d/apt-auto-removal # install bash completion cp share/bash-completions/* debian/$@/usr/share/bash-completion/completions/ - # install distro specific apt conf - if [ -e debian/apt.conf.${APT_VENDOR_CONF} ]; then \ - cp debian/apt.conf.${APT_VENDOR_CONF} debian/$@/etc/apt/apt.conf.d/01-vendor-${APT_VENDOR_CONF}; \ - fi + # install vendor specific apt confs + find -L vendor/current -name 'apt.conf-*' | while read conf; do cp "$${conf}" "debian/$@/etc/apt/apt.conf.d/$${conf#*-}"; done # make rosetta happy and remove pot files in po/ (but leave stuff # in po/domains/* untouched) and cp *.po into each domain dir diff --git a/vendor/README b/vendor/README index 19cda6236..c2fabbd4c 100644 --- a/vendor/README +++ b/vendor/README @@ -58,3 +58,9 @@ You can use some placeholders in this file, namely: with the value you would expect based on the name. The placeholder ¤t-codename; is yours and can be set in apt-vendor.ent + + +== apt.conf-* + +Files in your vendor directory following this naming scheme will be picked up +by the debian/rules file and installed in /etc/apt/apt.conf.d/ directory. diff --git a/vendor/ubuntu/apt.conf-01-vendor-ubuntu b/vendor/ubuntu/apt.conf-01-vendor-ubuntu new file mode 100644 index 000000000..c4092ff44 --- /dev/null +++ b/vendor/ubuntu/apt.conf-01-vendor-ubuntu @@ -0,0 +1,6 @@ +// Server information for apt-changelog +APT { + Changelogs { + Server "http://changelogs.ubuntu.com/changelogs"; + }; +}; -- cgit v1.2.3-70-g09d2 From afe81fd9edb02103f3e73081dbe42ba429bb7fc6 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 5 May 2014 16:24:52 +0200 Subject: Revert "add bash completion for the "apt" command" This reverts commit 697c9314c8ba24f3e393b5de11a3fad7adae4bfc. Conflicts: debian/rules --- debian/apt.dirs | 1 - debian/rules | 2 - share/bash-completions/apt | 95 ---------------------------------------------- 3 files changed, 98 deletions(-) delete mode 100644 share/bash-completions/apt (limited to 'debian/rules') diff --git a/debian/apt.dirs b/debian/apt.dirs index e4bb2c824..6d492a30f 100644 --- a/debian/apt.dirs +++ b/debian/apt.dirs @@ -15,4 +15,3 @@ var/lib/apt/mirrors/partial var/lib/apt/periodic var/log/apt usr/share/bug/apt -usr/share/bash-completion/completions/ \ No newline at end of file diff --git a/debian/rules b/debian/rules index fc0e9e8f6..f8b392986 100755 --- a/debian/rules +++ b/debian/rules @@ -189,8 +189,6 @@ apt: build-binary build-manpages debian/apt.install cp debian/apt.conf.autoremove debian/$@/etc/apt/apt.conf.d/01autoremove cp debian/apt.auto-removal.sh debian/$@/etc/kernel/postinst.d/apt-auto-removal chmod 755 debian/$@/etc/kernel/postinst.d/apt-auto-removal - # install bash completion - cp share/bash-completions/* debian/$@/usr/share/bash-completion/completions/ # install vendor specific apt confs find -L vendor/current -name 'apt.conf-*' | while read conf; do cp "$${conf}" "debian/$@/etc/apt/apt.conf.d/$${conf#*-}"; done diff --git a/share/bash-completions/apt b/share/bash-completions/apt deleted file mode 100644 index 9929bf755..000000000 --- a/share/bash-completions/apt +++ /dev/null @@ -1,95 +0,0 @@ -# Debian apt(8) completion -*- shell-script -*- - -_apt() -{ - local sourcesdir="/etc/apt/sources.list.d" - local cur prev words cword - _init_completion || return - - # see if the user selected a command already - local COMMANDS=("install" "remove" "purge" "show" "list" - "update" "upgrade" "full-upgrade" "dist-upgrade" - "edit-sources" "help") - - local command i - for (( i=0; i < ${#words[@]}-1; i++ )); do - if [[ ${COMMANDS[@]} =~ ${words[i]} ]]; then - command=${words[i]} - break - fi - done - - # supported options per command - if [[ "$cur" == -* ]]; then - case $command in - install|remove|purge|upgrade|full-upgrade) - COMPREPLY=( $( compgen -W '--show-progress - --fix-broken --purge --verbose-versions --auto-remove - --simulate --dry-run - --download - --fix-missing - --fix-policy - --ignore-hold - --force-yes - --trivial-only - --reinstall --solver' -- "$cur" ) ) - return 0 - ;; - update) - COMPREPLY=( $( compgen -W '--list-cleanup - ' -- "$cur" ) ) - return 0 - ;; - list) - COMPREPLY=( $( compgen -W '--installed --upgradable - --manual-installed - -v --verbose - -a --all-versions - ' -- "$cur" ) ) - return 0 - ;; - show) - COMPREPLY=( $( compgen -W '-a --all-versions - ' -- "$cur" ) ) - return 0 - ;; - esac - fi - - # specific command arguments - if [[ -n $command ]]; then - case $command in - remove|purge) - if [[ -f /etc/debian_version ]]; then - # Debian system - COMPREPLY=( $( \ - _xfunc dpkg _comp_dpkg_installed_packages $cur ) ) - else - # assume RPM based - _xfunc rpm _rpm_installed_packages - fi - return 0 - ;; - install|show|list) - COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \ - 2> /dev/null ) ) - return 0 - ;; - edit-sources) - COMPREPLY=( $( compgen -W '$( command ls $sourcesdir )' \ - -- "$cur" ) ) - return 0 - ;; - esac - fi - - # no command yet, show what commands we have - if [ "$command" = "" ]; then - COMPREPLY=( $( compgen -W '${COMMANDS[@]}' -- "$cur" ) ) - fi - - return 0 -} && -complete -F _apt apt - -# ex: ts=4 sw=4 et filetype=sh -- cgit v1.2.3-70-g09d2