Opened 16 years ago
Closed 15 years ago
#3762 closed bug (fixed)
PackageInstaller and handling script files
Reported by: | sil2100 | Owned by: | sil2100 |
---|---|---|---|
Priority: | low | Milestone: | Unscheduled |
Component: | Applications/PackageInstaller | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
There were no problems reported regarding this matter yet, but I presume some packages use this feature. Right now we treat them as normal files.
Attachments (2)
Change History (13)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Status: | new → in-progress |
---|
It shouldn't. I will take care of this in the nearest 3-4 days, since right now I have too much workload.
comment:3 by , 15 years ago
I'm sorry for the delay, I only recently found enough time to start fixing this problem. Could anyone attach/paste a link to a real-life package using this functionality? I would like to test the changes.
by , 15 years ago
Attachment: | script.patch added |
---|
Patch fixing the invalid script file handling + some other modifications.
comment:5 by , 15 years ago
This patch should do it. I used the occasion to export the installation procedure to another thread, since earlier the application was simply not responding during file copy. Checked it on the cpu_fix package.
Would be grateful if anyone could check if everything works fine with this patch. Thanks!
comment:6 by , 15 years ago
A few things I noticed:
- ParseScript and RunScript should be prefixed with an underscore.
- if inflate_data fails, the allocated *script array is not deleted.
- code style problems, example PackageInstall.cpp line132: } <newline> else {
- the macro RETURN_MESSAGE() is a problem IMO. I would add a method which calls Install and post the message if needed.
comment:7 by , 15 years ago
Thanks for reviewing the patch, korli!
I have fixed the bugs you have highlighted in the new patch attached below. I have added the deletion of *script memory in _ParseScript(), although it was not really necessary - the memory allocated in *scipt during _ParseScript() was later freed in the DoInstall() method (if, of course, the inflate_data function failed). But your approach seems more consistent in this case.
I am also sorry for the style problems - I am trying to proof read the code before submition, but it's really hard to get rid of some coding habits. Hope I did not miss anything.
comment:8 by , 15 years ago
I noticed that the *script parameter was a reminder of some other, older idea that did not end up in the final patch - so I removed it and made script a local variable for the _ParseScript() method. Attaching modified patch (the same name as before).
comment:10 by , 15 years ago
Ah, that's another bogus leftover, sorry for that again. This was added because at first I wanted some parts of the new lock-needing functionality in PackageView, but changed my mind at the end. It seems I forgot to remove the include.
I'm re-uploading the patch once again.
by , 15 years ago
Attachment: | fixed_script.patch added |
---|
Fixed according to the notes provided by korli, thanks! Also fixed something I forgot about earlier. (v3)
comment:11 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | in-progress → closed |
Applied patch in hrev36020.
I need this functionality. Is there any chance to implement it? This should not be difficult in my opinion.