[Freeipa-devel] [PATCH] Fixed rpm build warning - extension.js listed twice

Petr Vobornik pvoborni at redhat.com
Wed Mar 14 15:23:22 UTC 2012


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.
>>
>> Problem:
>> Building the ipa rpms returns this:
>> warning: File listed twice: /usr/share/ipa/ui/extension.js
>>
>> Cause:
>> This is because of a glob:
>> %{_usr}/share/ipa/ui/*.js
>>
>> and then more specifically:
>> %config(noreplace) %{_usr}/share/ipa/ui/extension.js
>>
>> https://fedorahosted.org/freeipa/ticket/2253
>>
>> 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
>> directory:
>>
>> 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?
> http://developer.yahoo.com/performance/rules.html#num_http
>
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




More information about the Freeipa-devel mailing list