Lobster Dotpup

Stuff that has yet to be sorted into a category.
Post Reply
Message
Author
User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

Lobster Dotpup

#1 Post by Lobster »

I am working on my first ever dot pup

You lucky pups!

- just because I know next to nothing about ash and bash - pah! - that will not stop me . . .

I have got the md5 check sum working and a text info thing - I have got it installing but have to be sure it is correctly placed (I have also created the make pup script) on GuestToos excellent create your own dot pup
but am having difficulties copying the file to the right place and unzipping it

so this line would be copied from the download
directory (but how do I say download from present directory - if I do)

Code: Select all

cp AutoZen-1.3.1.tar.gz /root/my-applications/bin
this seems to work Ok once the file is in place . . .

Code: Select all

tar -xzvf /root/my-applications/bin/AutoZen-1.3.1.tar.gz
here is most of the code I have been playing with

Code: Select all

#!/bin/sh

cp AutoZen-1.3.1.tar.gz /root/my-applications/bin
# cd /
# cd /root/my-applications/bin
tar -xzvf /root/my-applications/bin/AutoZen-1.3.1.tar.gz
# gunzip /root/my-applications/bin/AutoZen-1.3.1.tar.gz
# /root/my-applications/bin/AutoZen-1.3.1/autozen
# rm AutoZen-1.3.1.tar.gz
# echo '/usr/local/bin/torsmo' > /root/.packages/torsmo-1.0.files
# echo '/usr/local/lib/X11/mini-icons/torsmo.xpm' >> /root/.packages/torsmo-1.0.files
these last two lines are not right at all BUT they are to do with registering as a Pupget which ideally I would like to do . . .

Code: Select all

# echo '/usr/local/bin/torsmo' > /root/.packages/torsmo-1.0.files
# echo '/usr/local/lib/X11/mini-icons/torsmo.xpm' >> /root/.packages/torsmo-1.0.files
I have never used cp to copy files or mv to move them (I will probably use mv) so I am kinda of

:shock:

any help welcome :)
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#2 Post by GuestToo »

i used tar to save my files with absolute paths (just 1 line in make-tar)

that way i can unzip all the files to the correct places, with just 1 line in dotpup.sh
tar -xzP --no-same-owner -f dotpup.tar.gz

so if you edit make-tar, and edit it so it saves the files you want in your dotpup ... that's all you have to do

usually what i do is hold the ctrl key and click a file or folder to copy the path to the file to the clipboard ... then i middle-click in make-tar to paste the path to the file

for example, if you want these 2 files in your dotpup, you could copy/paste the paths to the files in make-tar like this:

rm -f dotpup.tar.gz
tar czvPf dotpup.tar.gz \
/usr/local/bin/torsmo \
/usr/local/lib/X11/mini-icons/torsmo.xpm

i split up the tar line but it could all be on 1 line
the P in tar czvPf is for absolute paths

when you click make-tar, it should zip all your files and folders to dotpup.tar.gz

in dotpup.sh, this line unzips dotpup.tar.gz to the same place you got the file from:
tar -xzP --no-same-owner -f dotpup.tar.gz
you don't have to change that line

so basically, your dotpup is 90% done

you might want to have a message of some sort popup, or maybe a readme file, or something

for example, if you included a file called /root/my-documents/torsmo-readme.txt, you can have it open with rox (it will do whatever it would do if you clicked the file in a rox window ... in my case it would open with leafpad ... if you have rox set to open text files with beaver, then it will open with beaver) ... like this:

tar -xzP --no-same-owner -f dotpup.tar.gz
rox /root/my-documents/torsmo-readme.txt

that's about it ... your dotpup is finished
make the dotpup by clicking make-pup
test the dotpup by clicking dotpup.pup
if it works ok, it's done

in short:
1) edit make-tar to include the files you want
2) edit dotpup.sh if you want to popup a message, and to do other stuff like make symlinks, edit config files, register with PupGet ...

i chose to have my dotpup handler unzip dotpups in a temporary dir in /root called DotPupTmpDir (i could have chosen /tmp, or the dir the dotpup was in, for example)

basically anything that's in the dotpup (which is just an ordinary zip file) will be in /root/DotPupTmpDir

for example, if you edit make-pup to add a file called readme.txt to the dotpup, then readme.txt will be in /root/DotPupTmpDir, and you could display it by adding this line to dotpup.sh:
rox readme.txt
(you could specify leafpad or beaver or mp or abiword instead of rox ... but will beaver be installed?)

everything in DotPupTmpDir will be deleted automatically when the dotpup finishes, so you may need a sleep 10 instruction to be sure your readme.txt file is there long enough for a text editor to find it ... something like this:

