[pacman-dev] [PATCH] makepkg: speed up svn revision check for large repositories
Dan McGee
dpmcgee at gmail.com
Wed Jul 16 07:39:11 EDT 2008
On Wed, Jul 16, 2008 at 6:33 AM, Allan McRae <allan at archlinux.org> wrote:
> Dan McGee wrote:
>> On Wed, Jul 16, 2008 at 1:45 AM, Xavier <shiningxc at gmail.com> wrote:
>>
>>> Allan McRae wrote:
>>>
>>>> Dan McGee wrote:
>>>>
>>>>> On Tue, Jul 15, 2008 at 7:15 PM, Dan McGee <dan at archlinux.org> wrote:
>>>>>
>>>>>
>>>>>> Using the suggestion from FS#10905, use 'svn info' rather than 'svn log' to
>>>>>> get the current revision number, which is much quicker for large Subversion
>>>>>> repositories. Eventually git will rule the world. :)
>>>>>>
>>>>>> Signed-off-by: Dan McGee <dan at archlinux.org>
>>>>>> ---
>>>>>> scripts/makepkg.sh.in | 2 +-
>>>>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>>>>
>>>>>> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
>>>>>> index b810d60..2ab2aef 100644
>>>>>> --- a/scripts/makepkg.sh.in
>>>>>> +++ b/scripts/makepkg.sh.in
>>>>>> @@ -1017,7 +1017,7 @@ devel_check() {
>>>>>> elif [ ! -z ${_svntrunk} ] && [ ! -z ${_svnmod} ] ; then
>>>>>> [ $(type -p svn) ] || return 0
>>>>>> msg "$(gettext "Determining latest svn revision...")"
>>>>>> - newpkgver=$(svn log $_svntrunk --limit 1 -q | sed -n 's/^r\([0-9]*\) .*$/\1/p')
>>>>>> + newpkgver=$(LC_ALL= LANG= svn info $_svntrunk | sed -n 's/^Last Changed Rev: \([0-9]*\)$/\1/p')
>>>>>>
>>>>>>
>>>>> I settled on this after I saw a similar use case elsewhere in makepkg:
>>>>> echo "# $(LC_ALL= LANG= date -u)" >>.PKGINFO
>>>>> I think it makes sense. Let me know if anyone has better ideas.
>>>>>
>>>>>
>>>>>
>>>> From memory, that is the cleaner way to unset the locales so it is all
>>>> good.
>>>>
>>>>
>>> Here is a filtered output of git grep LC_ALL :
>>>
>>> contrib/bacman:echo "# $(LC_ALL=C date)" >> .PKGINFO
>>>
>> This one should probably change to match makepkg anyway...
>>
>>
>>> doc/makepkg.8.txt:seeking help or for other purposes, you may wish to
>>> run "`LC_ALL=C makepkg`" so
>>>
>> I don't think this one is as big of deal, do you?
>>
>>
>>> scripts/makepkg.sh.in: echo "# $(LC_ALL= LANG= date -u)" >>.PKGINFO
>>>
>>> So maybe we could change the first two for a better consistency?
>>>
>
> Hmmm, after some google searching. LC_ALL appears to override any other
> LC_* variable and the LANG variable. So "LANG=" here is redundant. I
> couldn't find whether there is a difference between "LC_ALL=C" and
> "LC_ALL=" but I am suspecting there isn't...
Hmm, ok. That does make sense.
Whatever works and is simplest is fine with me, and it would be ideal
for it to work on platforms besides Linux as well.
-Dan
More information about the pacman-dev
mailing list