Hi folks,
I've got nearly 300 OXP's installed, and I often have to temporarily deactivate them for testing purposes. What I did to achieve this was:
- create a folder (e.g. ~/Desktop/OXPs/) for the oxp's I temporarily want to disable
- select all unwanted oxps from the oolite-AddOns folder
- move them to the new folder
But for some (unknown) reason, doing this with my filemanager (nautilus) took a considerable amount of time, and since I'm also more a keyboard user than a mouse user I wanted a quicker way. Doing it with bash-commands was a little unwieldy, though, so I wrote a shell-script to support me. If you are interested, you can download the script from my box: https://www.box.com/s/un6niaity1cmgjpl7nj5
Here is the usage:
Code: Select all
=============================================================================
activate or deactivate oxps by moving them from/to another directory (holding track).
This hopefully speeds up the lenghty process of moving the AddOns for tests.
[IMPORTANT INFO:] It is STRONGLY recommended to set the masterdirectories so that they
are located inside the same volume/filesystem, or else
the moving of the oxps will take much, much longer!
[-=notes=-]:
- this will create a holding track directory if it doesn't exist yet. The dirs used may be specified in the script:
AddOns: '/home/ggshinobi/.Oolite/AddOns'
AddOnsHoldingTrack: '/home/ggshinobi/.Oolite/AddOnsHoldingTrack'
- spaces in oxp-names are not allowed. If you have oxps with spaces, convert their names:
OLDIFS="$IFS"; IFS=$'\n'; for x in `ls -1 | grep "[[:space:]]"`; do mv $x ${x// /_}; done; IFS="$OLDIFS"
[-=usage=-]:
addOnsManage.sh [-i] <mode> [oxp1] [oxp2]...
-i: case insensitive search
<modes>:
-a / activate: activate the given oxps by moving them into the specified AddOns-Folder
-d / deactivate: deactivate the given oxps by moving them to the specified HoldingTrack-Folder
-aa / activateAll: activate all oxps which are available in AddOnsHoldingTrack/
-da / deactivateAll: deactivate all oxps (move all from AddOns/ to AddOnsHoldingTrack/)
note: for activateAll and deactivateAll, no further parameters are allowed! (sanity check)
-si / showInstalled: show installed / activated oxps
-sa / showAvailable: show oxps available for activation / installation
The showModes will use any parameters to further filter results through case-insensitive grep.
[-=examples=-]:
addOnsManage.sh -a Updating_TSC_1.5.1.oxp Snoopers2.4.oxp/
addOnsManage.sh -i -a planet our # will for instance activate PlanetaryCompass, PlanetFall, YOUR-ADD-HERE, tesoura...
addOnsManage.sh -aa
addOnsManage.sh -si updat snoop # will show all installed oxps containing either updat or snoop (case-sensitive)
addOnsManage.sh -i -si updat snoop # will show all installed oxps containing either updat or snoop (case-insensitive)
[-=hints=-]:
- you don't need to specify the exact name. It suffices if the string you provided matches.
- the more precise you type the names of the oxp's, the less will be selected.
- if you enter (de)activate mode without specifiying oxp's, you will be prompted to enter them.
This prompt should support parameter expansion (if it is set on your system).
- case-sensitive search is the default. Use -i as first parameter to use case-insensitive search.
=============================================================================
Please note that I tested it and it works well for me. It also contains several sanity checks, but after all, you use it on your own risk! So I very strongly recommend to backup your AddOns-Folder before using this!
EDIT: I also strongly suggest that you make sure the scripts' "master directories" are configured so that they are on the same volume. Else, the files would have to be physically copied and removed each time (instead of just modifiying their i-nodes, which is very quick).
EDIT2: Uploaded a new version (identical in operation) which more explicitly points out that the master directories should reside on the same volume / filesystem. Updated the code snippet (that shows the usage).