FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Packaging

 
 
LinkBack Thread Tools
 
Old 06-28-2011, 11:58 AM
Farkas Levente
 
Default define versus global !?

hi,
sorry for cross posting but may be someone on the packaging/rpm side can
help me. i'm getting really angry about the debug packages:-)
does anybody who can tell me the real reason of why:
------------------------------------
%define __debug_install_post %{mingw_debug_install_post}
------------------------------------
works why
------------------------------------
%global __debug_install_post %{mingw_debug_install_post}
------------------------------------
not?
imho if i can know the answer to this question i can solve my only
remaining issue with generated spec file for mingw.
if why this in the spec file working:
------------------------------------
%define __debug_install_post %{mingw_debug_install_post}
------------------------------------
while this not:
test:
------------------------------------
echo "%define __debug_install_post %{mingw_debug_install_post}"
------------------------------------
and in the spec file:
------------------------------------
%global test sh /tmp/test
%{expand:%(%{test})}
------------------------------------
???
the same thing is working for all other macro except for
__debug_install_post.
thanks in advance.
regards.

--
Levente "Si vis pacem para bellum!"
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 06-28-2011, 11:58 AM
Farkas Levente
 
Default define versus global !?

hi,
sorry for cross posting but may be someone on the packaging/rpm side can
help me. i'm getting really angry about the debug packages:-)
does anybody who can tell me the real reason of why:
------------------------------------
%define __debug_install_post %{mingw_debug_install_post}
------------------------------------
works why
------------------------------------
%global __debug_install_post %{mingw_debug_install_post}
------------------------------------
not?
imho if i can know the answer to this question i can solve my only
remaining issue with generated spec file for mingw.
if why this in the spec file working:
------------------------------------
%define __debug_install_post %{mingw_debug_install_post}
------------------------------------
while this not:
test:
------------------------------------
echo "%define __debug_install_post %{mingw_debug_install_post}"
------------------------------------
and in the spec file:
------------------------------------
%global test sh /tmp/test
%{expand:%(%{test})}
------------------------------------
???
the same thing is working for all other macro except for
__debug_install_post.
thanks in advance.
regards.

--
Levente "Si vis pacem para bellum!"
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 06-28-2011, 12:08 PM
Pierre-Yves Chibon
 
Default define versus global !?

On Tue, 2011-06-28 at 13:58 +0200, Farkas Levente wrote:
> does anybody who can tell me the real reason of why:
> ------------------------------------
> %define __debug_install_post %{mingw_debug_install_post}
> ------------------------------------
> works why
> ------------------------------------
> %global __debug_install_post %{mingw_debug_install_post}
> ------------------------------------
> not?

Did you check:
https://fedoraproject.org/wiki/Packaging/Guidelines#.25global_preferred_over_.25define

There are some explanations there.

Best regards,
Pierre
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 06-28-2011, 12:08 PM
Pierre-Yves Chibon
 
Default define versus global !?

On Tue, 2011-06-28 at 13:58 +0200, Farkas Levente wrote:
> does anybody who can tell me the real reason of why:
> ------------------------------------
> %define __debug_install_post %{mingw_debug_install_post}
> ------------------------------------
> works why
> ------------------------------------
> %global __debug_install_post %{mingw_debug_install_post}
> ------------------------------------
> not?

Did you check:
https://fedoraproject.org/wiki/Packaging/Guidelines#.25global_preferred_over_.25define

There are some explanations there.

Best regards,
Pierre
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 06-28-2011, 01:12 PM
Farkas Levente
 
Default define versus global !?

On 06/28/2011 02:08 PM, Pierre-Yves Chibon wrote:
> On Tue, 2011-06-28 at 13:58 +0200, Farkas Levente wrote:
>> does anybody who can tell me the real reason of why:
>> ------------------------------------
>> %define __debug_install_post %{mingw_debug_install_post}
>> ------------------------------------
>> works why
>> ------------------------------------
>> %global __debug_install_post %{mingw_debug_install_post}
>> ------------------------------------
>> not?
>
> Did you check:
> https://fedoraproject.org/wiki/Packaging/Guidelines#.25global_preferred_over_.25define
>
> There are some explanations there.

yes but still don't know why can't be used at toplevel and why can't be
generated by script.

