On 18/11/14 12:54, Matthias Runge wrote:
> On Tue, Nov 18, 2014 at 09:36:00PM +1100, Richard Jones wrote:
>> I guess I got the message that turning bower packages into system packages
>> was something that the Linux packagers were not keen on. Did I get the
>> message wrong there? If so, *and* we can get the bower stuff through #infra
>> and global-requirements then yes, we should totally try to avoid adding the
>> xstatic layer :)
> 
> For me, it's more work to turn packages into bower, or to translate
> bower packages to system packages.
> 
> But that is purely because we don't have bower packaged currently in Fedora.
> I would vote for the cleaner way (whatever that is).
> 
> XStatic is obviously not the cleanest way, but a good compromise in most
> situations.

The way I thought about it, we would simply replace the Bower packages
with the corresponding system packages, by just changing the path in the
settings.py file.

Maybe an example would help illustrate it.
Currently we have something like this:

STATICFILES_DIRS = [
    ('horizon/lib/angular',
       xstatic.main.XStatic(xstatic.pkg.angular).base_dir),
    ('horizon/lib/angular',
       xstatic.main.XStatic(xstatic.pkg.angular_cookies).base_dir),
    ('horizon/lib/angular',
       xstatic.main.XStatic(xstatic.pkg.angular_mock).base_dir),
    ('horizon/lib/bootstrap_datepicker',
       xstatic.main.XStatic(xstatic.pkg.bootstrap_datepicker).base_dir),
    ('bootstrap',
       xstatic.main.XStatic(xstatic.pkg.bootstrap_scss).base_dir),
...
]

We would replace that with:

STATICFILES_DIRS = [
    ('horizon/lib/angular',
       os.path.join(BASE_DIR, 'bower_modules/angular'),
...
]

or wherever bower puts the files. Now, the packagers would replace those
lines with:

STATICFILES_DIRS = [
    ('horizon/lib/angular',
       '/usr/lib/javascript/angular'),
...
]

or whatever the packages in their distribution use. It's less work than
having to make a whole xstatic package just to put that single path in
there. The horizon system package would already depend on all the
javascript library packages, so we are sure the files are there.

-- 
Radomir Dopieralski


_______________________________________________
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to