ElkArte Community

Extending Elk => Addons => Addons ideas and questions => Topic started by: ahrasis on September 15, 2017, 09:43:59 pm

Title: Package Manager Problem 1.1. RC2
Post by: ahrasis on September 15, 2017, 09:43:59 pm
I am not sure this should be here or in support but it's more related to addons, so I ended up posting this here.

I got a new package for Quick Reply Reposition Addon but I cannot properly install it as the package manager didn't seem to install my template from the right folder. (I attached it here temporarily).

For version 1.0 I use folder 10 and for folder 1.1 I use folder 11 but this was not respected by the package manager. It still uses folder 10 even when install on ElkArte 1.1 RC2, so I am lost as to why and how to fix it. Here is the xml code for installation:
Code: [Select]
	<install for="1.0*">
<readme type="file" parsebbc="true">QRR.readme.txt</readme>
<require-file name="QRR.english.php" destination="LANGUAGEDIR/english/QRR" />
<require-file name="QRR.subs.php" destination="SOURCEDIR/addons/QRR" />
<require-file name="10/QRR.template.php" destination="THEMEDIR/QRR" />
<require-file name="QRR.styles.css" destination="THEMEDIR/css/QRR" />
<code>QRR.hooks.php</code>
<redirect url="?action=admin;area=addonsettings" timeout="499">Redirecting to Addons Settings...</redirect>
</install>
<uninstall for="1.0*">
<readme parsebbc="true">QRR.readme.txt</readme>
<remove-dir name="LANGUAGEDIR/english/QRR" />
<remove-dir name="SOURCEDIR/addons/QRR" />
<remove-dir name="THEMEDIR/QRR" />
<remove-dir name="THEMEDIR/css/QRR" />
<code>QRR.hooks.php</code>
<redirect url="?action=admin;area=packages" timeout="499">Redirecting to Package Manager...</redirect>
</uninstall>

<install for="1.1*">
<readme type="file" parsebbc="true">QRR.readme.txt</readme>
<require-file name="QRR.english.php" destination="LANGUAGEDIR/english/QRR" />
<require-file name="QRR.subs.php" destination="SOURCEDIR/addons/QRR" />
<require-file name="11/QRR.template.php" destination="THEMEDIR/QRR" />
<require-file name="QRR.styles.css" destination="THEMEDIR/css/QRR" />
<code>QRR.hooks.php</code>
<redirect url="?action=admin;area=addonsettings" timeout="499">Redirecting to Addons Settings...</redirect>
</install>
<uninstall for="1.1*">
<readme parsebbc="true">QRR.readme.txt</readme>
<remove-dir name="LANGUAGEDIR/english/QRR" />
<remove-dir name="SOURCEDIR/addons/QRR" />
<remove-dir name="THEMEDIR/QRR" />
<remove-dir name="THEMEDIR/css/QRR" />
<code>QRR.hooks.php</code>
<redirect url="?action=admin;area=packages" timeout="499">Redirecting to Package Manager...</redirect>
</uninstall>

Do enlighten me as to where the fault is.
Title: Re: Package Manager Problem 1.1. RC2
Post by: Frenzie on September 16, 2017, 07:11:53 am
With a glance at the XML that sounds more like a bug in Elk 1.1 to me.
Title: Re: Package Manager Problem 1.1. RC2
Post by: Spuds on September 16, 2017, 08:46:48 am
Try being more restrictive in the version line, right now I think it may be interpreted as open ended.

So
Code: [Select]
install for="1.0*"
to
Code: [Select]
install for="1.0.0 - 1.0.99"

and
Code: [Select]
install for="1.1*"
to
Code: [Select]
install for="1.1.RC2 - 1.1.99"

Same for the uninstall lines as well.  ETA: Removed extra space
Title: Re: Package Manager Problem 1.1. RC2
Post by: emanuele on September 16, 2017, 10:52:51 am
Or maybe even only 1.0.* (with the dot before the asterisk) instead of 1.0*
Because, 1.0* for the compare is converted to a range:
Code: [Select]
1.00dev0-1.0999
and then the upper limit is likely split to:
Code: [Select]
major: 1
minor: 0999
and the two numbers are then cast to int, and f I remember correctly, php casts 0999 to 999.
So, in fact, 1.0* becomes:
Code: [Select]
install for="1.0 dev - 1.999"
and that includes 1.1 as well, overriding the 1.1* (that anyway would become 1.1 dev - 1.999 creating confusion to the installer).
Title: Re: Package Manager Problem 1.1. RC2
Post by: ahrasis on September 17, 2017, 12:03:07 am
Though I really think that 1.0* should not in any way  be the same with 1.1 at all, it's fine with me. I will just follow what @Spuds suggested above for the solution.
Title: Re: Package Manager Problem 1.1. RC2
Post by: emanuele on September 17, 2017, 01:38:49 am
Well, the use of the * right after the 0 is at least ambiguous[1], and in any case I would recommend the "." to better target the micro release. ;)
And you will see it better with 1.1* that could match 1.1 but also 1.10 or 1.100
Title: Re: Package Manager Problem 1.1. RC2
Post by: ahrasis on September 17, 2017, 09:30:50 am
My intention was to cover RC and Beta which from what I see has no "." after 1.0 or 1.1 but it's not a big deal to me any way.