On 03/29/2011 08:41 AM, Miroslav Suchý wrote:
> On 03/29/2011 08:19 AM, Simon Lukasik wrote:
>> (A) A big part of the code depends directly on python-rpm.
>>     We don't want 'import rpm' on Debian nor 'import apt' on Fedora.
>> (B) /etc/sysconfig does not exist on Debian
> 
> I would suggest to use /etc/default/rhn. /etc/default is Debian
> equivalent for /etc/sysconfig. More or less.
> 
The problem is not, that I cannot find an equivalent, the problem is,
how to separate the code.

>> (C) redhat-release does not exist on Debian
> /etc/debian_version
> or
> lsb_release -r
> or
> lsb_release -c

So You suggest to require lsb from rhn-client-tools? It's not
necessarily needed, but it would make things easier, yes.

> 
>> (D) Architecture names are slightly different
> Yeah, but we already have Debian architecture in DB and rhnpush count
> with it, right?

Not exactly, but yes. Now we treat i686 as an i386. Which might not be
ultimate solution for an Ubuntus.

> 
>> Potential solutions:
> 
> My priorities:
> 
>> (1) Create a Debian patch, and apply it only when building the .deb
>> package. It is easier for start, but the patch needs to be maintained.
> 
> +1
> 
>> (2) Modify upstream rhn-client-tools, to include bits for both: Debian &
>> Fedora and choose one during a build-time.
> 
> +3
> 
>> (3) Same as (2) but in run-time. (polymorphism).
> 
> +2
> 
>> (4) interleave with if-else:
>>     if getPlatform() == 'deb': import apt
>>     else: import rpm
> +2
> 
>> (5) Still there is an option to write rhn-client-tools from scratch.
>> (Design new interface). I doubt anybody likes that.
> 
> -10
> 
> 

I see, build-time (2) has scored. I will look at this option focusing on
Python's distutils. Assuming that sed (see current Makefile) and
Python's preprocesor are not preferred ways.

Will see,

-- 
Simon Lukasik

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to