LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-18-2014, 08:29 PM   #1
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,963

Rep: Reputation: 271Reputation: 271Reputation: 271
Why don't intltool perl scripts execute as perl scripts?


When trying to build systemd configure fails because, when it tries to get the version of intltool installed, it runs intltool-update --version and intltool-update gets run as though it were a shell script, not a perl script, reporting 'my' and 'use' as unrecognized commands.

Perl is installed. intltool-update begins with #!/usr/bin/perl -w. perl resides in /usr/bin, it works. perl -w intltool-update works. Other perl scripts (though none in the intltool package) work.

I assume this is a simple error, that I expose myself to your scorn, but there it is.
 
Old 01-19-2014, 04:26 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Is it called like this? .. this will fail

Code:
sh intltool-update --version
 
Old 01-19-2014, 11:35 PM   #3
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,963

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
I did nothing so foolish. Just calling it straight causes it to fail as reported. I have written a few perl scripts (use them every day, in fact); there are others from other packages. Only those in the intltool package fail this way.
 
Old 01-20-2014, 05:05 PM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Must be something in the configure script, I'll take a look today if I get some time
 
Old 01-20-2014, 05:25 PM   #5
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,340

Rep: Reputation: Disabled
Could there be non-printable characters hiding in that first line? Something that keeps the shell from interpreting it properly?
 
Old 01-20-2014, 06:09 PM   #6
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
I wouldn't have thought so .. wouldn't it fail every time then?
 
Old 01-20-2014, 06:12 PM   #7
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,340

Rep: Reputation: Disabled
I thought you said it did fail every time, except when called directly from perl which means the #!-line isn't used?
 
Old 01-20-2014, 11:24 PM   #8
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,963

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
It fails every time I call it 'straight'; it works when I call it with perl explicitly. I tried deleting the first line and rewriting it myself.

I've had intltool installed for 4 years; this must be the first time some program has wanted to use it in its build.
 
Old 01-21-2014, 03:47 AM   #9
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
I'm sorry to say it worked fine for me .. details as follows:
Code:
yum install glib2-devel glib-devel glib dbus-devel libcap-devel gperf libtool intltool gettext-devel \
 gettext-common-devel automake autoconf

./autoconf.sh

...

./configure CFLAGS='-g -O0' --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib64

...

        systemd 208

        libcryptsetup:           no
        tcpwrap:                 no
        PAM:                     yes
        AUDIT:                   yes
        IMA:                     yes
        SELinux:                 yes
        SMACK:                   no
        XZ:                      yes
        ACL:                     no
        XATTR:                   no
        GCRYPT:                  yes
        QRENCODE:                no
        MICROHTTPD:              no
        CHKCONFIG:               yes
        binfmt:                  yes
        vconsole:                yes
        readahead:               yes
        bootchart:               yes
        quotacheck:              yes
        tmpfiles:                yes
        randomseed:              yes
        backlight:               yes
        logind:                  yes
        machined:                yes
        hostnamed:               yes
        timedated:               yes
        localed:                 yes
        coredump:                yes
        polkit:                  yes
        efi:                     yes
        kmod:                    no
        blkid:                   no
        nss-myhostname:          yes
        gudev:                   yes
        gintrospection:          no
        Python:                  yes
        Python Headers:          yes
        man pages:               yes
        gtk-doc:                 no
        test coverage:           no
        Split /usr:              no
        SysV compatibility:      yes

        prefix:                  /usr
        rootprefix:              /usr
        sysconf dir:             /etc
        datarootdir:             ${prefix}/share
        includedir:              ${prefix}/include
        include_prefix:          
        lib dir:                 /usr/lib64
        rootlib dir:             /usr/lib64
        SysV init scripts:       /etc/init.d
        SysV rc?.d directories:  /etc/rc.d
        Build Python:            /bin/python
        Installation Python:     /bin/python
        sphinx binary:           
        firmware path:           
        PAM modules dir:         /usr/lib64/security
        PAM configuration dir:   /etc/pam.d
        D-Bus policy dir:        /etc/dbus-1/system.d
        D-Bus session dir:       /usr/share/dbus-1/services
        D-Bus system dir:        /usr/share/dbus-1/system-services
        D-Bus interfaces dir:    /usr/share/dbus-1/interfaces
        Bash completions dir:    /usr/share/bash-completion/completions
        Zsh completions dir:     ${datarootdir}/zsh/site-functions
        Extra start script:      /etc/rc.local
        Extra stop script:       /usr/sbin/halt.local
        Debug shell:             /sbin/sushell @ /dev/tty9

        CFLAGS:                   -pipe -Wall -Wextra -Wno-inline -Wundef -Wformat=2 -Wformat-security -Wformat-nonliteral -Wlogical-op -Wsign-compare -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing=2 -Wwrite-strings -Wno-long-long -Wno-overlength-strings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Werror=overflow -ffast-math -fno-common -fdiagnostics-show-option -fdiagnostics-color -fno-strict-aliasing -fvisibility=hidden -ffunction-sections -fdata-sections -fstack-protector --param=ssp-buffer-size=4  -g -O0
        CPPFLAGS:                  
        LDFLAGS:                  -Wl,--as-needed -Wl,--no-undefined -Wl,--gc-sections -Wl,-z,relro -Wl,-z,now  
        PYTHON_CFLAGS:           -I/usr/include/python2.7  
        PYTHON_LIBS:             -lpython2.7  


$ rpm -q intltool
intltool-0.50.2-5.fc19.noarch
Maybe autoconf is doing something strange when generating your configure script .. I tried to attach mine but it's too large for LQ, PM if you want a copy and I'll email it to you.
 
Old 01-21-2014, 01:32 PM   #10
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,963

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
Thanks for checking. You miss the point. Trying to build systemd pointed me to the problem. autoconf doesn't matter. I can try to run any intltool-* script on the command line and get the error.
 
Old 01-21-2014, 10:47 PM   #11
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Ok, so lets check some of the basics..

Code:
ls -lZ $(which intltool-update)
getenforce
which perl
 
Old 01-22-2014, 12:35 AM   #12
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,963

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
ls -lZ $(which intltool-update)
-rwxr-xr-x 1 root root ? 35000 Jan 18 19:02 /usr/bin/intltool-update*

getenforce
-bash: getenforce: command not found

which perl
/usr/bin/perl
 
Old 01-22-2014, 05:34 PM   #13
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
There isn't a space anywhere in the shebang like:
Code:
#! /usr/bin/perl -w
Or maybe an acl:
Code:
getfacl /usr/bin/intltool-update
 
Old 01-22-2014, 05:53 PM   #14
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,963

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
It had no space except that between the 'perl' and the '-w'. I tried removing the '-w'; I tried adding a space after the !

getfacl returns:

# file: usr/bin/intltool-update
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
 
Old 01-22-2014, 06:04 PM   #15
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
How about:
Code:
file /usr/bin/intltool-update
Are there any mount options for /usr or /usr/bin that could be affecting it?
Code:
grep '/usr' /etc/fstab
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl - executin all perl scripts in a specific folder aocferreira Programming 1 04-27-2011 11:57 AM
[SOLVED] Why does perl execute bash scripts? zensunni Linux - Newbie 3 11-13-2010 03:24 PM
how to execute scripts on opened tool from perl? veereshm Linux - Newbie 1 01-21-2009 05:50 PM
Apache2 on Debian won't execute perl cgi scripts, have tried chmod, Options ExecCGI dewert Linux - Software 1 07-03-2006 12:44 PM
perl scripts nightmare6667 Programming 13 06-29-2006 02:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration