Change or bug in file-command evtl. messed-up fai-do-scripts execution

2014-03-21 Diskussionsfäden René Bleisch

Hi,
Apparently, something went amiss with the linux file command since it 
was last updated in apt... (last week or so)


At least, my perl configure-scripts are not recognized anymore as 
perl-scripts, but as awk-scripts.


On a machine which was last updated 10.3.2014, the script was recognized 
correctly
root@phkup46:/var/lib/fai/config/scripts/NFS_CLIENT# file -bL 
10-create-directories

a /usr/bin/perl -w script text executable

But on a machine updated last week, it  gives:
root@kupmenai:/var/lib/fai/config/scripts/NFS_CLIENT# file -bL 
10-create-directories

*awk* script, ASCII text

which is wrong.

I didnt change the file inbetween and the file correctly starts with 
#!/usr/bin/perl -w in the header


In the following, my perl configure scripts are not executed anymore by 
fai-do-scripts and I got errors like:
file NFS_CLIENT/10-create-directories has unsupported type awk script, 
ASCII text.


- Does anyone also have this problem?
- Does anyone have a solution?
(I will also try to find one by myself)

Regards
René Bleisch


Re: Change or bug in file-command evtl. messed-up fai-do-scripts execution

2014-03-21 Diskussionsfäden Toomas Tamm
Hello,

(1) I can not reproduce this. What is your exact version of file
according to dpkg? Mine is 5.11-2+deb7u2  (my Debian is wheezy).

$ cat test
#!/usr/bin/perl -w
print Hello World\n;
$ file test
test: Perl script, ASCII text executable

(2) Could it be something specific in your script? Try deleting parts of
the script (in a copy, of course) and see if file starts detecting
correctly after some specific part of the script is gone.

If you can show what exactly causes it, you may file a bug against
file in Debian BTS.

Toomas

On Fri, 2014-03-21 at 12:06 +0100, René Bleisch wrote:
 Hi,
 Apparently, something went amiss with the linux file command since
 it was last updated in apt... (last week or so)



Re: Change or bug in file-command evtl. messed-up fai-do-scripts execution

2014-03-21 Diskussionsfäden René Bleisch

Hi Toomas,
Both PCs are wheezy (Linux ... 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 
x86_64 GNU/Linux)


file-versions:
works correctly: 5.11-2+deb7u*1*
doesn't work: 5.11-2+deb7u*2*

Most likely the  problem is due to the BEGIN { ...} block which is in 
the opening of the respective perl-scripts.
( see 
http://perldoc.perl.org/perlmod.html#BEGIN%2c-UNITCHECK%2c-CHECK%2c-INIT-and-END 
for explanation)

--
#!/usr/bin/perl -w
use strict;

*BEGIN {**
**   if ( !$ENV{'PERL_MODULES'} ) {**
**  $ENV{'PERL_MODULES'}= '/srv/fai/config/perl_modules';**
**   }**
**   unshift @INC, $ENV{'PERL_MODULES'};**
**}*

use FAI;
use NFS::Clients;


--

When I removed the BEGIN { ...} block, file recognizes the script 
correctly.


I'll try to replace this block and I will make a bug report.

Regards
René


On 03/21/2014 12:27 PM, Toomas Tamm wrote:

Hello,

(1) I can not reproduce this. What is your exact version of file
according to dpkg? Mine is 5.11-2+deb7u2  (my Debian is wheezy).

$ cat test
#!/usr/bin/perl -w
print Hello World\n;
$ file test
test: Perl script, ASCII text executable

(2) Could it be something specific in your script? Try deleting parts of
the script (in a copy, of course) and see if file starts detecting
correctly after some specific part of the script is gone.

If you can show what exactly causes it, you may file a bug against
file in Debian BTS.

Toomas

On Fri, 2014-03-21 at 12:06 +0100, René Bleisch wrote:

Hi,
Apparently, something went amiss with the linux file command since
it was last updated in apt... (last week or so)


Re: Change or bug in file-command evtl. messed-up fai-do-scripts execution

