Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in sys-fs/udev: ChangeLog udev-115-r6.ebuild

2007-09-25 Thread Matthias Schwarzott
On Montag, 24. September 2007, Donnie Berkholz wrote:
 On 19:59 Mon 24 Sep , Matthias Schwarzott (zzam) wrote:
  zzam07/09/24 19:59:38
 

 This ebuild has really inconsistent use of tests, quotes in tests, and
 command substitutions. Being more consistent will increase readability
 and decrease bugs due to differences between styles. For tests, pick a
 style [[ ]] or [ ] and stick with it. The [[ ]] one is pretty nice
 because it generally doesn't require quotes, so the code looks a lot
 cleaner. For command substitions, prefer $() over ``.

  newins ${FILESDIR}/blacklist-110 blacklist
  doins ${FILESDIR}/pnp-aliases

 Quotes here.

  emake \
  EXTRAS=${extras} \
  libudevdir=${udev_helper_dir} \
  CROSS_COMPILE=${mycross} \
  OPTFLAGS= \
  ${myconf} || die
 
  emake \
  DESTDIR=${D} \
  libudevdir=${udev_helper_dir} \
  EXTRAS=${extras} \
  ${myconf} \
  install || die

 Could use some die messages here.

 Thanks,
 Donnie

fixed, thanks

Matthias

-- 
Matthias Schwarzott (zzam)
-- 
[EMAIL PROTECTED] mailing list



[gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in sys-fs/udev: ChangeLog udev-115-r6.ebuild

2007-09-25 Thread Duncan
Ryan Hill [EMAIL PROTECTED] posted [EMAIL PROTECTED],
excerpted below, on  Mon, 24 Sep 2007 20:19:34 -0600:

 Duncan wrote:
 Can you point me (and anyone else that may be interested) to a nice
 explanation of the difference?  I've always wondered why [[ ]] is
 considered better than [ ] for tests.
 
 check out http://tldp.org/LDP/abs/html/testconstructs.html#DBLBRACKETS

Thanks (to Mike and Lars too).  Seems I have some reading to do. =8^)

-- 
Duncan - List replies preferred.   No HTML msgs.
Every nonfree program has a lord, a master --
and if you use the program, he is your master.  Richard Stallman

-- 
[EMAIL PROTECTED] mailing list



[gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in sys-fs/udev: ChangeLog udev-115-r6.ebuild

2007-09-24 Thread Donnie Berkholz
On 19:59 Mon 24 Sep , Matthias Schwarzott (zzam) wrote:
 zzam07/09/24 19:59:38
 
   Modified: ChangeLog
   Added:udev-115-r6.ebuild
   Log:
   Simplified rules a bit. Let user configure max inode nr of /dev, solving 
 bug #193586.
   (Portage version: 2.1.3.9)

 1.1  sys-fs/udev/udev-115-r6.ebuild
 
 file : 
 http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/udev-115-r6.ebuild?rev=1.1view=markup
 plain: 
 http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/udev-115-r6.ebuild?rev=1.1content-type=text/plain

   if [[ ${KV_MAJOR} == 2 ]]  [[ ${KV_MINOR} == 6 ]]  [[ 
 ${KV_MICRO} -ge 15 ]]; then
   if [[ $ok = 0 ]]; then
   if [ ${MD5} != 644e3c77eb866dee4ff8dda2e95cd187 ]
   if [[ -f packages/40-${ARCH}.rules ]]; then
   if [ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]
   if [ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]
   if [ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]
   if [ -f ${ROOT}/etc/init.d/coldplug ]
   if [[ ${coldplug_stale} == 1 ]] ; then
   if [[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]]
   if [[ -d ${ROOT}/lib/udev/devices ]]; then
   if [[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]]; then
   if [[ -d ${ROOT}/etc/dev.d ]]; then
   if [[ -d ${ROOT}/etc/dev.d ]]; then
   [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] 
   if [[ ${ROOT} == / ]] ; then
   if [ -r /proc/1/root -a /proc/1/root/ -ef /proc/self/root/ ]; 
 then
   if [[ -n $(pidof udevd) ]] ; then
   MD5=`md5sum  ${S}/etc/udev/rules.d/50-udev-default.rules`

This ebuild has really inconsistent use of tests, quotes in tests, and 
command substitutions. Being more consistent will increase readability 
and decrease bugs due to differences between styles. For tests, pick a 
style [[ ]] or [ ] and stick with it. The [[ ]] one is pretty nice 
because it generally doesn't require quotes, so the code looks a lot 
cleaner. For command substitions, prefer $() over ``.

   newins ${FILESDIR}/blacklist-110 blacklist
   doins ${FILESDIR}/pnp-aliases

Quotes here.

   emake \
   EXTRAS=${extras} \
   libudevdir=${udev_helper_dir} \
   CROSS_COMPILE=${mycross} \
   OPTFLAGS= \
   ${myconf} || die

   emake \
   DESTDIR=${D} \
   libudevdir=${udev_helper_dir} \
   EXTRAS=${extras} \
   ${myconf} \
   install || die

Could use some die messages here.

Thanks,
Donnie
-- 
[EMAIL PROTECTED] mailing list



[gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in sys-fs/udev: ChangeLog udev-115-r6.ebuild

2007-09-24 Thread Duncan
Donnie Berkholz [EMAIL PROTECTED] posted
[EMAIL PROTECTED], excerpted below, on  Mon, 24 Sep 2007
13:09:57 -0700:

 For tests, pick a style
 [[ ]] or [ ] and stick with it. The [[ ]] one is pretty nice because it
 generally doesn't require quotes, so the code looks a lot cleaner.

Can you point me (and anyone else that may be interested) to a nice 
explanation of the difference?  I've always wondered why [[ ]] is 
considered better than [ ] for tests.

-- 
Duncan - List replies preferred.   No HTML msgs.
Every nonfree program has a lord, a master --
and if you use the program, he is your master.  Richard Stallman

-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in sys-fs/udev: ChangeLog udev-115-r6.ebuild

2007-09-24 Thread Mike Frysinger
On Monday 24 September 2007, Duncan wrote:
 Donnie Berkholz [EMAIL PROTECTED] posted:
  For tests, pick a style
  [[ ]] or [ ] and stick with it. The [[ ]] one is pretty nice because it
  generally doesn't require quotes, so the code looks a lot cleaner.

 Can you point me (and anyone else that may be interested) to a nice
 explanation of the difference?

i use `man bash` myself ...

 I've always wondered why [[ ]] is 
 considered better than [ ] for tests.

as Donnie pointed out, it handles quoting sanely ... it also allows for 
extended bash logic tests (like matching and regexps) as well as your 
standard logic operators

fails:
f=moo cow with space
[ ${f} = blah ]
works:
[[ ${f} == blah ]]

wildcards:
[[ ${f} == *moo* ]]

C logic operators (rather than crappy shell '-a' / '-o' / etc...):
[[ moo == foo || moo == moo  blah == doit ]]
-mike


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in sys-fs/udev: ChangeLog udev-115-r6.ebuild

2007-09-24 Thread Lars Weiler
* Duncan [EMAIL PROTECTED] [07/09/24 23:51 +]:
 Can you point me (and anyone else that may be interested) to a nice 
 explanation of the difference?  I've always wondered why [[ ]] is 
 considered better than [ ] for tests.

I read about the difference in chapter 7 of the Advanced
Bash-Scripting Guide (`emerge abs-guide`).  There are some
more nice examples.

Regards, Lars

-- 
Lars Weiler  [EMAIL PROTECTED]  +49-171-1963258
Instant Messaging : [EMAIL PROTECTED]
Gentoo Linux PowerPC  : Developer
Gentoo Infrastructure : CVS/SVN Administrator


pgpDEDA4xYkGg.pgp
Description: PGP signature


[gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in sys-fs/udev: ChangeLog udev-115-r6.ebuild

2007-09-24 Thread Ryan Hill
Duncan wrote:
 Donnie Berkholz [EMAIL PROTECTED] posted
 [EMAIL PROTECTED], excerpted below, on  Mon, 24 Sep 2007
 13:09:57 -0700:
 
 For tests, pick a style
 [[ ]] or [ ] and stick with it. The [[ ]] one is pretty nice because it
 generally doesn't require quotes, so the code looks a lot cleaner.
 
 Can you point me (and anyone else that may be interested) to a nice 
 explanation of the difference?  I've always wondered why [[ ]] is 
 considered better than [ ] for tests.

check out http://tldp.org/LDP/abs/html/testconstructs.html#DBLBRACKETS


-- 
  fonts / wxWindows / gcc-porting / treecleaners
  9B81 6C9F E791 83BB 3AB3  5B2D E625 A073 8379 37E8 (0x837937E8)

-- 
[EMAIL PROTECTED] mailing list