Re: ifclass syntax within if statement

2013-10-17 Diskussionsfäden Thomas Neumann
On Thursday 17 October 2013 07:31:33 Thomas Lange wrote:
  On Wed, 16 Oct 2013 16:12:04 -0700, Bob Apodaca said:
 When installing AMD64 systems, I have created a small script:
 #!/bin/sh
 
 if ifclass AMD64 ; then
 
  # https://wiki.debian.org/Multiarch/Implementation
  $ROOTCMD dpkg --add-architecture i386
 
 fi
 
 Did you put those lines into hooks/updatebase.DEBIAN?
 That works for me.

Both answers point to the same issue. 'ifclass' is a bash function / 
subroutine. If one uses a different interpreter then bash, one will not be 
able to use any of the fai-specific functions.

Hooks are automatically parsed in a bash context, scripts use whatever 
interpreter you choose.

'/bin/sh' is likely to be provided by dash on recent debian releases and 
bash on older ones, but it ~could~ be something completely different. It's 
been a long time since I saw a system which provided /bin/sh by an actual 
'Bourne shell'.

bye
thomas


Re: ifclass syntax within if statement

2013-10-16 Diskussionsfäden Holger Parplies
Hi,

Bob Apodaca wrote on 2013-10-16 16:12:04 -0700 [ifclass syntax within if 
statement]:
 When installing AMD64 systems, I have created a small script:
 
 #!/bin/sh
 
 if ifclass AMD64 ; then

I believe you need /bin/bash for ifclass. You should be seeing error messages
in your shell.log.

Regards,
Holger


Re: ifclass syntax within if statement

2013-10-16 Diskussionsfäden Thomas Lange
 On Wed, 16 Oct 2013 16:12:04 -0700, Bob Apodaca 
 b...@phxlab.honeywell.com said:

 When installing AMD64 systems, I have created a small script:
 #!/bin/sh

 if ifclass AMD64 ; then
  # https://wiki.debian.org/Multiarch/Implementation
  $ROOTCMD dpkg --add-architecture i386
 fi
Did you put those lines into hooks/updatebase.DEBIAN?
That works for me.
-- 
regards Thomas