Programmer's Challenge: a New gnewpet

A home for all kinds of Puppy related projects


Moderator: Forum moderators

Post Reply
User avatar
mikeslr
Posts: 3080
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 179 times
Been thanked: 991 times

Programmer's Challenge: a New gnewpet

Post by mikeslr »

A dozen years ago jpeps developed what I've found to be a very useful application: gnewpet, https://oldforum.puppylinux.com/viewtop ... fb#p598673. "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."

My primary use for it has been to obtain an application from one Puppy to use as the base for building that for another Puppy. Sometimes the application will run OOTB in the other Puppy. Other times, some modification may be required. Still a great deal of time is saved because in order to create the 'newpet' what gnewpet does is copy all the the original pet's dependencies. The necessary modification may consist of only adding additional libs needed by the other Puppy; or occasionally substituting newer versions of libs.

When jpeg created it, it worked flawlessly. But since then a couple of environmental changes have taken place. JRB noted an issue with woof-built packages which may or may not show-up/have been corrected, https://www.forum.puppylinux.com/viewto ... 5a5#p73225; jasper noted a problem with inbuilt applications, https://www.forum.puppylinux.com/viewto ... 5a5#p73222. I also noted that under F96 what might have been either a bash-incompatibility or that more recent Puppys now store records of packages and their depenedencies under var rather than a hidden folder in /root. https://www.forum.puppylinux.com/viewto ... 5a5#p73289,
It is totally useless under NoblePup64. A GUI appears, but is unresponsive. In an attempt to resolve the issue I rebuilt gnewpet-6.5 to include a symlink named .packages under /root to /var/packages. When that didn't work, I re-wrote lines 20 thru 24 in /usr/local/bin/gnewpet to read:

dir="$(cat /tmp/gnewpetDir)"
export path="${dir}/var/packages"
else
export path="/var/packages"
fi

rather than

dir="$(cat /tmp/gnewpetDir)"
export path="${dir}/./root/.packages"
else
export path="/root/.packages"
fi

Also unsuccessful. Scripting isn't my strong suite. Wondered if anyone else was interested in recovering this application?

-=-=-=-=-=-=-=-

FWIW, my understanding is that gnewpet's front-end is a GUI using gtkdialog [which I believe is available even under the newest Puppys: I know even less about gtkdialog than I do about bash] and its back-end bash-scripts. The bash scripts do the following:

(a) create [or use the existing] 'tmp' folder and within that create a folder to hold other files and folders;

(b) read the text files, formerly at /root/.packages, now at /var/packages. There are 2 or 3 variations. A text file named 'Woof-installed-packages' contains a line for each Woof-installed-packages. Each line on that list provides information such as the following:
clipit-1.4.2-x86_64|clipit|1.4.2-x86_64||Setup|2864K||clipit-1.4.2-x86_64.pet||Clipboard Manager|ubuntu|trusty||

Each builtin application --which may include both woof-installed and dev provided applications-- has a distinct text file in a folder named builtin_files. Each such text file includes information about the files used by that application such as, for clipit-1.4.2-x86_64:

/root/.config/autostart/clipit-startup.desktop
/usr/bin/clipit
/usr/share/applications/clipit.desktop
/usr/share/doc/nls/clipit/clipit.pot
/usr/share/icons/hicolor/scalable/apps/clipit-trayicon.svg

Each User installed application has its own text file in /var, but not in a sub-folder. Each such text file --with the suffix '.files'-- again, provides information about the application such as for Passord_Generator-2.0.8:

/root/
/root/my-applications/
/root/my-applications/bin/
/root/my-applications/bin/pwgen
/usr/
/usr/bin/
/usr/bin/pwgen
/usr/share/
/usr/share/applications/
/usr/share/applications/Password-Generate.desktop
/usr/share/pixmaps/
/usr/share/pixmaps/pwgen.png

AFAIK, what gnewpet's scripts do is
(a) generate lists of builtin and user-installed applications. These lists are used by the GUI to enable the User to select which application to duplicate.

(b) read each line or lines in either /var/builtin_files/NAME-OF-APPLICATION or /var/NAME-OF-APPLICATION selected by the User via the GUI;

(c) name/rename the application folder within tmp;

(d) create in /tmp/NAME-OF-APPLICATION any necessary folders and sub-folders appearing on the list of the User's selected application;

(e) copy each file identified as pertaining to the application from its specified location within the operating system to its corresponding location in the /tmp/NAME-OF-APPLICATION folder.

(f) Then, finally, dir2pet the /tmp/NAME-OF-APPLICATION folder; thus, creating the pet in /tmp.

Post Reply

Return to “Puppy Projects”