rox readme.txt
sleep 10

anyway, in your case, i think all you have to do is
1) edit make-tar to include the files you want
2) edit dotpup.sh to popup a message, if you like
3) edit dotpup.sh to register with PupGet
4) click make-tar
5) click make-pup

or, even shorter:
after you edit make-tar, 90% of making the dotpup is done

or you can do it using cp, mv, and tar with relative paths ... the advantage in doing it that way, is you can put files in different places, for example, the user's home dir if the user isn't root

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#3 Post by GuestToo »

loooking at your script, you don't need to gunzip your tar.gz file ... tar -xzvf already does that

later, when you rm the tar.gz file, it won't find it, because it won't be there ... it will have been gunzipped to AutoZen-1.3.1.tar (which will not get deleted)

if you do it the way i did it in my template (using tar with absolute paths) you can do it all with 1 line (and that line is already setup for you in my dotpup.sh template)

in other words, 1 line in make-tar to tar-gz all your files and folders ... 1 line in dotpup.sh to un-tar-gz all your files and folders

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#4 Post by Lobster »

Thanks G2 for the explanation
:-)

which I have tried to incorporate
(--no-same-owner - did not quite understand that but seems to do something)

This is the code in my
"autozen.sh"

Code: Select all

#!/bin/sh

cp AutoZen-1.3.1.tar.gz /root/my-applications/bin
tar -xzP --no-same-owner -f /root/my-applications/bin/AutoZen-1.3.1.tar.gz

xmessage -center "Autozen is a brain synching device
http://www.linuxlabs.com/software/AutoZen.html
This is the code in my
"make-pup"

Code: Select all

#!/bin/sh
md5sum autozen.sh > md5sum.txt
rm -f autozen.pup
zip -9 autozen.pup dotpup.sh md5sum.txt
zip -9 autozen.pup dotpup.sh AutoZen-1.3.1.tar.gz
If I run autozen.sh from the command line
I get the creation of an Autozen-1.3.1 directory from which
the prog can be accessed
but clicking on the file from ROX does not work
I seem to be making progress

but am still confused
any help appreciated
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
dvw86
Posts: 636
Joined: Thu 05 May 2005, 00:55
Location: Washington State

#5 Post by dvw86 »

If you zip it with the file paths then you will not have to use the cp (copy) command when you unzip it.

Something like this to make the tar file.

Code: Select all

#!/bin/sh
rm -f AutoZen-1.3.1.tar.gz
tar czvPf AutoZen-1.3.1.tar.gz \
/root/my-applications/bin/AutoZen-1.3.1
Something like this to make the dotpup.

Code: Select all

#!/bin/sh
md5sum dotpup.sh AutoZen-1.3.1.tar.gz > md5sum.txt
rm -f autozen.pup
zip -9 autozen.pup dotpup.sh AutoZen-1.3.1.tar.gz md5sum.txt
Something like this for the dotpup.sh

Code: Select all

#!/bin/sh
tar -xzP --no-same-owner -f AutoZen-1.3.1.tar.gz
xmessage -center "Autozen is a brain synching device
http://www.linuxlabs.com/software/AutoZen.html
You may have to play with these a little to get them to work but this is where I would start.

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#6 Post by GuestToo »

there are many ways of making a dotpup work
my template is about as simple as you can get

my template:
http://www.murga.org/~puppy/viewtopic.php?p=2509#2509

basically, you zip all the files you want into a tar.gz file ... later, when the dotpup runs, it unzips the files that are in the tar.gz file

pretty simple

you can write you own scripts ... or you can use my template

to use my template, all you do is download the template dotpup and install it ... it should put the dotpup creator template in /root/tmp/gtkfind

what you do is edit the file make-tar and put in the files you want in the dotpup

and that's it ... your dotpup is 99% done

you do not add files or rename files to the gtkfind folder ... you do not make your own tar file (make-tar already does it for you, automatically)

for example, suppose you create a file called lobster.txt, and put it in /root

suppose you want to make a dotpup that will install your lobster.txt file on other people's computers

you edit the make-tar file ... so it will look something like this:

rm -f dotpup.tar.gz
tar czvPf dotpup.tar.gz \
/root/lobster.txt

(the tar line could all be on one line, if you like)

if you click make-tar, it makes a tar.gz file called dotpup.tar.gz with all your files in it (in this case, it will have lobster.txt in it)

dotpup.sh already will unzip all your files that are in dotpup.tar.gz automatically and put them all where they belong ... so your dotpup is 99% done

