Gnewpet - makes pets from installed packages

Miscellaneous tools
Message
Author
jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

Gnewpet - makes pets from installed packages

#1 Post by jpeps »

Finds current files for an installed Pet, and makes a new version in /tmp. Leave "new version" box blank for straight duplication, or edit to update name. Batch mode builds multiple pets.

2/17/12 Version 5.6 Includes both User installed and Builtin apps.
2/20/12 Version 5.8 Enables updates and name change to Builtin apps.
2/20/12 Version 5.9 Spruced up graphics. Thanks Geoffrey
2/23/12 Version 6.0 Opens wrapper that allows alternative /root directory
2/23/12 Version 6.1 bug fix
2/29/12 Version 6.2 bug fix
3/2/12 Version 6.3.1 bug fix

3/3/12 Version 6.4 Added feature to find the related woof package for a selected builtin. It lets you know if multiple packages are involved, otherwise automatically adds the correct name and pet.spec to the built package.
3/3/12 Version 6.5 Added ability to use woof package names & specs in batch mode (there's a checkbox in batch window).
Attachments
gnewpet.png
(19.83 KiB) Downloaded 4847 times
gnewpet-6.5.pet
(8.57 KiB) Downloaded 3527 times
Last edited by jpeps on Sun 04 Mar 2012, 08:02, edited 11 times in total.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#2 Post by jpeps »

Updated to version 5.6

User avatar
kooliepup
Posts: 292
Joined: Sat 14 Jan 2012, 03:40
Location: Victoria, Australia

#3 Post by kooliepup »

That is just soo cool.

It is the quickest and easiest way to build a .pet from installed,
and easier than converting .debs to .pets and finding they don't work.
I prefer to save stuff for other future installations as .pets, not .debs, but need to know that they work.

The ability to do it from built-ins is the icing on the cake.
I have wanted something to do that in the past.

Was life meant to be this easy?
There's no place like 127.0.0.1

User avatar
TheAsterisk!
Posts: 406
Joined: Tue 10 Feb 2009, 08:52

#4 Post by TheAsterisk! »

This could be useful in updating built-in apps via dot-pet, but making sure not to overwrite any "extra" files in the system.

I'll give it a try. Thanks!

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#5 Post by jpeps »

Updated to version 5.8. Enabled updating of Builtin apps.

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#6 Post by Geoffrey »

This is a great application, no more "I wish I'd kept that pet" good stuff. 8)

I thought that the GUI could do with a slight edit to give it a more even look

This will align the check boxes vertically

Code: Select all

<hbox>
 <vbox>
       <checkbox tooltip-text="Check to use Builtin List">
       <label>"Builtin Apps"</label>
       <variable>BUILTINS</variable>
       </checkbox>
   
       <checkbox tooltip-text="save pet dir in /tmp">
       <label>"Save Directory"</label>
       <variable>SAVEDIR</variable>
       </checkbox>
  
       <checkbox tooltip-text="batch-copy edited list">
       <label>"Batch Mode      "</label>
       <variable>BATCH</variable>
       </checkbox>
   </vbox>
   </hbox>       
or a horizontal alignment which will give a smaller GUI

Code: Select all

<hbox>
 <vbox>
       <checkbox tooltip-text="Check to use Builtin List">
       <label>"Builtin Apps"</label>
       <variable>BUILTINS</variable>
       </checkbox>
  </vbox>
   <vbox> 
       <checkbox tooltip-text="save pet dir in /tmp">
       <label>"Save Directory"</label>
       <variable>SAVEDIR</variable>
       </checkbox>
  </vbox>
   <vbox>
       <checkbox tooltip-text="batch-copy edited list">
       <label>"Batch Mode      "</label>
       <variable>BATCH</variable>
       </checkbox>
  </vbox>
   </hbox>      


If you want to give your GUI a application icon in the top left hand corner and on the taskbar, just change it here

Code: Select all

export MAIN_DIALOG='
<window title="Gnewpet" icon-name="Color"  decorate="true">
to this

Code: Select all

export MAIN_DIALOG='
<window title="Gnewpet" icon-name="mini-dog"  decorate="true">
then make a system link from /usr/local/lib/X11/mini-icons/mini-dog.xpm TO /usr/share/icons/hicolor/16x16/apps
if you add the link to the pet package petget will update the icon cache and it will show for your application.
as the images show below, hope you don't mind me sticking my nose in :D

Geoffrey
Attachments
Screenshot-2.png
(36.5 KiB) Downloaded 4814 times

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#7 Post by jpeps »

Hi Geoffrey,

Looks GOOD! I already did the windows icon link on my system, but didn't bother to configure it in the package. I like the centered checklist idea. The buttons could also centered, maybe with "space-expand" attr. I love your windows fonts graphics.
Attachments
gnewpet.png
(16.65 KiB) Downloaded 4826 times

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

#8 Post by Lobster »

Was life meant to be this easy?
Puppy life was :)

Must admit I don't usually create pets if I write something - maybe this will change that. Many thanks.

will add link here
http://puppylinux.org/wikka/petmaker

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

Jasper

#9 Post by Jasper »

Superb

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#10 Post by Geoffrey »

jpeps wrote:Hi Geoffrey,

Looks GOOD! I already did the windows icon link on my system, but didn't bother to configure it in the package. I like the centered checklist idea. The buttons could also centered, maybe with "space-expand" attr. I love your windows fonts graphics.
Hi jpeps,

Cool, you have done the icon links, I was wondering what "Color" was, now I see.

Yeah, I see what you mean with the buttons, gtkdialog GUI can be a pain to keep aligned with some themes, the font is Cherry Cream Soda in Saluki, which I quite like also.

I'm sure we will see more interest in this, I will definitely be keeping an eye on it, I will add it to my box of magic tricks. :wink:

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

