Page 1 of 2

Writing to Newtwork share via slkbuild script

Posted: 16. May 2010, 12:46
by laprjns
I've been trying to set up a network directory for all my package builds and using gigolo to connect to them. However I've run into the following problem writing to the directories.

Code: Select all

rich[~]$ 
rich[~]$ cd .gvfs/shared_data\ on\ slugo_server/salix_builds/noarch/pysolfc/
rich[pysolfc]$ slkbuild -g 
cp: target `slugo_server/salix_builds/noarch/pysolfc/SLKBUILD' is not a directory
At first I thought it was a permissions issue but now I don't think it is

Code: Select all

rich[pysolfc]$ ls
./  ../
rich[pysolfc]$ cp /etc/slkbuild/SLKBUILD .
rich[pysolfc]$ ls
./  ../  SLKBUILD*
So I started to look at the slkbuild script and as a test I changed the line "cp $TEMPLATE $startdir/SLKBUILD" to "cp $TEMPLATE ./SLKBUILD" and now was able to write the SLKBUILD file to the directory. I know this is not the solution, but it lead me to looking into startdir="$(pwd)". I did the following test:

Code: Select all

rich[pysolfc]$ startdir="$(pwd)"
rich[pysolfc]$ echo $startdir 
/home/rich/.gvfs/shared_data on slugo_server/salix_builds/noarch/pysolfc
rich[pysolfc]$ cp /etc/slkbuild/SLKBUILD $startdir 
cp: target `slugo_server/salix_builds/noarch/pysolfc' is not a directory
rich[pysolfc]$ ls
It looks to me like there is some issue with gigolo (gvfs-fuse?) mounted directory path. Any ideas?
I know that I can mount the directories by fstab, but I would really like to be able use gigolo,because it's some what easier to setup.
Thanks
Rich

Re: Writing to Newtwork share via slkbuild script

Posted: 16. May 2010, 12:51
by Akuna
Is this with 13.1 ?

Gigolo worked fine here with 13.0 but seems broken in 13.1

Re: Writing to Newtwork share via slkbuild script

Posted: 16. May 2010, 12:57
by damNageHack
laprjns wrote:

Code: Select all

rich[pysolfc]$ startdir="$(pwd)"
rich[pysolfc]$ echo $startdir 
/home/rich/.gvfs/shared_data on slugo_server/salix_builds/noarch/pysolfc
rich[pysolfc]$ cp /etc/slkbuild/SLKBUILD $startdir 
cp: target `slugo_server/salix_builds/noarch/pysolfc' is not a directory
rich[pysolfc]$ ls
You probably have to escape the spaces for the cd command.

Re: Writing to Newtwork share via slkbuild script

Posted: 16. May 2010, 13:39
by laprjns
Akuna wrote:Is this with 13.1 ?
It's 13.1
damNageHack wrote:You probably have to escape the spaces for the cd command.
cd'ing works fine, but I agree that the problem seems to has something to do with the spaces in the gigolo (gvfs.fuse) mounting path.
Rich

Re: Writing to Newtwork share via slkbuild script

Posted: 16. May 2010, 14:11
by Shador
You've got two possibilities.
a. Get rid of the spaces in the patch. I would recommend this to you as many other shell scripts could run into problems otherwise.
b. Change slkbuild (and possibly any other shell script) to always use quotes. I.e. make them pathes with space compatible. This gets really tricky if you've got a list of files, because bash uses ' ' as separator for lists. In that case you would have to look at the IFS variable.

Re: Writing to Newtwork share via slkbuild script

Posted: 16. May 2010, 15:31
by laprjns
Shador wrote:a. Get rid of the spaces in the patch.
I'm assuming that "patch" is a typo and you meant path. Can't get ride of the spaces, since this is the way that gigolo or gvfs.fues mount the director path. I tried looking for config files, even udev and hal rules to see if i could fix it there but I couldn't find anything.
I will try changing slkbuild for a test, but in the long run I would prefer to stay with the stock script

Thanks
Rich

Re: Writing to Newtwork share via slkbuild script

Posted: 16. May 2010, 15:40
by Shador
laprjns wrote:I'm assuming that "patch" is a typo and you meant path. Can't get ride of the spaces, since this is the way that gigolo or gvfs.fues mount the director path. I tried looking for config files, even udev and hal rules to see if i could fix it there but I couldn't find anything.
Yes, it's a typo. ;)
Instead of changing gigolo's behaviour you could try to change the name of the share to not contain spaces.
If that's still not possible, something worth trying would be a symlink like ln -s "path/with spaces" path/without/spaces

Re: Writing to Newtwork share via slkbuild script

Posted: 16. May 2010, 20:04
by laprjns
Shador wrote:Instead of changing gigolo's behaviour you could try to change the name of the share to not contain spaces.
That's the problem, the share name does not have spaces in it.
"smb://slugo_server/shared_data/"
The spaces in /shared_data on slugo_server/ is either a samba or gigolo thing.

Re: Writing to Newtwork share via slkbuild script

Posted: 16. May 2010, 20:49
by gapan
I'm not sure how smart it is to build packages in a network share, especially a samba share. All sorts of trouble could potentially come up.

Re: Writing to Newtwork share via slkbuild script

Posted: 17. May 2010, 08:56
by JRD
For me, it's a bug (minor) in slkbuild script which should always use double quotes in pathes.
We should be able to use spaces in our pathes if we want/should. Unfortunately, there are a lot of scripts (including mine, I sometimes forget) that do not protect pathes.