if you want your dotpup to display lobster.txt in leafpad or beaver when the dotpup is clicked, you can add an instruction to do that ... add the instruction rox /root/lobster.txt to dotpup.sh, so dotpup.sh will look something like this:

tar -xzP --no-same-owner -f dotpup.tar.gz
rox /root/lobster.txt

now, when dotpup.sh runs (it runs automatically when the dotpup is clicked), it will:
1) unzip dotpup.tar.gz which has all your files in it
2) it will open lobster.txt in leafpad or beaver

the P option for tar unzips the files using absolute paths ... so all your files will be put exactly where they were originally

the --no-same-owner option makes the user who unzips the files the owner of the files, rather than the user who originally made them

you do not want to rename any of the files in the template folder ... you would have to go through all the scripts and change the file names in each one

so all you have to do:
1) edit make-tar and tell it what files you want in the dotpup
2) edit dotpup.sh and tell it to display lobster.txt

that's it ... that's all you have to do
click make-tar ... then click make-pup ... and you have a file called dotpup.pup ... when your dotpup is working ok, you can rename it

you do not have to rename any files in the template dir
you do not have to add any files to the template dir
you do not have to make any zip files or tar.gz files or cp any files or mv any file or tar any files or unzip any files or untar any files ... it's all done for you automatically

all you have to do is tell make-tar what files you want to put in the dotpup
and tell dotpup.sh if you want to display a message or register with PupGet, or anything like that

or you can write your own scripts that do pretty much the same thing ... but it's already all done for you, you really don't have to

i haven't tried the visual dotpup maker yet

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#7 Post by Lobster »

8)

Thanks - appreciate the time and effort you both took to create these answers.
Again I have simplified the files . . .

:oops:
I need some basic knowledge . . .

1. If I run file autozen.sh from the command line
like so

Code: Select all

./autozen.sh


it works (creates a directory with all the files in it)

However if I click on ./autozen.sh in ROX
nothing happens.
So I feel I know how to set permission and Set Run Action

but perhaps not?

I can not really go on to "make-pup" UNTIL the autozen.sh is working
and it has to work from ROX . . .

Hope you will not lose patience with me :)
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

Bruce B

#8 Post by Bruce B »

Lobster, my feeling is for your first dotpup, you should try and do it exactly according to GuestToo's dotpup template. (I think you have the template.)

If you have questions about the template they (your questions) will be easy to clarify.

Leave out the registering portion, because that is advanced techniques and not a part of the template.

Consider the first dotpup as practice, I'll test the dotpup when you get it ready.

Bruce B

#9 Post by Bruce B »

Lobster wrote:
:oops:
I need some basic knowledge . . .
Good reading on Linux concepts by Barry K

May I recommend a beginners bash tutorial?

.
Last edited by Bruce B on Fri 08 Jul 2005, 19:40, edited 1 time in total.

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#10 Post by GuestToo »

a script called abc.sh will behave differently from a script called abc

(i found this out the hard way)

for example, if you make a script called abc:

#!/bin/sh
xmessage -center "`pwd`"

right click it and make it executable, if you need to, and right click it and Copy to abc.sh

if you click either script it will popup a window showing your working directory

when you click abc ... it says your working dir is the dir that abc is in

when you click abc.sh ... it says that your working dir is /root, your $HOME dir

the reason it's doing this is that abc is an executable file ... a dot sh file is being run from a rox Run Action

a workaround would be the same technique that roxapps use ... put these lines at the top of the script:

APPDIR=`dirname "$0"`
cd "$APPDIR"
APPDIR="`pwd`"

this will cd to the dir abc.sh is actually in, and set APPDIR to the absolute path of the dir

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#11 Post by rarsa »

Actually for scripting I found this tutorial to be quite good.

It does not cover the scripting language 100% but it's a good start.

And I cannot resist but share that I was talking the other day to Steve Bourne! In person, waiting to to get some drinks at a conference we both attended.

I may even get smarter by osmossis.

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

Step back to step forward

#12 Post by Lobster »


May I recommend a beginners bash tutorial?

.
Thanks guys :)

That seems good

I decided to have a go at dot pup because it seems easy and straight forward.

:roll:

Somehow during this I have managed to make dotpups uninstallable . . .
Originally I had tried the visual dot pup maker from xanatos
but the scripts and templates seemed to be simpler (the visual dot pup maker is still under development I hope)

Things that seemed clear are beginning to seem complex . . .
Problems that an experienced basher would not blink at have caused me difficulties.
I am gonna digest some of this info. Take a step back and try again soon.

I appreciate everyones efforts thus far.

:-)
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#13 Post by Flash »

Thanks, rarsa and Lobster for those links. I've put them in the Beginners index, under Programming

Post Reply