Page 1 of 4

Gnewpet - makes pets from installed packages

Posted: Mon 23 Jan 2012, 08:34
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).

Posted: Sat 18 Feb 2012, 23:56
by jpeps
Updated to version 5.6

Posted: Sun 19 Feb 2012, 02:02
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?

Posted: Mon 20 Feb 2012, 02:57
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!

Posted: Mon 20 Feb 2012, 20:11
by jpeps
Updated to version 5.8. Enabled updating of Builtin apps.

Posted: Tue 21 Feb 2012, 01:49
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

Posted: Tue 21 Feb 2012, 02:52
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.

Posted: Tue 21 Feb 2012, 03:28
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

:)

Posted: Tue 21 Feb 2012, 03:29
by Jasper
Superb

Posted: Tue 21 Feb 2012, 03:48
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:

Posted: Wed 22 Feb 2012, 13:59
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:

Posted: Thu 23 Feb 2012, 04:27
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/'

Posted: Thu 23 Feb 2012, 18:44
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!

Posted: Fri 24 Feb 2012, 03:35
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

Posted: Fri 24 Feb 2012, 03:57
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?

Posted: Fri 24 Feb 2012, 04:02
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.

Posted: Fri 24 Feb 2012, 04:17
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.

Posted: Fri 24 Feb 2012, 04:33
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

Posted: Fri 24 Feb 2012, 04:42
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.

Posted: Fri 24 Feb 2012, 04:50
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.