Update Tutorial, written by jpeters #### Preparation ############ Install the script as "update", preferably somewhere in your PATH so it can be called from anywhere. 'update' will need the 'wget.tcz/e' extension for its no clobber (-nc) install option when using update -i. ######### Basic Functions: Updating ######### 1. Graphics Method Type from terminal: "update -g" This is the update graphics option using 'dialog'. If all is well, you should see extensions from your tce directory listed. Typing the first letter will move the list accordingly for faster selection. Select an extension and push or click on OK. 2. CLI Method To view extensions in the tce directory: type: "update -v" Choose an extension to update and type: "update [basename]" eg, "update gnumeric" Push to update. Remember to use only the basename. Update searches the tce directory for the correct extension. ####### Building a persistent md5 database for rapid checking/installing ##### Create a directory somewhere on your hard or thumb drive. type "mkdir [mypath]" eg, "mkdir /mnt/hda3/myMD5" edit script "DB=[ mypath ]" eg, "DB=/mnt/hda3/myMD5" Uncomment the example on the scrip by removing the leading "#". Test the new directory by checking an extension with the -f (file) option. type "update -f [ basename ]" eg, "update -f gnumeric" Again, use only the basename as the script will search your tce directory for the correct extension. Push and the downloaded md5 file should copy into your DB folder. The md5 file is used to check the selected extension and report "OK" or "FAILED". "OK" means the extension is current, and doesn't need updating. You can always view current extensions with "update -v" Next let's check the dependencies with the -d option: type "update -d [ basename ]" eg, "update -d gnumeric" Files that need updating (FAILED) are reported, and the downloaded md5 files copied into DB. If you don't want to use a persistent database, simply comment out the DB path with a leading "#", ie. "# DB=/path". Md5 files get copied to /tmp/md5 and then are deleted. Of course, the install and checking functions with "x" will be unavailable. Complete reports for all checks can be viewed with: "cat /tmp/update-check" ######### Checking the TCE directory for updates ########### The entire tce directory can be checked with: type: "update -c" This will download md5 files that are used to check all extensions in the tce directory. The downloaded files are copied into DB (if one exists), or else just deleted from /tmp/md5 after running its checks. This will take some time, depending on the size of the tce directory. Extensions that need updating (FAILED) are reported. "Update" avoids automatic functions for safety reasons, so it's your choice what to update after getting the report. Updating is very fast, only a few seconds per update. Please see the closing comments regarding updating extensions currently in use. Now that the DB has all downloaded md5 files for the tce directory, a fast check can be performed using the local DB: type "update -cx" The "x" means that the local DB will be used instead of downloading new files. This can be useful for checking things like file corruption if something breaks. Using the local database is very fast, since there's no downloading, and can be done offline. ############# Using Update as an appsbrowser ######### To install a new extension: type "update -i tcz" or "update -i tce" This command will download all associated md5 files from the repository, and list available extensions in 'dialog' for selection. This will take some time initially, although files are added into the DB (noclobber) for much faster loading the next time. At this point, our DB (if it exists) is complete, so everything from here on will get speedy. Including -i options was conceived as a way to install apps without the need for X to be running, but with a local DB it's also a fast way to install extensions that you already understand. With a complete DB, we can use the local DB: type "update -ix tce" or "update -ix tcz" This produces rapid listing in 'dialog' of files for installing, since no downloading is required. ########### TCZ2RAM (tinycore version 2.3 >) To load tcz files to ram, use: type: "update -ir" This works similarly to "update -i, but will install selected extensions to ram, using the "tce-load -i -w -r" command. Since only tcz files are involved, there is no need to include it in the command. To use the database, type: "update -irx" This command uses the persistent database, if it exists, for instant listing in 'dialog'. Selections are installed to ram. ######## Removing extensions from the TCE Directory ######## Type "update -rem" This command will list extensions in the tce directory to 'dialog' for removal from your tce directory. The main point of this option is so the extensions will not be loaded on subsequent boots. Menu and icon fixes are included, in addition to umounting of tczs and removal of links. Also, extensions can be reinstalled without rebooting. Dependencies are listed but NOT uninstalled, since they may be necessary for other extensions that are still in use. Automatic uninstalling is intentionally not included, but extensions can be individually removed in a fraction of a second. Remember that dependencies are often shared by other applications, so be careful what you remove. If you accidentally delete a shared dependency so something else breaks, you can remove the broken app with "update -rem", and then simply reinstall, eg "update -ix tcz". If you want to know what extension is missing or broken, run "update -d [broken app]", which will report the missing or corrupted dep as FAILED. The failed extension can then be installed if missing, or updated if corrupted. ####### Reference ############ A complete listing of options is available with: type: "update --help" ######## Closing Comments ################# Although generally a reboot is all that is necessary to restore a PPR system, it is generally good practice not to remove or update extensions that are currently in use. That said, precautions such as umounting tcz's and deleting symlinks are included with update and remove options to minimize the necessity of having to reboot. In addition, automatic functions like removing dependencies or updating all extensions have been deliberately excluded. This makes it simple to know where to look if something stops working. It is always a good idea to have backups of your tce directory, or at least a list of extensions in case something goes wrong. Personally, I use both, so have no worries about losing anything. A copy list can be easily made with: Type in appropriate paths: "ls /path/tce_dir >/path/tce_dir.list" Have fun using "update" jpeters