--
Levente "Si vis pacem para bellum!"
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 06-28-2011, 03:42 PM
Toshio Kuratomi
 
Default define versus global !?

On Tue, Jun 28, 2011 at 03:12:26PM +0200, Farkas Levente wrote:
> On 06/28/2011 02:08 PM, Pierre-Yves Chibon wrote:
> > On Tue, 2011-06-28 at 13:58 +0200, Farkas Levente wrote:
> >> does anybody who can tell me the real reason of why:
> >> ------------------------------------
> >> %define __debug_install_post %{mingw_debug_install_post}
> >> ------------------------------------
> >> works why
> >> ------------------------------------
> >> %global __debug_install_post %{mingw_debug_install_post}
> >> ------------------------------------
> >> not?
> >
> > Did you check:
> > https://fedoraproject.org/wiki/Packaging/Guidelines#.25global_preferred_over_.25define
> >
> > There are some explanations there.
>
> yes but still don't know why can't be used at toplevel and why can't be
> generated by script.
>
I can't tell you why without knowing more about what's being expanded but --
%global is evaluated when it is defined whereas %define is evaluated when it
is used.

Does that help?

-Toshio
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 07-04-2011, 10:49 PM
Farkas Levente
 
Default define versus global !?

On 06/28/2011 05:42 PM, Toshio Kuratomi wrote:
> On Tue, Jun 28, 2011 at 03:12:26PM +0200, Farkas Levente wrote:
>> On 06/28/2011 02:08 PM, Pierre-Yves Chibon wrote:
>>> On Tue, 2011-06-28 at 13:58 +0200, Farkas Levente wrote:
>>>> does anybody who can tell me the real reason of why:
>>>> ------------------------------------
>>>> %define __debug_install_post %{mingw_debug_install_post}
>>>> ------------------------------------
>>>> works why
>>>> ------------------------------------
>>>> %global __debug_install_post %{mingw_debug_install_post}
>>>> ------------------------------------
>>>> not?
>>>
>>> Did you check:
>>> https://fedoraproject.org/wiki/Packaging/Guidelines#.25global_preferred_over_.25define
>>>
>>> There are some explanations there.
>>
>> yes but still don't know why can't be used at toplevel and why can't be
>> generated by script.
>>
> I can't tell you why without knowing more about what's being expanded but --
> %global is evaluated when it is defined whereas %define is evaluated when it
> is used.
>
> Does that help?

not really. so why this line:
------------------------------------
%define __debug_install_post %{mingw_debug_install_post}
------------------------------------
run the %mingw_debug_install_post right after the %install phase, while
this two line do not:
------------------------------------
%global test 1
%{?test: %define __debug_install_post %{mingw_debug_install_post}}
------------------------------------
neither
------------------------------------
%define __debug_install_post %{mingw_debug_install_post}
------------------------------------
thanks.

--
Levente "Si vis pacem para bellum!"
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 07-10-2011, 12:47 PM
Farkas Levente
 
Default define versus global !?

On 07/05/2011 12:49 AM, Farkas Levente wrote:
> On 06/28/2011 05:42 PM, Toshio Kuratomi wrote:
>> On Tue, Jun 28, 2011 at 03:12:26PM +0200, Farkas Levente wrote:
>>> On 06/28/2011 02:08 PM, Pierre-Yves Chibon wrote:
>>>> On Tue, 2011-06-28 at 13:58 +0200, Farkas Levente wrote:
>>>>> does anybody who can tell me the real reason of why:
>>>>> ------------------------------------
>>>>> %define __debug_install_post %{mingw_debug_install_post}
>>>>> ------------------------------------
>>>>> works why
>>>>> ------------------------------------
>>>>> %global __debug_install_post %{mingw_debug_install_post}
>>>>> ------------------------------------
>>>>> not?
>>>>
>>>> Did you check:
>>>> https://fedoraproject.org/wiki/Packaging/Guidelines#.25global_preferred_over_.25define
>>>>
>>>> There are some explanations there.
>>>
>>> yes but still don't know why can't be used at toplevel and why can't be
>>> generated by script.
>>>
>> I can't tell you why without knowing more about what's being expanded but --
>> %global is evaluated when it is defined whereas %define is evaluated when it
>> is used.
>>
>> Does that help?
>
> not really. so why this line:
> ------------------------------------
> %define __debug_install_post %{mingw_debug_install_post}
> ------------------------------------
> run the %mingw_debug_install_post right after the %install phase, while
> this two line do not:
> ------------------------------------
> %global test 1
> %{?test: %define __debug_install_post %{mingw_debug_install_post}}
> ------------------------------------
> neither
> ------------------------------------
> %define __debug_install_post %{mingw_debug_install_post}
> ------------------------------------
> thanks.
>

