public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog kde5-functions.eclass kde5.eclass
       [not found] <20150627220221.BA4C673F@oystercatcher.gentoo.org>
@ 2015-06-28  2:12 ` Michał Górny
  2015-06-28 12:25   ` Johannes Huber
  0 siblings, 1 reply; 6+ messages in thread
From: Michał Górny @ 2015-06-28  2:12 UTC (permalink / raw
  To: Johannes Huber (johu); +Cc: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 6768 bytes --]

Dnia 2015-06-27, o godz. 22:02:21
"Johannes Huber (johu)" <johu@gentoo.org> napisał(a):

> johu        15/06/27 22:02:21
> 
>   Modified:             ChangeLog kde5-functions.eclass kde5.eclass
>   Log:
>   Sync kde5*eclass with kde overlay. Handle more whitespace variations by Michael Palimaka <kensington@gentoo.org>. Fixes translation handling by Michael Palimaka <kensington@gentoo.org> and Andreas Sturmlechner <andreas.sturmlechner@gmail.com>, bug #552664. Raises deps on KDE Frameworks and KDE Plasma Manuel Rüger <mrueg@gentoo.org>.
> 
> Revision  Changes    Path
> 1.1691               eclass/ChangeLog
> 
> file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1691&view=markup
> plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1691&content-type=text/plain
> diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1690&r2=1.1691
> 
> Index: ChangeLog
> ===================================================================
> RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
> retrieving revision 1.1690
> retrieving revision 1.1691
> diff -u -r1.1690 -r1.1691
> --- ChangeLog	27 Jun 2015 17:41:20 -0000	1.1690
> +++ ChangeLog	27 Jun 2015 22:02:21 -0000	1.1691
> @@ -1,6 +1,14 @@
>  # ChangeLog for eclass directory
>  # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
> -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1690 2015/06/27 17:41:20 mpagano Exp $
> +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1691 2015/06/27 22:02:21 johu Exp $
> +
> +  27 Jun 2015; Johannes Huber <johu@gentoo.org> kde5-functions.eclass,
> +  kde5.eclass:
> +  Sync kde5*eclass with kde overlay. Handle more whitespace variations by
> +  Michael Palimaka <kensington@gentoo.org>. Fixes translation handling by
> +  Michael Palimaka <kensington@gentoo.org> and Andreas Sturmlechner
> +  <andreas.sturmlechner@gmail.com>, bug #552664. Raises deps on KDE Frameworks
> +  and KDE Plasma Manuel Rüger <mrueg@gentoo.org>.
>  
>    27 Jun 2015; Mike Pagano <mpagano@gentoo.org> kernel-2.eclass:
>    Fix conditional bug for UNIPATCH_DROP
> 
> 
> 
> 1.9                  eclass/kde5-functions.eclass
> 
> file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/kde5-functions.eclass?rev=1.9&view=markup
> plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/kde5-functions.eclass?rev=1.9&content-type=text/plain
> diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/kde5-functions.eclass?r1=1.8&r2=1.9
> 
> Index: kde5-functions.eclass
> ===================================================================
> RCS file: /var/cvsroot/gentoo-x86/eclass/kde5-functions.eclass,v
> retrieving revision 1.8
> retrieving revision 1.9
> diff -u -r1.8 -r1.9
> --- kde5-functions.eclass	8 Jun 2015 12:27:32 -0000	1.8
> +++ kde5-functions.eclass	27 Jun 2015 22:02:21 -0000	1.9
> @@ -1,6 +1,6 @@
>  # Copyright 1999-2015 Gentoo Foundation
>  # Distributed under the terms of the GNU General Public License v2
> -# $Header: /var/cvsroot/gentoo-x86/eclass/kde5-functions.eclass,v 1.8 2015/06/08 12:27:32 mrueg Exp $
> +# $Header: /var/cvsroot/gentoo-x86/eclass/kde5-functions.eclass,v 1.9 2015/06/27 22:02:21 johu Exp $
>  
>  # @ECLASS: kde5-functions.eclass
>  # @MAINTAINER:
> @@ -26,12 +26,12 @@
>  # @ECLASS-VARIABLE: FRAMEWORKS_MINIMAL
>  # @DESCRIPTION:
>  # Minimal Frameworks version to require for the package.
> -: ${FRAMEWORKS_MINIMAL:=5.10.0}
> +: ${FRAMEWORKS_MINIMAL:=5.11.0}> -			RDEPEND+="
>  
>  # @ECLASS-VARIABLE: PLASMA_MINIMAL
>  # @DESCRIPTION:
>  # Minimal Plasma version to require for the package.
> -: ${PLASMA_MINIMAL:=5.3.0}
> +: ${PLASMA_MINIMAL:=5.3.1}
>  
>  # @ECLASS-VARIABLE: KDE_APPS_MINIMAL
>  # @DESCRIPTION:
> @@ -218,7 +218,7 @@
>  	local prefix=${1}
>  	local dep=${2}
>  
> -	pcregrep -Mn "(?s)find_package\(\s*${prefix}.[^)]*?${dep}.*?\)" CMakeLists.txt > "${T}/bogus${dep}"
> +	pcregrep -Mn "(?s)find_package\s*\(\s*${prefix}.[^)]*?${dep}.*?\)" CMakeLists.txt > "${T}/bogus${dep}"
>  
>  	# pcregrep returns non-zero on no matches/error
>  	if [[ $? != 0 ]] ; then
> @@ -232,7 +232,7 @@
>  	sed -e "${first},${last}s/${dep}//" -i CMakeLists.txt || die
>  
>  	if [[ ${length} = 1 ]] ; then
> -		sed -e "/find_package(\s*${prefix}\s*REQUIRED\s*COMPONENTS\s*)/d" -i CMakeLists.txt || die
> +		sed -e "/find_package\s*(\s*${prefix}\s*REQUIRED\s*COMPONENTS\s*)/d" -i CMakeLists.txt || die
>  	fi
>  }
>  
> 
> 
> 
> 1.11                 eclass/kde5.eclass
> 
> file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/kde5.eclass?rev=1.11&view=markup
> plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/kde5.eclass?rev=1.11&content-type=text/plain
> diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/kde5.eclass?r1=1.10&r2=1.11
> 
> Index: kde5.eclass
> ===================================================================
> RCS file: /var/cvsroot/gentoo-x86/eclass/kde5.eclass,v
> retrieving revision 1.10
> retrieving revision 1.11
> diff -u -r1.10 -r1.11
> --- kde5.eclass	31 May 2015 15:51:21 -0000	1.10
> +++ kde5.eclass	27 Jun 2015 22:02:21 -0000	1.11
> @@ -1,6 +1,6 @@
>  # Copyright 1999-2015 Gentoo Foundation
>  # Distributed under the terms of the GNU General Public License v2
> -# $Header: /var/cvsroot/gentoo-x86/eclass/kde5.eclass,v 1.10 2015/05/31 15:51:21 mrueg Exp $
> +# $Header: /var/cvsroot/gentoo-x86/eclass/kde5.eclass,v 1.11 2015/06/27 22:02:21 johu Exp $
>  
>  # @ECLASS: kde5.eclass
>  # @MAINTAINER:
> @@ -142,10 +142,7 @@
>  		fi
>  
>  		if [[ ${KDE_BLOCK_SLOT4} = true && ${CATEGORY} = kde-apps ]]; then
> -			RDEPEND+="
> -				!kde-apps/${PN}:4
> -				!kde-base/${PN}
> -			"
> +			RDEPEND+=" !kde-apps/${PN}:4"
>  		fi
>  		;;
>  esac
> @@ -376,11 +373,20 @@
>  	# enable only the requested translations
>  	# when required
>  	if [[ ${KDE_BUILD_TYPE} = release ]] ; then
> -		for lang in $(ls po 2> /dev/null) ; do
> -			if ! has ${lang} ${LINGUAS} ; then
> -				rm -rf po/${lang}
> -			fi
> -		done
> +		if [[ -d po ]] ; then
> +			pushd po > /dev/null

||die.

> +			for lang in $(ls) ; do

How about... for lang in *?

> +				if ! has ${lang} ${LINGUAS} ; then
> +					if [[ ${lang} != CMakeLists.txt ]] ; then
> +						rm -rf ${lang}

||die.

> +					fi
> +					if [[ -e CMakeLists.txt ]] ; then
> +						comment_add_subdirectory ${lang}
> +					fi
> +				fi
> +			done
> +			popd > /dev/null

||die.

> +		fi
>  
>  		if [[ ${KDE_HANDBOOK} = true ]] ; then
>  			pushd doc > /dev/null

Here too btw.

-- 
Best regards,
Michał Górny
<http://dev.gentoo.org/~mgorny/>

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 949 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog kde5-functions.eclass kde5.eclass
  2015-06-28  2:12 ` [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog kde5-functions.eclass kde5.eclass Michał Górny
@ 2015-06-28 12:25   ` Johannes Huber
  2015-06-28 12:46     ` Patrice Clement
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Huber @ 2015-06-28 12:25 UTC (permalink / raw
  To: Michał Górny; +Cc: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 245 bytes --]

On Sunday 28 June 2015 04:12:01 Michał Górny wrote:

> > +			for lang in $(ls) ; do
> 
> How about... for lang in *?

What is the advantage?

Greetings
-- 
Johannes Huber (johu)
Gentoo Linux Developer / KDE Team
GPG Key ID FDF4F788

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 951 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog kde5-functions.eclass kde5.eclass
  2015-06-28 12:25   ` Johannes Huber
