| Author |
Message |
sunburnt

Joined: 08 Jun 2005 Posts: 4016 Location: Arizona, U.S.A.
|
Posted: Sun 10 Jun 2012, 01:00 Post subject:
Not programming again... Command creates double path? |
|
The command I use to modify the binary exec. is creating double paths.
././/share/games/lbreakout2/gfx/././/share/games/lbreakout2/gfx/AbsoluteB/bricks.png
The command:
| Code: | | find . -type f -exec sed -i -e "s|/usr|././|g" {} \; |
It changes /usr to ././ in all the binary files it finds.
Last edited by sunburnt on Sun 10 Jun 2012, 03:26; edited 2 times in total
|
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 2449
|
Posted: Sun 10 Jun 2012, 01:46 Post subject:
|
|
Haven't we been down this road before?
|
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 4016 Location: Arizona, U.S.A.
|
Posted: Sun 10 Jun 2012, 03:23 Post subject:
|
|
That was the initial problem, now it is having /share problems.
The command I use to modify the binary exec. is creating double paths.
././/share/games/lbreakout2/gfx/././/share/games/lbreakout2/gfx/AbsoluteB/bricks.png
|
|
Back to top
|
|
 |
Karl Godt

Joined: 20 Jun 2010 Posts: 2734 Location: Kiel,Germany
|
Posted: Sun 10 Jun 2012, 07:12 Post subject:
|
|
s#/usr#\./\./# could end up in
/usr/share -> ././/share
I think you might be good at escaping dots for they are (posix?) regular expressions meaning one char .
Normally i could understand something like ../../ to make relative paths .
don't know if ././share will work .
sed can be a pain . sed uses the LANG=en_US environment, probably use "export LANG=C" OR "LC_ALL=C sed -i []" for some operations .
-e is needed if you combine multiple sedstrings; i don't use sed -e, i use sed 's[];s[]' the semicolon to add more commands to sed .
There had been problems on Lupu-52x with mount passing -n option to ntfs-3g, which had not been before. Maybe glibc has its differences (2.11.1<vs>2.11.2) and probably such things happen to sed too .
|
|
Back to top
|
|
 |
Karl Godt

Joined: 20 Jun 2010 Posts: 2734 Location: Kiel,Germany
|
Posted: Sun 10 Jun 2012, 07:22 Post subject:
|
|
And sed 's[]g' substitutes all patterns in a line GLOBALLY.
sed 's[]' without 'g' substitutes the first pattern in a line .
Note : LINE meaning ONE LINE , not the whole script .
Everything in the script gets changed using 'g' option to 's' command ,
while without 'g' every first pattern of all lines in script gets changed .
|
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 4016 Location: Arizona, U.S.A.
|
Posted: Sun 10 Jun 2012, 10:59 Post subject:
|
|
Hi again Karl; You`ve been a real busy guy around this Puppy forum!
I got the command at the Tiny Core forum, it`s used to make SCM files.
Replacing /usr with ././ has the same character count. but ends up as ././/
I too wondered how the mangled path could possibly work, but it does!
Seems like ././ would work okay, but // seems like it`d crash the path.
You run the command in the root dir. of a binary package and it "fixes" all
the /usr paths in all the binary exec. files in the package, exec. libs too.
What bugs me is that I had the LBreakout app. running, and it borked.
Now the "fix" command seems to mess up the path by doubling it.
The problem is with the share path, so I can`t fix it with LD_LIBRARY_PATH
like I just did with the Fox ToolKit package.
I rather like LBreakout, it`s great late night when your brain`s not working.
|
|
Back to top
|
|
 |
Karl Godt

Joined: 20 Jun 2010 Posts: 2734 Location: Kiel,Germany
|
Posted: Sun 10 Jun 2012, 15:19 Post subject:
|
|
Don't know anything about SCM files .
There seem to be a several .scm extensions :
http://www.fileinfo.com/extension/scm
?
Googling "SCM files" threw your Tiny Core adventure under the first 10 :
http://forum.tinycorelinux.net/index.php?topic=13221.0
and there seems to be another thread for SCM by yours .
It seems that nobody has much experience with SCM ..
*
To substitute " usr " with some " ././././ " there are several ways :
where the second would be safer i think because that would filter /usrusrusretc/ directories ..
|
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 4016 Location: Arizona, U.S.A.
|
Posted: Sun 10 Jun 2012, 20:46 Post subject:
|
|
Thanks Karl; It looks like the fix command mangled the path badly.
It`s a first for it, I can`t figure out what`s different this time.
I`ve started with a clean slate of files and it does the same thing.
I`m going to lay it to the side for now and try to finish the SqApp tools.
I`m posting a problem with mksquashfs, it ignores hidden files.
Looking at the help, it says nothing about it. It seems kinda strange.
FIXED: Globbing does not include hidden files, don`t use "*", use ".".
|
|
Back to top
|
|
 |
|