-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
sw
executable file
·66 lines (60 loc) · 1.38 KB
/
sw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# exclue cpan and build them with native tools like
# dh-make-perl --build --cpan CPAN::Name
# maybe add nix packaging, stuck in debian new queue
# spack packaging
# http://spack.readthedocs.io/en/latest/tutorial_packaging.html#packaging-tutorial
# should do the same with pip using pypi2deb
# py2dsp pythonpkg
# module -V
# pip* -V
for a in apk dpkg rpm nix snap spack 0install flatpak opam cpan module pip2 pip3 brew zypper; do
which $a &>/dev/null && (
case $a in
apk)
num=$(apk info | wc -l)
;;
dpkg)
num=`dpkg -l |grep ^ii |wc -l`
#num="${num}\n"
#num="${num}`ls -1 /etc/apt/sources.list.d | sed s/^/\ \ \ \ /g`"
;;
rpm)
# rpm --version | awk '{print $NF}'
num=`rpm -qa | wc -l`
;;
nix)
num=`echo ?`
;;
brew)
num=`brew list| wc -l`
;;
pip2)
num=`pip2 list 2>/dev/null | wc -l`
;;
pip3)
num=`pip3 list 2>/dev/null | wc -l`
;;
spack)
num=`spack find 2>/dev/null |wc -l`
;;
snap)
num=`snap list |sed 1d |wc -l`
;;
flatpak)
num=`flatpak list | wc -l`
;;
zypper)
num=`zypper search --installed-only | grep package$ | wc -l`
;;
# 0install is braindead
#0install)
# num=`0install list |wc -l`
#;;
*)
num="n/a"
;;
esac
echo -e "$a found... $num"
) || echo "$a not found..."
done