Bug#390346: (no subject)
IMO the solution using abspath=$(cd $dir;pwd) to get the absolute path of dir does not work. When calling fai dirinstall relpath the user will specify a relative path that does not exist yet. So the cd will not work. Also using readlink -f will not help when the relative path does not exist. IMO it's better to force the user to specify an absolute path and to print a good error message in case he specifies a relative path. -- regards Thomas -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#390346: (no subject)
Hi, On Thursday 02 November 2006 15:10, Thomas Lange wrote: IMO it's better to force the user to specify an absolute path and to print a good error message in case he specifies a relative path. why is it better to force someone to behave like the programm wants, instead of making the programm do, what the user wants? If the directory doesn't exist, create it. Doesnt matter if the path is relative or absolute. regards, Holger pgpFhw5wEO19j.pgp Description: PGP signature
Bug#390346: (no subject)
On Thu, 2 Nov 2006 16:49:36 +0100, Holger Levsen [EMAIL PROTECTED] said: If the directory doesn't exist, create it. Doesnt matter if the path is relative or absolute. Sure this directory will be created. But it does matter in this case if it's relative or absolute. That's the bug. -- regards Thomas -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#390346: (no subject)
On Thu, 2 Nov 2006 16:49:36 +0100, Holger Levsen [EMAIL PROTECTED] said: If the directory doesn't exist, create it. Doesnt matter if the path is relative or absolute. Sure this directory will be created. But it does matter in this case if it's relative or absolute. That's the bug. Why not combine the approaches? mkdir -p $target (where target may be relative) and then target=`readlink -f $target` If this is done before task_defvar is executed, it should be all fine. Best, Michael pgpOPznXgU1oo.pgp Description: PGP signature
Bug#390346: (no subject)
Would it be OK to check if the path for dirinstall is an absolute path? If not, fai could print an error message. Or should fai convert a relative path to an absolute one? -- regards Thomas -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#390346: (no subject)
Would it be OK to check if the path for dirinstall is an absolute path? If not, fai could print an error message. Or should fai convert a relative path to an absolute one? In my opinion fai should definitely accept a relative path; the patch I supplied is supposed to make fai deal with relative paths correctly and use them as is. On the other hand, I already noted the use of readlink to make a relative path an absolute one, which would be another way to go. Best, Michael pgp7dmQRMTGsc.pgp Description: PGP signature
Bug#390346: (no subject)
Thomas Lange wrote: Currently I do not remobmer which function returns the canonical path. How can I convert a relativ path to an absolute path? [...] What about readlink -f bla ? It's not bash-builtin but included in coreutils, so it should be fine. HTH, Michael pgpTa46ZxhxDB.pgp Description: PGP signature
Bug#390346: (no subject)
Currently I do not remobmer which function returns the canonical path. How can I convert a relativ path to an absolute path? -- regards Thomas -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#390346: (no subject)
Thomas Lange wrote: Currently I do not remobmer which function returns the canonical path. How can I convert a relativ path to an absolute path? Because there's nothing to remember :) In BASH, there's no builtin function to to that. I did that not so long ago but somehow don't remember it now and where I did it. Here's one idea( from http://www.daniweb.com/techtalkforums/thread41035.html): You can get the path of your script with $0 : SCRIPT_DIR=`dirname $0` #relative path or, to get absolute path : INITIAL_DIR=`pwd` # Save current dir cd `dirname $0` # Go to script dir SCRIPT_DIR=`pwd` # Save script dir cd ${INITIAL_DIR} # Go back to initial directory Henning -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]