#11 Post by RSH »

Hi.

Last version of gnewpet i did see has been 5.1.
RSH wrote:I think than you would have one of the most useful and ultimate tool - not only to "cannibalize" the work of others but also to get pets, that somehow get lost, out of iso files.
It seems i have been wrong about this.

I think it is now the ultimate ultimate tool! BUT even a ultimate ultimate tool can be refined...

I will add this (5.9) to the LazY Puppy Update.

Great work.

What do you think about to modify gnewpet in the following way. Make the directory NOT statically (.packages). I think it would be better if it would be possible to select a path. Then you could mount an iso and then mount the xxx.sfs inside the iso and then grab the installed .pet files out without the need to run the iso (puppy) and install gnewpet into that puppy.

All could be done while running your favorite puppy. :)

RSH

(it would add a third ultimate to your ultimate ultimate tool) :lol:
[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]

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#12 Post by jpeps »

RSH wrote:
What do you think about to modify gnewpet in the following way. Make the directory NOT statically (.packages). I think it would be better if it would be possible to select a path. Then you could mount an iso and then mount the xxx.sfs inside the iso and then grab the installed .pet files out without the need to run the iso (puppy) and install gnewpet into that puppy.

All could be done while running your favorite puppy. :)
You could change /root to ./root, and run it in a specific location.
Run for both gnewpet and newpet:

sed -i 's/\/root/\.\/root/'

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#13 Post by jpeps »

OK.. Boots to wrapper which allows selection of alternative mounted directories. If ./root doesn't exist in selected directory, it defaults to /root

RSH: I could see where this could be useful. Nice idea!
Attachments
gnewpet.png
(11.39 KiB) Downloaded 4696 times

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

#14 Post by RSH »

jpeps wrote:OK.. Boots to wrapper which allows selection of alternative mounted directories. If ./root doesn't exist in selected directory, it defaults to /root

RSH: I could see where this could be useful. Nice idea!
Thanks, but unfortunately i do always get message invalid directory.

I did check the button Set relative root directory.

I did try it using mounting iso and then mounting sfs (inside iso) with and without "/" at end of path.

Examples:

/mnt/+mnt+sdb2+LinuxImages+ceepup3+CeePup3-bld11.iso/cpup_330.sfs/root/

/mnt/+mnt+sdb2+LinuxImages+ceepup3+CeePup3-bld11.iso/cpup_330.sfs/root

I did try extracting sfs to sdc3/test with and without "/" at end of path

Examples:

/mnt/sdc3/test/root/

/mnt/sdc3/test/root

No success at all. :( - invalid directory
[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
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#15 Post by RSH »

Hi,

i have examined the code of the gnewpet-wrapper.

Code: Select all

rootdir() {
if [ "$RELATIVE" == "true" ]; then 
   var="${ent3}/root"
      if [ ! -d "$var" ]; then
           Xdialog --msgbox "Invalid Directory" 5 25
      else
            echo "$ent3" >/tmp/gnewpetDir
      fi
else
  [ -f /tmp/gnewpetDir ] && rm /tmp/gnewpetDir
fi
}
You did define /root, so there will be no /root/root directory, so it is invalid.

Did try /mnt/+mnt+sdb2+LinuxImages+ceepup3+CeePup3-bld11.iso/cpup_330.sfs and get the list of installed apps inside the mounted iso-sfs. 8)

But i do only get back the "var" directory of the installed app inside the re-created .pet. :(

I think the relative directory has to be added to the paths inside the example-app.files file somewhere inside the backend of gnewpet. :)

Maybe just write (echo) this path into a file via wrapper and then read out via backend. If the file doesn't exist or doesn't contain a path, it adds "" to the paths inside example-app.files.

Could it be that easy?
[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]

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#16 Post by jpeps »

RSH,

Copy your mounted SFS to a new directory. Open the new directory, which contains root, and launch. The "invalid directory" notice means that you're opening a directory that doesn't contain the desired root directory.

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

#17 Post by RSH »

Solved!

As i did wrote, adding the path to the paths inside example-app.files.

If you want to build new getpet ultimate ultimate ultimate version, please use this script.

Edit: gnewpet is now version 6.2 and therefor fixed. Script removed.
Last edited by RSH on Thu 01 Mar 2012, 03:48, edited 2 times 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]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#18 Post by technosaurus »

This was the code that I submitted a while back for _re_moving existing packages. Could be modified for the same purpose by replacing rm with mv
(and you probably won't need the reverse dependency check)

Code: Select all

#!/bin/sh
D=$HOME/.packages/builtin_files
PKGS=`ls -1 $D`
PKG=`Xdialog --stdout --combobox "select package to remove" 0 0 $PKGS`
[ $PKG ] && Xdialog --yesno "Reverse dependencies:
`cat $HOME/.packages/woof-installed-packages |grep +$PKG |cut -d "|" -f2`

Continue?" 0 0 && [ $? ] && for x in `cat $D/$PKG`; do [ -d $x ] && cd $x || rm $x; done && rm $D/$PKG && $0
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#19 Post by jpeps »

RSH wrote:If you want to build new getpet ultimate ultimate ultimate version, please use this script.
The only thing I see different, is that you added an instance of $dir$line in place of $line. If you open to the correct directory, that shouldn't be an issue.

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

#20 Post by RSH »

jpeps wrote:The only thing I see different, is that you added an instance of $dir$line in place of $line.
Yes, exactly.

Tough the difference is enormous, because only that way you can mount every iso you want, then mount the sfs inside the mounted iso and get every installed or build in application you want to. :D

No need to run the puppy where you want to get out the application/s.

No need to extract the mounted sfs.

Only adding "$dir" does give success, try it out - i did it several times.
[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