Simple Machines Community Forum

SMF Development => Feature Requests => Applied or Declined Requests => Topic started by: NanoSector on May 13, 2010, 05:08:46 PM

Title: Auto-delete older versions of the mod
Post by: NanoSector on May 13, 2010, 05:08:46 PM
Could be handy when you have a huge list of mods.

Basically it deletes the older versions of a mod you are trying to install.

And when you already have the latest version installed and you are installing an older version, it could give a warning like:
"There is already a later version installed. Do you still want to continue?"

Sorry if I'm going too far into my fantasy :)
Title: Re: Auto-delete older versions of the mod
Post by: Arantor on May 13, 2010, 05:13:29 PM
Well, many mods are geared up so that you can only install one at a time. Some mods offer 'upgrade' possibility, i.e. the ability to install just the changes, but you usually can't remove earlier versions without installing later ones first.

Personally I'd encourage the forum owner to manage their mods better, but that's just me.

I can see the appeal, I'm just not sure how practical it would be, and I'm not entirely sure it's a good idea.
Title: Re: Auto-delete older versions of the mod
Post by: kat on May 13, 2010, 05:18:08 PM
Quote from: Arantor on May 13, 2010, 05:13:29 PMyou usually can't remove earlier versions without installing later ones first.


Eh?
Title: Re: Auto-delete older versions of the mod
Post by: Arantor on May 13, 2010, 05:19:27 PM
Kat: Mods can provide upgrade instructions.

E.g. Mod 1.0 is released and installed, then Mod 1.1 is released. Mod 1.1 can contain instructions to simply upgrade Mod 1.0 to Mod 1.1 without uninstalling/reinstalling.

Very often though you can't remove Mod 1.0 without removing Mod 1.1 in the process.
Title: Re: Auto-delete older versions of the mod
Post by: kat on May 13, 2010, 05:23:42 PM
AH! With you.


I know a few mods insisted that you removed older versions, first.


I'm tempted to try installing the latest version of Simple Portal, over the top, just to see what breaks, ;)


From what I can see, it's likely to break the default theme, which might be a problem.  :-X
Title: Re: Auto-delete older versions of the mod
Post by: Arantor on May 13, 2010, 05:44:42 PM
Most mods do, because it's far less work for the mod author, not only in terms of not building the upgrade package, but also in terms of maintenance and support.

SimplePortal will upgrade itself to latest version. Removal... is anyone's guess what you get.
Title: Re: Auto-delete older versions of the mod
Post by: 青山 素子 on May 13, 2010, 09:15:56 PM
Sometimes a user will want to revert back to an older version due to a huge bug in a newer version or some other reason. Automatically removing older package versions would make that difficult. It's not too much difficulty to remove older package versions once the administrator has confirmed that the newer version works properly.
Title: Re: Auto-delete older versions of the mod
Post by: kat on May 14, 2010, 06:23:54 AM
It's one of those "In the poo, if you do, in the poo, if you don't things", though, innit?


I'd imagine that installing a new version, OTT of an old one, COULD cause conflicts.


Mind you, I notice that some mods make it perfectly clear, if the old versions should be removed, first.
Title: Re: Auto-delete older versions of the mod
Post by: Arantor on May 14, 2010, 06:26:16 AM
Most mods won't install over the top of an old one if they don't have upgrade support, because they'll be trying to change the same code.
Title: Re: Auto-delete older versions of the mod
Post by: kat on May 14, 2010, 06:31:29 AM
Got to be a case of RTFM, then, innit?


Sadly, there're quite a few people who don't do that...


(I don't disclude myself, from that, at times.)
Title: Re: Auto-delete older versions of the mod
Post by: Arantor on May 14, 2010, 06:33:52 AM
Well, I'd advocate RTFM in the first instance always (yes, I actually do at least glance through the manual before trying something, so that when the time comes I have to RTFM, I know where to start reading)

There are far too many who don't RTFM though :(
Title: Re: Auto-delete older versions of the mod
Post by: NanoSector on May 14, 2010, 11:39:05 AM
Maybe you could add a checkbox like 'Enable Auto-Deletion of older mods' in the Options tab.
Title: Re: Auto-delete older versions of the mod
Post by: kat on May 14, 2010, 11:50:32 AM
Trouble, with that, is that it would only ever hope to remove them from the default theme. And then, only if the install didn't need editing, manually, because of clashes with other mods.


It would be VERY difficult to do, I'd imagine.
Title: Re: Auto-delete older versions of the mod
Post by: NanoSector on May 14, 2010, 01:34:26 PM
Quote from: Kat on May 14, 2010, 11:50:32 AM
Trouble, with that, is that it would only ever hope to remove them from the default theme. And then, only if the install didn't need editing, manually, because of clashes with other mods.


It would be VERY difficult to do, I'd imagine.
That's why I said

Quote from: Yoshi2889 on May 13, 2010, 05:08:46 PM
Sorry if I'm going too far into my fantasy
Title: Re: Auto-delete older versions of the mod
Post by: kat on May 14, 2010, 01:42:58 PM
I think we all have dreams like that. ;)
Title: Re: Auto-delete older versions of the mod
Post by: nend on May 16, 2010, 11:39:25 PM
I believe the package manager needs a little work. I believe allot of compatibility issues are the Package manager itself.

