Tiny Core Linux

Off-Topic => Off-Topic - The Funnies => Topic started by: gutmensch on June 17, 2011, 02:01:53 PM

Title: Better test before committing...
Post by: gutmensch on June 17, 2011, 02:01:53 PM
I feel I had to share this although it's already worldwide in the feeds... it really made my day ;)

https://github.com/MrMEEE/bumblebee/commit/a047be (https://github.com/MrMEEE/bumblebee/commit/a047be)

Title: Re: Better test before committing...
Post by: Arslan S. on August 23, 2011, 01:03:51 AM
lol :)
Title: Re: Better test before committing...
Post by: beerstein on August 23, 2011, 04:42:42 AM
I do not understand this post - Is this a virus?
please explain a bit
thank you
Title: Re: Better test before committing...
Post by: Rich on August 23, 2011, 08:29:39 AM
Hi beerstein
No, not a virus, a syntax error in a script. The line in the script reads
Quote
rm -rf /usr /lib/nvidia-current/xorg/xorg
There is a space between  /usr  and  /lib/nvi...   which does not belong there. As a result, you get
rm -rf  // Translation, remove recursively and do not prompt for confirmation.
/usr     // That's your usr directory, don't want to remove that, do you?
/lib/nvidia-current/xorg/xorg     // This probably won't exist and be ignored

So what should have been a simple and straight forward operation turned into a disaster because
someone added an extra  space  into a command and then proceeded to compound the error
by not testing the script. And if I read correctly, the faulty script was present in two releases of
the package.

Moral: No matter how simple or routine you think that line of code you just wrote is, test, test, test.
 
Title: Re: Better test before committing...
Post by: robc on August 23, 2011, 11:10:26 AM
And since they were probably not using TC they would have to reinstall or try to recover by rebuilding the /usr directory tree instead of just rebooting  :P