diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2016-12-01 02:51:47 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2016-12-01 02:51:47 +0300 |
commit | 9e718bbefb7183736bb1b39b4ab897116e9cf5f3 (patch) | |
tree | 6a870ae2bf3991f7e9c98e5570ba5d6c103e731d /%HOME% | |
parent | list_packages: package names only (diff) | |
download | linux-home-9e718bbefb7183736bb1b39b4ab897116e9cf5f3.tar.gz linux-home-9e718bbefb7183736bb1b39b4ab897116e9cf5f3.zip |
list_packages: factor out distr-specific variants
Diffstat (limited to '%HOME%')
-rw-r--r-- | %HOME%/.bashrc | 25 |
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" |