Like if I install.

Find
Target Code

Add After

More Code


You get this
Target Code
More Code


This causes problems when you install a new mod with another mod that adds after the same line.

Find
Target Code

Add After
Even More Code

You end up with
Target Code
Even More Code
More Code


But when you unistall it looks for ...

Find
Target Code
More Code


Replace with
Target Code

Why not work like this

Find and Delete
More Code

Because it definately is not going to find this
Target Code
More Code


In this
Target Code
Even More Code
More Code
Title: Re: Auto-delete older versions of the mod
Post by: Norv on May 17, 2010, 12:46:12 AM
nend: Yes, you're right, that's what it does. Not that it has much choice.
If it searches for

Target Code
[random code here]
More Code

there is no way to guarantee within reasonable limits that it won't find similar UNINTENDED code which happens to match this - too wide - pattern.

You may want to take a look at an older discussion on the subject. Proper package installing/uninstall parsing method? (http://www.simplemachines.org/community/index.php?topic=369981.0)
Title: Re: Auto-delete older versions of the mod
Post by: NanoSector on May 18, 2010, 02:45:11 PM
Quote from: nend on May 16, 2010, 11:39:25 PM
I believe the package manager needs a little work. I believe allot of compatibility issues are the Package manager itself.

Like if I install.

Find
Target Code

Add After

More Code


You get this
Target Code
More Code


This causes problems when you install a new mod with another mod that adds after the same line.

Find
Target Code

Add After
Even More Code

You end up with
Target Code
Even More Code
More Code


But when you unistall it looks for ...

Find
Target Code
More Code


Replace with
Target Code

Why not work like this

Find and Delete
More Code

Because it definately is not going to find this
Target Code
More Code


In this
Target Code
Even More Code
More Code

OMG I'm not THAT technical xD
Title: Re: Auto-delete older versions of the mod
Post by: nend on May 18, 2010, 05:19:30 PM
Quote from: Norv on May 17, 2010, 12:46:12 AM
nend: Yes, you're right, that's what it does. Not that it has much choice.
If it searches for

Target Code
[random code here]
More Code

there is no way to guarantee within reasonable limits that it won't find similar UNINTENDED code which happens to match this - too wide - pattern.

You may want to take a look at an older discussion on the subject. Proper package installing/uninstall parsing method? (http://www.simplemachines.org/community/index.php?topic=369981.0)

Don't you think this method though is too cautious and if a mod did have this problem then it should be considered a bug in the mod and not the SMF Package manager. Mod developers should be responsible for the uniqueness of their code. If a portion of their code may match some other mods or SMF code then they should comment on their mod like so.

//Start of Edit for My Mod Ver1.0
My Code
//End of Edit for My Mod Ver1.0
Title: Re: Auto-delete older versions of the mod
Post by: Arantor on May 18, 2010, 05:24:34 PM
That simply isn't always possible.

What if you want to get just one more term in a query, to add another field into the SQL? You can't readily comment in that.

What happens if the code happens to match multiple points in the base SMF code? It can, and does, happen, and sometimes there is NO way around it.

I agree with Norv. Removing the safety check you're suggesting is a VERY bad idea.
Title: Re: Auto-delete older versions of the mod
Post by: nend on May 18, 2010, 05:36:49 PM
Quote from: Arantor on May 18, 2010, 05:24:34 PM
That simply isn't always possible.

What if you want to get just one more term in a query, to add another field into the SQL? You can't readily comment in that.

What happens if the code happens to match multiple points in the base SMF code? It can, and does, happen, and sometimes there is NO way around it.

I agree with Norv. Removing the safety check you're suggesting is a VERY bad idea.

Yeah that probably is for the best, uniqueness is not always possible as you clearly pointed out. I don't think however it is impossible but will require a complete overhaul of how things work in SMF. Too much to consider right now with the release of SMF 2 coming up.
Title: Re: Auto-delete older versions of the mod
Post by: Arantor on May 18, 2010, 05:41:20 PM
Oh the whole idea needs a major overhaul for later versions, I don't think there's any dispute there.

Trouble is, the only practical alternative is to take SMF in an OOP direction, and have mods extend classes, which I feel will have an overall detrimental effect on the number of mods, though likely the quality of what comes through will be higher.
Title: Re: Auto-delete older versions of the mod
Post by: nend on May 18, 2010, 06:00:04 PM
Object oriented, no problem for me. Funny though when I code in PHP I code in a mixture of what is OOP and what is not. But I guess it all goes with how I learned to code in PHP versus How I learned to code in AS3, VB or even JavaScript.

I guess it is strange to me, even though you can consider one thing as a object in PHP it just feels like it is not a true object.
Title: Re: Auto-delete older versions of the mod
Post by: Arantor on May 18, 2010, 06:05:39 PM
*nods* I guess it also depends whether you learned to code OOP in PHP 4 or PHP 5. PHP 4 OOP is mostly a joke, and it feels like an afterthought which is why it doesn't feel like using real objects.