2012/6/7 Jorge Barroso <jorge.barroso.11@gmail.com>:
2012/6/7 rafael ff1 <rafael.f.f1@gmail.com>
I was debugging your PKGBUILD and how the behavior of LDM, and I was not able to find any problem related to user permissions. Maybe you can enlighten me.
Only problem I figure out is that when the ~/.LMD do not exists, running /usr/bin/lmd will report errors messages because it did not find ~/LMD/options... That is upstream's fault, as it should be able to figure out that ~/.LMD/options doesn't exist before trying to source it... Is this the problem you are having script related
Yes, that's the problem I have, the source is made by a student, so it's not complete, and I added a piece of source that checks if .LMD exists and if it doesn't exists it is created, without having to make anything (sed -s '325s#then#then\n\t[ ! -d ~/.LMD ] \&\& lmd -reconf#' -i "${pkgdir}"/usr/bin/lmd)
yeah, I gave you this idea. ;) It has some problems, as LMD tried to source ~/.LMD/options (in line 5) before this piece of source. Also, why call "lmd -reconf" instead "lmd -reconf"? - not one of my brightest idea.
But as the program owner after the installation is by default root, it doesn't works... moreover, the program can't be run as root, so I tried to change the user, with chown, and after that, as it doesn't worked, tried with another script on the post_install
*if { [ ! -d /home/$USER /.LMD ] then lmd -reconf else echo "*\033[1;32m* .LMD already exists* \033[0m*"*
The problem is that $USER is root, so it works, but only on the /root folder, and it should do that on the local user folder
So, the problem is... $USER shouldn't be 'root', but the local user (in my case, for example, jorge). If I can do that I think the both two scripts will work... but I don't know how...
You did not understand. If we are talking about same issue, the problem is not a user permission related. See below the output I get when ~/.LMD doesn't exist and I run /usr/bin/lmd, installed with your package. This will happen only once, as in the second time ~/.LMD was already created: $ lmd /usr/bin/lmd: line 5: /home/rafael/.LMD/options: No such file or directory /usr/bin/lmd: line 6: source: /usr/share/lmd/langs/: is a directory /usr/bin/lmd: line 5: /home/rafael/.LMD/options: No such file or directory /usr/bin/lmd: line 6: source: /usr/share/lmd/langs/: is a directory -reconf completed ** (gtkdialog:12958): ERROR **: gtkdialog: Error in line 23, near token '</label>': syntax error /usr/bin/lmd: line 346: 12958 Trace/breakpoint trap gtkdialog --program=MAIN_DIALOG Solution to this issue is: replace 'sed' code you mentioned above with the patch I sent to the upstream [1] along with this line: patch -p1 "${pkgdir}"/usr/bin/lmd lmd-run-reconf.patch [1] http://code.google.com/p/linux-manga-downloader/issues/detail?id=4 Rafael