On 03/14/2012 04:06 PM, Petr Viktorin wrote:
On 03/14/2012 03:40 PM, Petr Vobornik wrote:
First, I have to say that I'm new to rpm specs and I don't like this
patch but I don't have better solution.

Building the ipa rpms returns this:
warning: File listed twice: /usr/share/ipa/ui/extension.js

This is because of a glob:

and then more specifically:
%config(noreplace) %{_usr}/share/ipa/ui/extension.js


Solution thoughts::

1) best way would be limit glob like in bash ie:
'%{_usr}/share/ipa/ui/!(extension).js'. It doesn't work in spec file.
2) I don't want to specify each JavaScript file in spec - would have to
alter spec each time when adding new one.

--> I found nothing better than to use file list.

Filelist generation:
I'm creating it in %prep phase from install/ui/Makefile.am:
grep .js install/ui/Makefile.am | grep -v 'extension.js' | sed -e
's/[\t]*\\//' -e 's|[\t]*|%{_usr}/share/ipa/ui/|'

It would also be possible to generate the list from listing the

find install/ui/ -maxdepth 1 -type f -name *.js ! -name develop.js !
-name extension.js | sed 's|^install|%{usr}/share/ipa|g'

Why from Makefile?:
The list of .js files in git and Makefile differs. Therefore listing
from dir also needs to create exceptions for not used files (develop.js)
- bad in long term.

Slightly related: Have you thought about concatenating the JS files
(automatically), and serving them all as one file?

We have a ticket for that (slightly differ, but the idea is mentioned there) https://fedorahosted.org/freeipa/ticket/112 . Performance-wise, bigger issue is fetching metadata.

Web UI is single page app so it fetches all in first request and then it uses AJAX calls to get things done so it would not be a big benefit.

This ticket:
I will use Endi's idea and move extension.js to subfolder.

Petr Vobornik

Freeipa-devel mailing list

Reply via email to