docsmooth / vmware-bumblebee

Bash Script to start VMware Workstation under Bumblebee Primus/Optimus hybrid drivers
GNU General Public License v2.0
28 stars 10 forks source link

Errors on Arch Linux, when package lsb-release is missing. #16

Open invidian opened 8 years ago

invidian commented 8 years ago

I'm not sure if I should have package lsb-release installed or not, but when it's missing, I miss also /etc/lsb-release file and script depends on it. I think there should be some additional checking for this.

Log:

$ bash -x ./vmplayer-bumblebee 
+ gVers=2.0
+ ACADAPTER=/sys/class/power_supply/AC
+ BATTERY=/sys/class/power_supply/BAT0
+ FORCE3D=a
+ DO3D=n
++ basename ./vmplayer-bumblebee
+ scriptname=vmplayer-bumblebee
+ echo
+ egrep -q -w '(help|h|\?)'
+ '[' 1 -eq 0 ']'
++ which gksudo
+ '[' -x /usr/bin/gksudo ']'
++ which gksudo
+ SUDO='/usr/bin/gksudo -k'
+ determineos
++ uname -p
+ ARCH=unknown
+ '[' unknown = unknown ']'
++ uname -m
+ ARCH=x86_64
+ '[' x86_64 = unknown ']'
++ which dpkgx
which: no dpkgx in (~/.local/bin:~/.gem/ruby/2.3.0/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/adobe-air-sdk/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
+ '[' ']'
++ which rpm
which: no rpm in (~/.local/bin:~/.gem/ruby/2.3.0/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/adobe-air-sdk/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
+ '[' ']'
++ which pacman
+ '[' /usr/bin/pacman ']'
+ OStype=arch
++ grep -c -i 'arch linux' /etc/lsb-release
grep: /etc/lsb-release: No such file or directory
+ '[' -gt 0 ']'
./vmplayer-bumblebee: line 119: [: -gt: unary operator expected
++ grep -c -i manjaro /etc/lsb-release
grep: /etc/lsb-release: No such file or directory
+ '[' -gt 0 ']'
./vmplayer-bumblebee: line 125: [: -gt: unary operator expected
+ NVIDIA_DEST32=
+ '[' -d /linux-gnu ']'
+ NVIDIA_DEST64=
+ '[' -d /linux-gnu ']'
+ '[' x86_64 = x86_64 -o x86_64 = amd64 ']'
+ ULIB=
+ LIB=
+ NVIDIA_DEST=
+ '[' -z ']'
+ echo 'ERROR: Couldn'\''t determine paths properly!'
ERROR: Couldn't determine paths properly!
+ exit 2
docsmooth commented 8 years ago

I don't have arch, so I'm 100% dependent on others here. Are there multiple platforms that use pacman as package manager? If so, that's probably why I'm also checking the lsb-release. do you have any other file in /etc (maybe /etc/release) that I can also check for to ensure it's Arch and not another pacman-using system?

invidian commented 5 years ago

Perhaps /etc/os-release could be used instead of /etc/lsb-release?