@ 2015-06-28 12:46     ` Patrice Clement
  2015-06-28 15:14       ` Alexis Ballier
  0 siblings, 1 reply; 6+ messages in thread
From: Patrice Clement @ 2015-06-28 12:46 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michal Górny

[-- Attachment #1: Type: text/plain, Size: 688 bytes --]

man 3 glob
man 3 fnmatch
man 1 bash -> read the section called "Pattern Matching" under "EXPANSION".

in this case, $(ls) would unnecessarily spawn a subshell for listing files. You
can often get the same result by using wildcard expansion (or globbing) like
Michal said:

for lang in *; do
    ...
done

It is often faster.

Cheers,
Patrice

Sunday 28 Jun 2015 14:25:25, Johannes Huber wrote :
> On Sunday 28 June 2015 04:12:01 Michal Górny wrote:
> 
> > > +			for lang in $(ls) ; do
> > 
> > How about... for lang in *?
> 
> What is the advantage?
> 
> Greetings
> -- 
> Johannes Huber (johu)
> Gentoo Linux Developer / KDE Team
> GPG Key ID FDF4F788



[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog kde5-functions.eclass kde5.eclass
  2015-06-28 12:46     ` Patrice Clement
@ 2015-06-28 15:14       ` Alexis Ballier
  2015-06-28 15:38         ` Dan Douglas
  0 siblings, 1 reply; 6+ messages in thread
From: Alexis Ballier @ 2015-06-28 15:14 UTC (permalink / raw
  To: gentoo-dev

On Sun, 28 Jun 2015 14:46:01 +0200
Patrice Clement <monsieurp@gentoo.org> wrote:

> man 3 glob
> man 3 fnmatch
> man 1 bash -> read the section called "Pattern Matching" under
> "EXPANSION".
> 
> in this case, $(ls) would unnecessarily spawn a subshell for listing
> files. You can often get the same result by using wildcard expansion
> (or globbing) like Michal said:
> 
> for lang in *; do
>     ...
> done
> 
> It is often faster.


and it avoids aliases:

/etc $ echo $(ls)
total 1.7M drwxr-xr-x 4 root root 4.0K Aug 29 2014 acpi -rw-r--r-- 1
root root 44 Oct 6 2014 adjtime drwxr-xr-x 2 root root 4.0K Jun 26
19:27 adobe drwxr-xr-x 3 root root 4.0K Mar 22 15:46 ardour3 drwxr-xr-x
3 root root 4.0K May 8 13:14 ardour4 drwxr-xr-x 2 root root 4.0K Jun 15
17:06 at-spi2 drwxr-xr-x 3 root root etc.

I doubt that is what is wanted



However, beware of empty directories:

/tmp/toto $ ls
total 0
/tmp/toto $ for a in *; do echo $a; done                                                                                                                                                                                                                       
*


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog kde5-functions.eclass kde5.eclass
  2015-06-28 15:14       ` Alexis Ballier
@ 2015-06-28 15:38         ` Dan Douglas
  2015-06-28 16:03           ` Martin Vaeth
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Douglas @ 2015-06-28 15:38 UTC (permalink / raw
  To: gentoo-dev

On Sun, Jun 28, 2015 at 10:14 AM, Alexis Ballier <aballier@gentoo.org> wrote:
> On Sun, 28 Jun 2015 14:46:01 +0200
> Patrice Clement <monsieurp@gentoo.org> wrote:
>
>> man 3 glob
>> man 3 fnmatch
>> man 1 bash -> read the section called "Pattern Matching" under
>> "EXPANSION".
>>
>> in this case, $(ls) would unnecessarily spawn a subshell for listing
>> files. You can often get the same result by using wildcard expansion
>> (or globbing) like Michal said:
>>
>> for lang in *; do
>>     ...
>> done
>>
>> It is often faster.
>
>
> and it avoids aliases:
>
> /etc $ echo $(ls)
> total 1.7M drwxr-xr-x 4 root root 4.0K Aug 29 2014 acpi -rw-r--r-- 1
> root root 44 Oct 6 2014 adjtime drwxr-xr-x 2 root root 4.0K Jun 26
> 19:27 adobe drwxr-xr-x 3 root root 4.0K Mar 22 15:46 ardour3 drwxr-xr-x
> 3 root root 4.0K May 8 13:14 ardour4 drwxr-xr-x 2 root root 4.0K Jun 15
> 17:06 at-spi2 drwxr-xr-x 3 root root etc.
>
> I doubt that is what is wanted
>
>
>
> However, beware of empty directories:
>
> /tmp/toto $ ls
> total 0
> /tmp/toto $ for a in *; do echo $a; done
> *
>

Portage doesn't enable shopt expand_aliases to my knowledge, and it
wouldn't matter if it did because aliases aren't inherited from parent
shells.

The reason for a glob aside from performance is pathname
expansion being evaluated last, after field splitting and all other
expansions. Files with names containing characters in IFS or glob
metacharacters will be mangled. `for x in $(anything)' is almost always
wrong.

A correct loop over files should be close to this (when nullglob is
disabled):

for x in *; do
    [[ -e $x ]] || continue
    ...
done


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog kde5-functions.eclass kde5.eclass
  2015-06-28 15:38         ` Dan Douglas
@ 2015-06-28 16:03           ` Martin Vaeth
  0 siblings, 0 replies; 6+ messages in thread
From: Martin Vaeth @ 2015-06-28 16:03 UTC (permalink / raw
  To: gentoo-dev

Dan Douglas <ormaaj@gmail.com> wrote:
> for x in *; do
>     [[ -e $x ]] || continue
>     ...
> done

You should also test for $x not being a symlink.
Otherwise you can miss the corner case that you have
a dead/unresolvable symlink called "*".



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-06-28 16:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20150627220221.BA4C673F@oystercatcher.gentoo.org>
2015-06-28  2:12 ` [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog kde5-functions.eclass kde5.eclass Michał Górny
2015-06-28 12:25   ` Johannes Huber
2015-06-28 12:46     ` Patrice Clement
2015-06-28 15:14       ` Alexis Ballier
2015-06-28 15:38         ` Dan Douglas
2015-06-28 16:03           ` Martin Vaeth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox