Smart has been added to the Arch User Repository (AUR)

Anders F Björklund afb at algonet.se
Fri Oct 15 03:19:58 PDT 2010


Rehan Khan wrote:

>> It is possible to package backends/channels as subpackages, if  
>> needed.
>>
>> I think it is better to install everything and filter in config, but.
>
> Ah yes, I had forgotten that. It was a lot of work to work around  
> the fact
> that the installation does not help with this.

Not sure if a for loop qualifies as a lot of work, but it can be added.

Here was a mock implementation I hacked up just now:

[smart]
backends = rpm,deb,slack,arch
channels = True
interfaces = text,gtk,qt,qt4
plugins = True

After parsing (where 'True' means *), this ends up as:

backends: ['rpm', 'deb', 'slack', 'arch']
channels: ['red-carpet', 'arch-dir', 'apt-deb', 'arch-site',  
'mirrors', 'rpm-dir', 'up2date-mirrors', 'urpmi', 'slack-site', 'rpm- 
hdl', 'yast2', 'deb-dir', 'rpm-md', 'apt-rpm', 'rpm-sys', 'deb-sys',  
'slack-dir', 'arch-sys', 'slack-sys']
interfaces: ['text', 'gtk', 'qt', 'qt4']
plugins: ['aptchannelsync', 'channelsync', 'debdir', 'detectsys',  
'landscape', 'rpmdir', 'urpmichannelsync', 'yumchannelsync',  
'zyppchannelsync']

A slight problem with distutils is that including the packages for
"smart.channels" and "smart.plugins" will also include the files...

So those would be need to be handled differently than the others,
that are separated into subdirectories and easy to conditionalize:

ext_modules = [
                ...
                Extension("smart.backends.rpm.crpmver",
                          ["smart/backends/rpm/crpmver.c"]),
                Extension("smart.backends.deb.cdebver",
                          ["smart/backends/deb/cdebver.c"]),
                ...
               ]

packages = [
             ...
             "smart.backends.rpm",
             "smart.backends.deb",
             "smart.backends.slack",
             "smart.backends.arch",
             ...
             "smart.channels",
             ...
             "smart.interfaces.gtk",
             "smart.interfaces.text",
             "smart.interfaces.qt",
             "smart.interfaces.qt4",
             ...
             "smart.plugins",
             ...
            ]

I'm not sure if there is a more sane manner to handle this...

In autoconf it would be --with and --without, but in distutils ?

>> I suppose it could be added to "setup.cfg", under [smart] or  
>> something.
>>
>> Add optional settings for backends, channels, interfaces, and  
>> plugins.
>
> Advantage from the perspective that it demonstrates a clean separation
> between the backends but your point is also very valid. Aside from the
> confusion caused by showing unrelated information in the gui (rpm  
> channel
> types on debian, apt channel types on fedora/centos/redhat etc).  
> It's not
> very 'smart' :)

That is a totally separate issue, and handled by the patch attached  
there.

i.e. backends and channels can be filtered out, without being  
uninstalled

> Would your proposal prevent the issue Xavion mentioned
> regarding having to install the rpm package on arch (or more  
> accurately
> getting rpm errors because it's not/never will be installed)?  
> Meaning that
> having the rpm backend hanging around requires having rpm/rpm python
> bindings installed? The only 'fix' I know of right now for his  
> issue is to
> actually delete the rpm backend/channels.

It is NOT supposed to import rpm other than from the rpm backend/ 
channels.

That it used to, just because /var/lib/rpm was present, was a bug  
(fixed).

--anders




More information about the Smart mailing list