WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: tce-uninstall  (Read 12512 times)

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
tce-uninstall
« on: March 02, 2009, 03:19:52 AM »
This is tce-uninstall.  You must be using the latest tinycore-1.2rc2 release candidate to make use of this extension.

Code: [Select]
Title:          tce-uninstall.tce
Description:    Utility to uninstall tce extensions.  (TESTING)
Version:        2009/03
Author:         Jason W
Original-site:  www.tinycorelinux.com
Copying-policy: Free
Size: 2K
Extension_by:   Jason W
Comments:       Command tce-uninstall brings up menu of installed tce
extensions that can be uninstalled.  You must be running in either
scatter mode, or PPI mode that was booted with the "local=hdxx"
boot option for this extension to be used.  This uninstaller is
almost irritatingly conservative and will not disrupt a running system
as extensions with files in use will not be uninstalled.  Dependencies
are also taken into account.  The uninstaller will not uninstall extensions
that have any files above /usr/local as to remove them can leave a broken
base system. 
                ----
A --force option will override all of this and give you
full control.  "tce-uninstall --force OSS" will remove OSS.tcem alone
without checking for dependencies, files above /usr/local, or files in use.
Use the extension name without the suffix, like glib2 or OSS and do not
include the .tce(l,m) when using the force option.  Mind youl, be sure you
                                know what you are doing if using the --force option as if you use it and break
                                your system, you get to keep both pieces.  It's use is not recommended
                                but for carefully upgrading libraries or things like that.
-----
This utility uses the extensions' .dep files to process dependencies.  In
the case you deleted your .dep files from /usr/local/tce.list or you
installed the extensions outside the use of the appbrowser, running the
command "tce-uninstall --gendeps" will fetch the .dep files for the
extensions you have installed so you can take advantage of dependency
tracking during uninstall.   
This extension is PPI compatible.
Change-log:     -------
Current:        2009/02/28 First version.
« Last Edit: March 02, 2009, 07:12:58 PM by Jason W »

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: tce-uninstall
« Reply #1 on: March 02, 2009, 02:41:15 PM »
I sure hope that every extension has a complete dep list, because it may be difficult to figure out why an extension suddenly doesn't work after tce-uninstall deletes shared dependencies. Wouldn't  rebooting after deleting the extension from the tce folder be a lot safer?

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: tce-uninstall
« Reply #2 on: March 02, 2009, 03:35:42 PM »
Just how is deleting an extension from the tce folder and rebooting different from uninstalling the extension?  The exact same thing is happening in either case.  And that is assuming running in RAM mode, which is not a mode that supports uninstalling.   

There is one more check that could be added to the dependency routine, but it would slow it down even more than it is.  Any extension being broken by the uninstaller is unacceptable and if there are such cases I would fix the uninstaller or pull it if it can't be fixed.  Though I have found no problems with uninstalling any extensions, this is still testing material and to be used with the assumption of mild risk.

In any case an extension is broken by missing dependencies, restoring them is as easy as clicking on the extension in the appbrowser and the missing deps will be installed.  But like I said that is not an acceptable outcome of the uninstaller.

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: tce-uninstall
« Reply #3 on: March 02, 2009, 04:04:43 PM »
Just how is deleting an extension from the tce folder and rebooting different from uninstalling the extension?  The exact same thing is happening in either case.  And that is assuming running in RAM mode, which is not a mode that supports uninstalling.

Maybe I don't understand the process. Let's say I have python-devs.tczl installed, and then load an extension that needs it.  I decide I don't need the extension, so delete it from my /tcZ folder. When I reboot, the extension isn't there, but python-devs.tczl  still exists.  Now I repeat the process, but uninstall with tce-uninstall, which has python-devs.tczl on its dep list.  I was assuming that dependencies get deleted?   

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: tce-uninstall
« Reply #4 on: March 02, 2009, 05:29:30 PM »
First, only tce extensions are taken into account by the uninstaller.  Tcz is left alone.  Let's take glib2 for example.  Say it is dependent on expat2.tcel (it is not but for this illustration).  Assuming none of it's files are in use by other apps, use the uninstaller to try to uninstall it.  What you will see is a list of installed apps that depend on glib2 - on my box now it is atk, emelfm2, gqview2, gtk2, leafpad, and pango.  Three options are then presented:
1. Do not uninstall glib2 (recommended)
2. Uninstall only glib2 (for advanced users only).
3. Uninstall glib2 and those that depend on it.
Dependent apps are offered up for uninstall, not dependencies.  Expat2.tcel would be left alone.  It wouldn't be good to uninstall dependencies "below" an extension, but it is good to let the user know of the dependent apps "above" it so they won't get broken.  Of course, if a .dep file is incomplete, then breakage is possible somewhere.  But that would be a case of a broken dep file rather than a broken uninstaller. 
I hope this clears it up a little.  Sorry my response earlier was snippity.

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: tce-uninstall
« Reply #5 on: March 02, 2009, 06:21:53 PM »
Sounds good!   Thanks for the explanation.  You must have put some time into this, which is much appreciated...

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: tce-uninstall
« Reply #6 on: March 03, 2009, 05:20:21 AM »
This is a very interesting addition, and quite unexpected.

