filemnt wont mount iso with space in the directory name.

Please post any bugs you have found
Post Reply
Message
Author
aarf

filemnt wont mount iso with space in the directory name.

#1 Post by aarf »

filemnt wont mount iso with a space in the directory name this bug is in recent puppies saluki and racy.
/mnt/sdc6/sa luki/luki-0.0.2.iso wont mount
/mnt/sdc6/saluki/luki-0.0.2.iso will mount.
probably in other puppies as well

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#2 Post by Karl Godt »

ALLMOST ALL PUPPY SCRIPTS are NOT written to work with spaces in directory names and file names .

Should be simply

Code: Select all

[ ! -e `which filemnt`.backup ] && cp `which filemnt` `which filemnt`.backup
e=0
sed -i 's#\(\$[a-zA-Z]*\)#"\1"#g' `which filemnt` 
e=$((e+$?))
sed -i 's#""#"#g' `which filemnt` 
e=$((e+$?))
sed -i 's#= " #= ""#g' `which filemnt`
e=$((e+$?))
sed -i 's#= ""]#= "" ]#g' `which filemnt`
e=$((e+$?))
sed -i 's#"\$"#"\$#g' `which filemnt`
e=$((e+$?))
sed -i 's#"\$1}#"\$1"}#g' `which filemnt`
e=$((e+$?))
sed -i 's#"\$?#"\$?"#g' `which filemnt`
e=$((e+$?))
sed -i 's#Err="\$?""#Err="\$?"#g' `which filemnt`
e=$((e+$?))
sed -i 's#\*"\$/#\*\$/#g' `which filemnt`
e=$((e+$?))
sed -i 's#echo -e "\(.*\)"\(.*\)"#echo -e "\1\2"#g' `which filemnt`
e=$((e+$?))
sed -i 's#echo -e "\(.*\)"\(.*\)"#echo -e "\1\2"#g' `which filemnt`
e=$((e+$?))
sed -i 's#-text "\(.*\)"\(.*\)"#-text "\1\2"#g' `which filemnt`
e=$((e+$?))
sed -i 's#-text "\(.*\)"\(.*\)"#-text "\1\2"#g' `which filemnt`
e=$((e+$?))
sed -i 's#"basename "\$imgFile"#"`basename "\$imgFile"`"#g' `which filemnt`  ##430 BUG
e=$((e+$?))
[ "$e" -ne '0' ] && echo ERR && cp -f `which filemnt`.backup `which filemnt`
This is on puppy 430 --racy has got the new cryptmount part so this code may not work on racy ...
sed worked for me today but may not work another day .
for other scripts replace `which filemnt` with "$1"
so it would be ./make-space-proof.sh '/ p a t h / t o / f i l e n a m e .sh'
:P

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#3 Post by sunburnt »

I`ll look at filemnt and see what can be done... T.

aarf

#4 Post by aarf »

@Karl Godt it is not clear what to do with your code so i cant test it.

assuming it isnt fixed,
so whatever happens there needs to be a better explanation that just "mount failed". something like "remove spaces in directory path, or move file to a different directory" if/when mount fails for this reason.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#5 Post by Karl Godt »

The code double quotes all $VAR to "$VAR" in the script .
This does not harm as long there is no for content in $LIST in the code .
for content in "$LIST" would have only one content : the whole list .

So it is to double quote every $VAR and clean up afterwards if there had been already double quotes around $VARS in the script BUT restore tests again and xmessage/yaf-splash quoting ... and others ...

So you would probably need a
diff -up `which filemnt` `which filemnt`.backup
to check everything . diff may need to have the devx installed (?)

[ $var != 0 ] && echo H #would spit an error if var was not set before ~maybe good for debugging
[ "$var" != 0 ] && echo H #would not spit an error . I prefer quoting here too .

stifiling
Posts: 388
Joined: Sun 30 Dec 2007, 03:56

#6 Post by stifiling »

I've gotten it to work by compiling util-linux_2.20.1 and rewriting the filemnt file.

I can now mount and unmount iso and squashfs files, even with spaces in the directory name.

Post Reply