auto-detect arch / distrelease and set default filters accordingly
|Assignee:||Giacomo Picchiarelli||% Done:||
Detection is based on user-agent, see how it was done in easy-urpmi ?
Updated by Samuel Verschelde about 2 years ago
Description updated (simpler now)
To Xaris : what interests me most is that auto-detection of the arch based on the user-agent. Setting the default filter will be nice if
you can, but otherwise ttp or I will handle it.
Updated by Adrien Gallou about 2 years ago
the way i see it, you could you could add a
to the lib/filtering/baseCriteriaFilter.class.php
then you could change the getDefaultParameters of the
to add just after the line $filter->hasDefault()
a $filter->setOption('user_agent', $_SERVER['HTTP_USER_AGENT']);
then in getDefault method of the archCriteriaFilter and the distreleaseCriteriaFilter
you could do a if ($this->hasOption('user_agent')) then
a if ($this->getOption('user_agent')) then do the logic of return the if of the arch of distrelease based on the user_agent value.
Updated by Χάρης Υφαντής about 2 years ago
- Status changed from New to In progress
- % Done changed from 0 to 30
I have implemented most of the code Adrien suggests above.
I still have to pass the arch or distrelease on the corresponding filter and add more distros to be recognized.
P.S: this task can be completed after all that but it might need improvements like not setting the $filter->setOption on all filters.
Updated by Samuel Verschelde over 1 year ago
Xaris, what is the status for this task ? Is there a branch I can pull (on which remote if yes?) to finish it if you don't have the time to do it?