Hi Michael,
That's great input. It would also mean that any future packages that had duplicate names at the start would not need the same fix. This would fix it permanently, whatever an add-on is called. Like it very much :-).
It will also be testable by myself because the add-on names stay the same, the part that would be changed would be something I can install on my testbed and test.
Thanks very much for your help.
Regards,
Adolf.
On 27/11/2020 17:55, Michael Tremer wrote:
Hey Adolf,
I think the fundamental problem here is that we are running a shell command to edit a string.
https://git.ipfire.org/?p=ipfire-2.x.git;a=blob;f=html/cgi-bin/services.cgi;...
Furthermore that shell command is returning what is the second element between hyphens. This is not what we want. We actually simply want whatever comes after “meta-“.
My suggestion is to change the call of “find” (line 164) so that we use Perl-native code to list all files in that directory.
We then cut off the first five characters if they are “meta-“. Otherwise we ignore the file.
We then have the correct name of the service we are looking for.
We should also change the second call to “find” (line 169) which simply could be:
if (-e “/etc/init.d/${service}”) { … }
That way, the code would be more secure because any shell command injections are impossible. It would perform a lot quicker because it takes a very very long time to launch a shell command. And last but not least it does what we intend.
Is this what you were looking for?
-Michael
On 26 Nov 2020, at 22:22, Adolf Belka ahb.ipfire@gmail.com wrote:
Dear All,
I have been working on a solution for bug 12539.
With cups and cups-filters installed the services tab shows cups twice in the add-on list. This is because the cut command from the installed meta files causes both meta-cups and meta-cups-filters to result in cups and therefore shows up twice.
The solution seems to be to rename the Prog name from cups-filters to cups_filters. I made these changes in my local repo and everything built successfully.
However I can not figure out how to test and confirm that it has worked.
If I install the built ISO and then install cups and cups_filters from pakfire they load the programs from the IPFire repo and therefore load the original versions which still have the problem and show up twice in the services tab.
If I copy the cup and cups_filters ipfire packages and install them into my test bed system, the programs are installed and can be successfully started but because they were not installed by pakfire they have not been added to the installed meta files in /opt/pakfire/db/installed/meta-* and therefore do not show up in the services tab at all.
Can anyone help me with advice on how to be able to install these modified add-on packages so I can check that the original problem is actually solved by my solution, or do I have to just submit a patch and the review of the patch will tell me if I have done it correctly or not.
Thanks for any help/advice,
Adolf