stefanpartheym / archlinux-ipu6-webcam

Easy installation for patched Intel IPU6 camera drivers
133 stars 14 forks source link

Shell cleanup with bug fixes #12

Closed sigboe closed 1 year ago

sigboe commented 1 year ago

I had some issues, especially with the A && B || C clauses in the script, because that situation does not work like an if-this-else clause. So I replaced all those with if-this-else clauses.

I also went through the whole script and made it bash compliant, with the following reasoning:

pushd and popd are not built-in in all posix shell, it works in default arch because because in default /bin/sh is symlinked to bash. But it may not always be. So well there are benefits of having posix compliant scripts running in bash, the utility is limited. If the user has /bin/sh symlinked to dash or something else (this is a suggestion in the arch wiki to get posix shell scripts to run faster) then there is no pushd or popd.

Keep in mind I like pushd and popd, they are much better than using cd in shellscripts, and less messy than trying to make makepkg work in another directory. Maybe that would work, but pushd, and popd works exactly how you think it does.

Keep in mind I didn't touch test.sh in this PR, I don't see a reason to convert that to be bash compliant, but I will open another PR for the test.sh script for another reason.

Tropicao commented 1 year ago

Tested on Dell XPS 9320 with kernel 6.1.11-arch1-1, got a valid stream with test.sh

sigboe commented 1 year ago

@stefanpartheym Any updates on this?

stefanpartheym commented 1 year ago

Hi @sigboe, sorry for the long wait.