Cleaning up options.conf on older installations

Bastille

Verified User
Is there a better way to clean up options.conf besides removing the existing one and running ./build update_script? Doing so will recreate options.conf with everything properly categorized but then it has all of the default values in place. It's not too hard to fix when you've made a backup of the old one but that's not something you would want to have to do on a regular basis either.
 

zEitEr

Super Moderator
Hello,

I believe as nobody replied yet, there is no other solution. So you will need to backup your options.conf and build a new one with your preferences manually.
 

Bastille

Verified User
Turns out it wasn't too difficult to do through the power of awk.

Code:
awk 'BEGIN { FS="="; } { if (NR==FNR) { pkeynline[$1]=$0; } else if (pkeynline[$1]) { print pkeynline[$1]; } else { print; } }' options.conf.bak options.conf > beautified.conf
followed by

Code:
diff options.conf beautified.conf
to help highlight differences in the current default settings, in case I want to make those changes anyway.

The fact that there are some values that changed from no to yes when I grabbed the default makes me hesitant to turn it into a shell script. I might miss some meaningful changes/improvements to some options as a result.
 
Top