i find the reason but don't know how to solve. the problem was
%{?buildsubdir} which is not defined in the header part of the spec file
just in and after the %setup section. which means it's very hard to
define any kind of macro for __debug_install_post in the header part
without know which directory contains the compiled code so where have to
extract the debug info...
any tip?

--
Levente "Si vis pacem para bellum!"
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 08-10-2011, 03:57 PM
Kalev Lember
 
Default define versus global !?

On 07/10/2011 03:47 PM, Farkas Levente wrote:
> On 07/05/2011 12:49 AM, Farkas Levente wrote:
>>>>> On Tue, 2011-06-28 at 13:58 +0200, Farkas Levente wrote:
>>>>>> does anybody who can tell me the real reason of why:
>>>>>> ------------------------------------
>>>>>> %define __debug_install_post %{mingw_debug_install_post}
>>>>>> ------------------------------------
>>>>>> works why
>>>>>> ------------------------------------
>>>>>> %global __debug_install_post %{mingw_debug_install_post}
>>>>>> ------------------------------------
>>>>>> not?
>
> i find the reason but don't know how to solve. the problem was
> %{?buildsubdir} which is not defined in the header part of the spec file
> just in and after the %setup section. which means it's very hard to
> define any kind of macro for __debug_install_post in the header part
> without know which directory contains the compiled code so where have to
> extract the debug info...
> any tip?
>

One of the differences between %global and %define is that %define is
lazily expanded, but global is not. Now if you say that buildsubdir
definition isn't available when you are setting __debug_install_post, it
means you need to use lazy expansion. This is probably the reason why
%define works for you but %global doesn't: %global is expanded at
definition time. If you really want to use %global instead of %define,
you could try forcing lazy expansion by escaping %:

%global __debug_install_post %%{mingw_debug_install_post}
^^ force lazy expansion


Hope this helps,
Kalev
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 08-19-2011, 10:39 PM
Farkas Levente
 
Default define versus global !?

On Wed, Aug 10, 2011 at 17:57, Kalev Lember <kalevlember@gmail.com> wrote:
> On 07/10/2011 03:47 PM, Farkas Levente wrote:
>> On 07/05/2011 12:49 AM, Farkas Levente wrote:
>>>>>> On Tue, 2011-06-28 at 13:58 +0200, Farkas Levente wrote:
>>>>>>> does anybody who can tell me the real reason of why:
>>>>>>> ------------------------------------
>>>>>>> %define __debug_install_post %{mingw_debug_install_post}
>>>>>>> ------------------------------------
>>>>>>> works why
>>>>>>> ------------------------------------
>>>>>>> %global __debug_install_post %{mingw_debug_install_post}
>>>>>>> ------------------------------------
>>>>>>> not?
>>
>> i find the reason but don't know how to solve. the problem was
>> %{?buildsubdir} which is not defined in the header part of the spec file
>> just in and after the %setup section. which means it's very hard to
>> define any kind of macro for __debug_install_post in the header part
>> without know which directory contains the compiled code so where have to
>> extract the debug info...
>> any tip?
>>
>
> One of the differences between %global and %define is that %define is
> lazily expanded, but global is not. Now if you say that buildsubdir
> definition isn't available when you are setting __debug_install_post, it
> means you need to use lazy expansion. This is probably the reason why
> %define works for you but %global doesn't: %global is expanded at
> definition time. If you really want to use %global instead of %define,
> you could try forcing lazy expansion by escaping %:
>
> %global __debug_install_post %%{mingw_debug_install_post}
> * * * * * * * * * * * * * * ^^ force lazy expansion

YES!!!
you're my hero!:-)

--
* Levente* * * * * * * * * * * * * * ** "Si vis pacem para bellum!"
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 

Thread Tools




All times are GMT. The time now is 02:24 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org