aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/%HOME%
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-12-01 02:51:47 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-12-01 02:51:47 +0300
commit9e718bbefb7183736bb1b39b4ab897116e9cf5f3 (patch)
tree6a870ae2bf3991f7e9c98e5570ba5d6c103e731d /%HOME%
parentlist_packages: package names only (diff)
downloadlinux-home-9e718bbefb7183736bb1b39b4ab897116e9cf5f3.tar.gz
linux-home-9e718bbefb7183736bb1b39b4ab897116e9cf5f3.zip
list_packages: factor out distr-specific variants
Diffstat (limited to '%HOME%')
-rw-r--r--%HOME%/.bashrc25
1 files changed, 19 insertions, 6 deletions
diff --git a/%HOME%/.bashrc b/%HOME%/.bashrc
index 730a7ea..d6eb5a6 100644
--- a/%HOME%/.bashrc
+++ b/%HOME%/.bashrc
@@ -62,18 +62,31 @@ alias tree='tree -a'
alias cls='echo -en "\ec"'
+list_packages_cygwin() (
+ set -o errexit -o nounset -o pipefail
+
+ cygcheck --check-setup --dump-only \
+ | cut -d ' ' -f 1
+)
+
+list_packages_ubuntu() (
+ set -o errexit -o nounset -o pipefail
+
+ dpkg --get-selections \
+ | grep --invert-match -- 'deinstall$' \
+ | cut -f 1 \
+ | cut -d ':' -f 1
+)
+
list_packages() (
set -o errexit -o nounset -o pipefail
if is_cygwin; then
- cygcheck --check-setup --dump-only \
- | cut -d ' ' -f 1
+ list_packages_cygwin
elif is_ubuntu; then
- dpkg --get-selections \
- | grep --invert-match -- 'deinstall$' \
- | cut -f 1 \
- | cut -d ':' -f 1
+ list_packages_ubuntu
fi
+ return 1
)
[ -r "$HOME/.bash_utils/cxx.sh" ] && source "$HOME/.bash_utils/cxx.sh"