#1 2007-03-17 14:39:00

debugger
Member
Registered: 2007-03-17
Posts: 44

Installation problem on Linux, non-root.

Linux Fedora Core 6, x86_64.

I have some problems with gcstar 1.0.0, so I decided to try version 1.1.1. I downloaded it from this site, untarred, and run installer:

(Current directory is ~/tmp/gcstar, ~/gcstar EXISTS and writable.)

$ ./install --prefix=~/gcstar

Mandatory components

Cwd                                OK
Cwd 'realpath'                     OK
Data::Dumper                       OK
Encode                             OK
Exporter                           OK
File::Basename                     OK
File::Copy                         OK
File::Path                         OK
File::Spec                         OK
File::Temp                         OK
FindBin                            OK
Gtk2                               OK
Gtk2::SimpleList                   OK
HTML::Entities                     OK
IO::Handle                         OK
LWP                                OK
LWP::Simple                        OK
Net::SMTP                          OK
Storable                           OK
Text::Wrap                         OK
URI::Escape                        OK
XML::Parser                        OK
XML::Simple                        OK

Optional Components

Archive::Tar                       OK
Archive::Zip                       Missing
Compress::Zlib                     OK
Digest::MD5                        OK
File::Path                         OK
MIME::Base64                       OK
MP3::Info                          Missing
MP3::Tag                           Missing
Ogg::Vorbis::Header::PurePerl      Missing

Error: You don't have permission to write in the selected directory

??? I definetely have permission to write to selected directory:

$ touch ~/gcstar/foo
$ ll ~/gcstar/
total 0
-rw-r--r-- 1 debugger dbg 0 Mar 17 17:37 foo

Offline

 

#2 2007-03-17 18:49:24

Tian
Administrator
From: France
Registered: 2006-12-08
Posts: 1647
Website

Re: Installation problem on Linux, non-root.

Hello,

I think the problem is because you used ~ in your path. There is for the moment nothing in the installer to replace it with the home directory as the shell does.

Please try again with a full path. e.g.

Code:

./install --prefix=/home/debugger/gcstar

I will update that in a future version once you confirmed that's the problem.

Offline

 

#3 2007-03-19 12:19:41

debugger
Member
Registered: 2007-03-17
Posts: 44

Re: Installation problem on Linux, non-root.

Hi,

Thanks for quick reply.

No, ~ does not matter. If I use full path /home/debugger/gcstar, result is exactly the same.

I think we could localize the problem faster and more easily if error message contains the name of directory.

Offline

 

#4 2007-03-20 07:39:05

debugger
Member
Registered: 2007-03-17
Posts: 44

Re: Installation problem on Linux, non-root.

Hi,

I found the bug:

install:223:

Code:

    eval 'mkpath $dir' if (! -e $dir);
    if (-w $dir && !$@)
    {
        clean $dir unless ($withoutClean);
        installMenu unless ($withoutMenu);
        doInstall $dir;
        $dir .= '/' if $dir !~ /\/$/;
        print "\n",$lang{InstallEnd},"\n",$lang{InstallNoError},"\n",$lang{InstallLaunch},$dir,"bin/",$binName,"\n";
    
        exit 0;
     }
     else 
     {
         print $lang{InstallNoPermission}."\n";
         exit 0;
     }

$dir exists and is writable; $@ is not empty (it contains error messages related to some optional modules); so ( -w $dir && ! $@ ) is false, control flow goes to "else" part and prints wrong error message...

Offline

 

#5 2007-03-20 09:25:13

Tian
Administrator
From: France
Registered: 2006-12-08
Posts: 1647
Website

Re: Installation problem on Linux, non-root.

Hello,

I didn't have time to look at this problem. So thank you very much for your investigations.

Could you please print the content of $@ when it fails. So we could know where the problem exactly is. As we used an eval, this variable should have been reseted. So it could only contain errors about this instruction.

Offline

 

#6 2007-03-21 09:16:02

debugger
Member
Registered: 2007-03-17
Posts: 44

Re: Installation problem on Linux, non-root.

Tian,

eval is NOT executed because the directory exists:

Code:

eval 'mkpath $dir' if (! -e $dir);

It is Perl tricky syntax -- I prefer this variant:

Code:

if ( -e $dir ) {
    eval 'mkpath $dir';
};

a bit more talkative, but much more readable.

Ok, let us get back. This eval is NOT executed, because $dir EXISTS. $@ contains error messages from the previous eval -- something about not found modules (I do not have installed few optional modules).

I would recommend something like this:

Code:

    if ( ! -e $dir ) {
        eval { mkpath( $dir ); };
        if ( $@ ) {
            print( "Cannot create dir \"$dir\": $!\n" );
            exit( 1 );
        }; # if
    }; # if

$@ should be checked if and only if eval is really executed...

Offline

 

#7 2007-03-21 13:46:22

Tian
Administrator
From: France
Registered: 2006-12-08
Posts: 1647
Website

Re: Installation problem on Linux, non-root.

Oops, stupid me. I will change this to something as you suggested. Thank you very much for your help.

Offline

 

#8 2007-03-22 11:17:50

debugger
Member
Registered: 2007-03-17
Posts: 44

Re: Installation problem on Linux, non-root.

Thank you for the program and accepting suggestions. I have some more... ;-)

Offline

 



Should you have a problem using GCstar, you can open a bug report or request some support on GCstar forums.