Package: fai-client
Version: 3.4.8
Severity: important
Tags: patch

Dear Maintainer,

fai-do-script applies regexes to the output of "file -b" to determine how to 
handle
the files under the scripts directory.  The output of "file -b" has changed. 
Again.

There are two attachments, one is a test case script that shows what happens 
for Perl.
The other is a patch that can be imported into git that resolves this, for now.

Cheers!


-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.14-vs2.3.2.8-beng (SMP w/2 CPU cores)
Locale: LANG=en_NZ.UTF-8, LC_CTYPE=POSIX (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages fai-client depends on:
ii  file                      5.11-1
ii  libapt-pkg-perl           0.1.26
ii  libparse-recdescent-perl  1.967009+dfsg-1
ii  perl                      5.14.2-9

Versions of packages fai-client recommends:
ii  cfengine2      2.2.10-5
ii  debconf-utils  1.5.42

Versions of packages fai-client suggests:
pn  cryptsetup  <none>
pn  dmsetup     2:1.02.74-3
pn  ntfsprogs   <none>
>From 0fcf71bb5bccf9f6f91681d92215ffb6d669b4b0 Mon Sep 17 00:00:00 2001
From: Andrew Ruthven <p...@catalyst.net.nz>
Date: Tue, 8 May 2012 09:55:13 +1200
Subject: [PATCH] file -b now returns the first letter as being uppercase for
 some scripts.

---
 bin/fai-do-scripts |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/fai-do-scripts b/bin/fai-do-scripts
index 33e0bfd..7e6e1b5 100755
--- a/bin/fai-do-scripts
+++ b/bin/fai-do-scripts
@@ -142,7 +142,7 @@ do_script() {
             fc_check_status $file $exitcode | tee -a $LOGDIR/cfengine.log
         ;;
 
-        *"perl"*"script"*)
+        *"[Pp]erl"*"script"*)
             echo "Executing    perl: $file"
             echo "=====   perl: $file   =====" >> $LOGDIR/perl.log 2>&1
             ./$file >> $LOGDIR/perl.log 2>&1
@@ -158,7 +158,7 @@ do_script() {
             fc_check_status $file $exitcode | tee -a $LOGDIR/expect.log
         ;;
 
-        *"python"*"script"*)
+        *"[Pp]ython"*"script"*)
             echo "Executing  python: $file"
             echo "=====   python: $file   =====" >> $LOGDIR/python.log 2>&1
             ./$file >> $LOGDIR/python.log 2>&1
@@ -166,7 +166,7 @@ do_script() {
             fc_check_status $file $exitcode | tee -a $LOGDIR/python.log
         ;;
 
-        *"ruby"*"script"*)
+        *"[Rr]uby"*"script"*)
             echo "Executing ruby: $file"
             echo "=====   ruby: $file   =====" >> $LOGDIR/ruby.log 2>&1
             ./$file >> $LOGDIR/ruby.log 2>&1
-- 
1.7.10

#!/bin/bash

# The output from file -b on a file with "/usr/bin/perl -w" as the shebang.
filetype="a /usr/bin/perl -w script text executable"

echo "filetype: $filetype";

case $filetype in
  *"perl*script"*)
    echo "What is in fai-do-script now, doesn't match."
  ;;
  *perl*script*)
    echo "What should be in fai-do-script, does match"
  ;;
  *) echo "No hits" ;;
esac

Reply via email to