How to convert code from doinst.sh to pinstall.sh? (Solved)

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

How to convert code from doinst.sh to pinstall.sh? (Solved)

#1 Post by RSH »

Hi.

Below is a code snippet from a doinst.sh script taken from a .txz package.

Precise's bash could not execute this script (after making it executable). It complains a directory not found.

The missing / in front of the usr/bin parts is the problem.

Since I do usually NOT know, what content such doinst.sh script might include, I'm searching for a quick/short solution to transform these lines into lines that can be executed in bash in precise.

Any hints?

Code: Select all

( cd usr/bin ; rm -rf jack_disconnect )
( cd usr/bin ; ln -sf jack_connect jack_disconnect )
( cd usr/lib ; rm -rf libjackserver.so.0 )
( cd usr/lib ; ln -sf libjackserver.so.0.1.0 libjackserver.so.0 )
( cd usr/lib ; rm -rf libjack.so.0 )
( cd usr/lib ; ln -sf libjack.so.0.1.0 libjack.so.0 )
( cd usr/lib ; rm -rf libjack.so )
( cd usr/lib ; ln -sf libjack.so.0.1.0 libjack.so )
( cd usr/lib ; rm -rf libjackserver.so )
( cd usr/lib ; ln -sf libjackserver.so.0.1.0 libjackserver.so )
Last edited by RSH on Fri 04 Jul 2014, 11:55, edited 1 time in total.
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

stemsee

#2 Post by stemsee »

geany search and replace!

find: usr/bin
replace in whole document with: /usr/bin

Is that what you mean?

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#3 Post by RSH »

Thanks for your tip, but this wasn't what I was looking for.

Currently I'm working on an extension for the PaDS Application, which can merge .pet and .deb files into a single .sfs file. Just want to add option to include .txz files into this process, so it can build SFS Modules for Slacko from .txz and .pet files.

So I was looking for a bash code snippet that would turn the above shown code into something that can be executed by bash.

Just played a little since I've had done my post - and found a solution.

Will offer this with an update of PaDS or even PaDTS...

Solved.
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#4 Post by 01micko »

As soon as the .t?z archive is unpacked just execute

Code: Select all

sh install/doinst.sh
... as long as you are at "/", or just source it.

If you really want to convert to a pinstall.sh just mv it to "/", rename, insert a shebang with sed or bash or your favourite scripting language, make executable and you are good... but that's the hard way. :)

The path will work as relative if you are at "/" instead of absolute. Doesn't matter.
Puppy Linux Blog - contact me for access

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#5 Post by RSH »

01micko wrote:As soon as the .t?z archive is unpacked just execute

Code: Select all

sh install/doinst.sh
... as long as you are at "/", or just source it.

If you really want to convert to a pinstall.sh just mv it to "/", rename, insert a shebang with sed or bash or your favourite scripting language, make executable and you are good... but that's the hard way. :)

The path will work as relative if you are at "/" instead of absolute. Doesn't matter.
Thanks!

PaDS 1.0.4 now available to download and test!
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

Post Reply