Page 1 of 1

[Suggestion] Changes to activate/deactivate to allow spaces

Posted: 03 Apr 2014, 06:20
by Kriss
Hello!
I've noted a couple of times that it's not possible to activate modules if they have spaces in path.
After a bit of searching I've found the way to activate such modules.
I've changed in "/opt/porteus-scripts/xorg/aufs-insert":
Line 07 "BASE=`basename $1`" >>"BASE=$(echo $* | sed -re 's/^.+\///')"
Line 30 "if [ ! -f $1 ]; then" >> "if [ ! -f "$*" ]; then"

This way I've been able to activate single module and all modules inside the "/root/test dir"

Edit: forgot a symbol "^" in sed expression. Sorry... :oops:

Re: [Suggestion] Changes to activate/deactivate to allow spa

Posted: 03 Apr 2014, 14:02
by fanthom
thanks Kriss,

will test and if ok then merge and push through porteus updates to all the people :)

Re: [Suggestion] Changes to activate/deactivate to allow spa

Posted: 03 Apr 2014, 16:41
by Kriss
You're welcome. Glad to be of any use. :)

Re: [Suggestion] Changes to activate/deactivate to allow spa

Posted: 03 Apr 2014, 17:11
by fanthom
doesn't work - i'm getting:

Code: Select all

root@porteus:~# activate /root/test\ me/test.xzm 
test: Module must end with .xzm
: Module must end with .xzm
afair there are modifications needed to /opt/porteus-scripts/activate (putting $1 between double quotes) which will break parallel activation.
please let me know if you find a workaround.

Re: [Suggestion] Changes to activate/deactivate to allow spa

Posted: 03 Apr 2014, 17:30
by Kriss
Oops... Sorry...
/opt/porteus-scripts/xorg/aufs-insert:
Line 57: mount -no loop,ro $1 $MOD 2>/dev/null >>>>>> mount -no loop,ro "$*" $MOD 2>/dev/null


/opt/porteus-scripts/xorg/xactivate:
Line 4: BASE (the same change as with aufs-insert)
Line 18: /opt/porteus-scripts/xorg/aufs-insert $1 >>>>>> /opt/porteus-scripts/xorg/aufs-insert $*


Changes are quite simple actually, changing $1 to $* and getting rid of `basename ...` because it doesn't like spaces.
I just forgetting some steps in the process.
It's also good idea to check other cases where $1 is used (I see it is being used in error messages, for example), while not critical, whis can be misleading.
Anyway modules are being "handled" one at a time as I understand...
"activate" shouldn't interfere with it, as I aunderstand, because it properly hands out `readline $filename` for every file, and that transforms to "/any path/to/a/file/file.xzm"

Re: [Suggestion] Changes to activate/deactivate to allow spa

Posted: 03 Apr 2014, 17:42
by fanthom
this one works fine with default scripts in 3.0 for parallel activation of multiple modules:

Code: Select all

activate /root/try_me/*
will your updated scripts handle this?

Code: Select all

activate /root/try\ me/*
i want complete solution so please test in runlevel 3 as well (not only GUI).

Re: [Suggestion] Changes to activate/deactivate to allow spa

Posted: 03 Apr 2014, 17:45
by Kriss
You're right. I'll check again. It works with "activate ./" inside such directories though...