Without having looked at it yet.....
I'm assuming it makes use of /use/local/tce.installed.  I have a local boot script in that directory, so would that show up as removable?

With the exception of tcem packages, all of my files in tclocal were installed manually. I wanted to check each tce package contents to see what, if anything, was being overwritten or installed into the base system.  I moved some files from base to tclocal, and I didn't bother with the /usr/local/tce.* files, so I guess that might be a problem for me if I ever wanted to use this tool.

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: tce-uninstall
« Reply #7 on: March 03, 2009, 06:01:15 AM »
Actually, /usr/local/tce.installed/* files are not used though the entries are removed during an uninstall.  Extensions have to have been loaded with the file list creation supported as the latest release candidate does to make use of the uninstaller.  So existing tclocal installaions do not have the file lists available and cannot make use of the tool.  Boot scripts in /usr/local/tce.installed that are not part of an uninstallable extension are not affected.  /usr/local/tce.list is the directory where all info for the uninstaller is taken. 

In other words, extensions can be installed with tce-load, the appbrowser, or during boot by tc-config as long as "local=hdxx" was specified during boot and they will then show up as uninstallable if they meet the other criteria.  If there are files in an extension chosen in the uninstaller outside of /usr/local, the uninstaller will exit with such error message.  If files in the extension are in use, the uninstaller will exit with a list of processes using files in that extension. 

I will look over it once more as I may have not included the check for files above /usr/local for each dependent app being uninstalled when such is chosen.

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: tce-uninstall
« Reply #8 on: March 03, 2009, 09:38:33 AM »
  /usr/local/tce.list is the directory where all info for the uninstaller is taken. 

I don't have that file; I've got tce.installed, /.menu, /.icons

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: tce-uninstall
« Reply #9 on: March 03, 2009, 10:16:09 AM »
Latest TC release candidate has to be used or that directory will not be created.

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: tce-uninstall
« Reply #10 on: March 06, 2009, 03:35:59 PM »
why this tce doesn't work with tcz?
dCore user

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: tce-uninstall
« Reply #11 on: March 06, 2009, 03:49:03 PM »
Though there is a tcz-uninstall avalable, there are going to be some changes that affects this uninstaller and will make it available across all supported modes.  Given that, I may combine the two uninstallers to work with both tce and tcz since many run a combination of the two.  That way dependencies are accounted for whether they are installed as tce or tcz.  I will shoot for that in mind and hopefully come up with a solution in the coming week or so.

Though I will leave tcz-uninstall as an extension since some folks will not want to uninstall tce's.
« Last Edit: March 06, 2009, 04:03:26 PM by Jason W »

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: tce-uninstall
« Reply #12 on: March 11, 2009, 07:23:18 PM »
I did update tce-uninstall to work across all running modes by fetching the file lists from the server, but I will leave tce-uninstall and tcz-uninstall as two seperate utilities since the two extension types are two very different animals.  This uninstaller was made to mirror the install process and use the same dep files.  The dep files work only with the same extension type as they belong to, and the uninstaller should too.  Keeping the uninstall utilities seperate keeps things more congruent with the base system.  Not that having a universal uninstaller is a bad idea, I did ponder it for a while. 

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: tce-uninstall
« Reply #13 on: March 13, 2009, 02:23:20 AM »
I still don't quite understand how uninstall works.  For example, if I load OO.tcz  from my optional foldler,  it has expat, fontconfig,and libxm as dependencies. After loading/uninstalling, nothing is added or removed from /tcZ, and the deps remain to be loaded upon reboot.  I don't know if things would be different if OO was installed directly from the appsbrowser into tcZ. If the deps aren't being used by something else, they would be deleted?  Only if they were installed with OO?  Sorry to be dense about this.     

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: tce-uninstall
« Reply #14 on: March 13, 2009, 06:28:06 AM »
You're not being dense.  There are these checks that have to be satisfied by the package being uninstalled and it's dependent ones if they are being removed too: check for files in use, check to make sure all files are beneath /usr/local.

If you are running a mixed system, tcz along with tce, then only tce installed extensions are dealt with.  Tcz-uninstall is to be used to remove them.  The tcz uninstaller has a check to see if files are in use, but dependencies are not dealt with.  I can add dependency removal and will when I have some time making it the same as tce-uninstall.

It makes no difference how the extensions are installed, the dependencies are gathered by the .dep files that are downloaded when the uninstaller is first run.  Say you install OOo, expat, fontcofig, and libxml as tce's.  Bringing up the uninstaller and removing OOo will not bother those other three since they are dependencies of OOo. Nothing depdends on OOo so as long as it's files are not in use and it is all beneath /usr/local it will simply be uninstalled.  If some of the dependent apps of a tce being removed are tcz's, they will not be dealt with but they can be removed by tcz-uninstall.

The uninstaller does not remove extensions themselves that reside in your */tce directory.  If you are running totally in RAM, they are removed from /tmp/tce upon loading.  I could add an extra dialog question that would ask if you want to remove the extension(s) in the tce directory as well as uninstall them from the system.  That would make it easier to maintain your /tce folder selection instead of picking through it manually.  But I don't want to mess with the contents of the optional directory since those apps are loaded manually at will.