2014-03-21 Diskussionsfäden Robert Schüttler
* René Bleisch accou...@climate.unibe.ch [2014-03-21 12:08]:

 Apparently, something went amiss with the linux file command since it was
 last updated in apt... (last week or so)
 
 At least, my perl configure-scripts are not recognized anymore as
 perl-scripts, but as awk-scripts.

OK, here's your bug-#:

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=742262

Best regards, Robert


Re: Change or bug in file-command evtl. messed-up fai-do-scripts execution

2014-03-21 Diskussionsfäden Ralf Utermann
On 21.03.2014 13:10, René Bleisch wrote:
 Hi Toomas,
 Both PCs are wheezy (Linux ... 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64
 GNU/Linux)
 
 file-versions:
 works correctly: 5.11-2+deb7u*1*
 doesn't work: 5.11-2+deb7u*2*  
 
 Most likely the  problem is due to the BEGIN { ...} block which is in the
 opening of the respective perl-scripts.
 ( see

I can confirm this. Looks like the problem is
/usr/share/file/magic.mgc in package libmagic1 (5.11-2+deb7u2).
If you install the new packages, but keep an old version of
magic.mgc, it's recognized as perl.
With wheezy-backports libmagic1 (1:5.14-2~bpo70+1) it's also ok.

regards, Ralf
-- 
Ralf Utermann
_
Universität Augsburg, Institut für Physik   --   EDV-Betreuer
Universitätsstr.1
D-86135 Augsburg Phone:  +49-821-598-3231
SMTP: ralf.uterm...@physik.uni-augsburg.de Fax: -3411


Re: Change or bug in file-command evtl. messed-up fai-do-scripts execution

2014-03-21 Diskussionsfäden René Bleisch

Hi Robert,
I was faster than you :-( (should have informed fai-mailing)

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=742262

Regards
René

On 03/21/2014 01:31 PM, Robert Schüttler wrote:

* René Bleisch accou...@climate.unibe.ch [2014-03-21 12:08]:


Apparently, something went amiss with the linux file command since it was
last updated in apt... (last week or so)

At least, my perl configure-scripts are not recognized anymore as
perl-scripts, but as awk-scripts.

OK, here's your bug-#:

   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=742262

Best regards, Robert




Re: Change or bug in file-command evtl. messed-up fai-do-scripts execution

2014-03-21 Diskussionsfäden René Bleisch

sorry,
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=742265

(and you were a bit faster than me...)

On 03/21/2014 01:49 PM, René Bleisch wrote:

Hi Robert,
I was faster than you :-( (should have informed fai-mailing)

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=742262

Regards
René

On 03/21/2014 01:31 PM, Robert Schüttler wrote:

* René Bleisch accou...@climate.unibe.ch [2014-03-21 12:08]:


Apparently, something went amiss with the linux file command since
it was
last updated in apt... (last week or so)

At least, my perl configure-scripts are not recognized anymore as
perl-scripts, but as awk-scripts.

OK, here's your bug-#:

   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=742262

Best regards, Robert




--
Dr. René Bleisch
University of Bern
Climate and Environmental Physics
Sidlerstr.5
3012 Bern
Switzerland

Phone: +41 31 631 34 02
Mail: blei...@climate.unibe.ch



Re: Change or bug in file-command evtl. messed-up fai-do-scripts execution

2014-03-21 Diskussionsfäden René Bleisch

Thanks a lot for your suggestion, this temporary fix also works for me!

Regards
René

On 03/21/2014 01:41 PM, Ralf Utermann wrote:

On 21.03.2014 13:10, René Bleisch wrote:

Hi Toomas,
Both PCs are wheezy (Linux ... 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64
GNU/Linux)

file-versions:
works correctly: 5.11-2+deb7u*1*
doesn't work: 5.11-2+deb7u*2*

Most likely the  problem is due to the BEGIN { ...} block which is in the
opening of the respective perl-scripts.
( see

I can confirm this. Looks like the problem is
/usr/share/file/magic.mgc in package libmagic1 (5.11-2+deb7u2).
If you install the new packages, but keep an old version of
magic.mgc, it's recognized as perl.
With wheezy-backports libmagic1 (1:5.14-2~bpo70+1) it's also ok.

regards, Ralf