How about.pet pre and post uninstall scripts?
How about.pet pre and post uninstall scripts?
A question for you PET experts
Is it possible to create a pre and post uninstall script for a .pet?
I know you can create a puninstall.sh to run post un-installation script but I want to run one pre uninstall and post uninstall
Thanks
Mark
Is it possible to create a pre and post uninstall script for a .pet?
I know you can create a puninstall.sh to run post un-installation script but I want to run one pre uninstall and post uninstall
Thanks
Mark
- Sit Heel Speak
- Posts: 2595
- Joined: Fri 31 Mar 2006, 03:22
- Location: downwind
But, of course, you can include in your .pet package a pre-uninstall script. You'll just have to instruct the user prominently somehow, upon installation, to run the pre-uninstall script first before uninstalling. And hope they remember to do so. Maybe if, when you create the .pet, you give it the description "RUN PRE-UNINSTALL-(name) BEFORE UNINSTALLING!!!" so they will see this warning when they go to click-it-to-uninstall in Puppy Package Manager. Or maybe put a pre-uninstall script icon on the desktop.
You could create an "installer" pet file, which contains other pet files and a pinstall script like this one:
Example: petinstaller.pet contains this pinstall script:
(the "~" means "/root")
And in your "petinstaller" pet file, you would the following files:
And pet files an indeed contain an uninstall script, simply add:
NOTE:
Doing an "installer" pet this way, is definitely NOT the recommended or accepted standard way, but it should work fine.
Example: petinstaller.pet contains this pinstall script:
Code: Select all
petget ~/petfile1.pet
petget ~/petfile2.pet
rm ~/petfile1.pet
rm ~/petfile2.pet
And in your "petinstaller" pet file, you would the following files:
Code: Select all
/petinstaller/root/petfile1.pet
/petinstaller/root/petfile2.pet
/petinstaller/pinstall.sh
Code: Select all
/petinstaller/puninstall.sh
Doing an "installer" pet this way, is definitely NOT the recommended or accepted standard way, but it should work fine.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
You are assuming that my original title was not comprehensible!Lobster wrote:Flash (moderator) has probably changed the title
to something more comprehensible to our forum members.
It is not done often and is meant kindly
All that was added was the "How about" which to me sounds a bit daft considering the nature of the question
/usr/local/petget/installpkg.sh
A dotpet is made at "/" :
mkdir /MYDOTPETNAME-VERSION
mkdir /MYDOTPETNAME-VERSION/etc
mkdir ALLDIRS
do not forget
mkdir /MYDOTPETNAME-VERSION/usr/local/lib/X11/mini-icons
mkdir /MYDOTPETNAME-VERSION/usr/share/applications
echo > /MYDOTPETNAME-VERSION/pinstall.sh
echo > /MYDOTPETNAME-VERSION/puninstall.sh
geany /MYDOTPETNAME-VERSION/pinstall,sh
geany /MYDOTPETNAME-VERSION/puninstall.sh
save the p[un]install.sh
and run dir2pet
Code: Select all
if [ -f /pinstall.sh ];then #pet pkgs.
chmod +x /pinstall.sh
cd /
sh /pinstall.sh
rm -f /pinstall.sh
fi
if [ -f /install/doinst.sh ];then #slackware pkgs.
chmod +x /install/doinst.sh
cd /
sh /install/doinst.sh
rm -rf /install
fi
#v424 .pet pkgs may have a post-uninstall script...
if [ -f /puninstall.sh ];then
mv -f /puninstall.sh /root/.packages/${DLPKG_NAME}.remove
fi
mkdir /MYDOTPETNAME-VERSION
mkdir /MYDOTPETNAME-VERSION/etc
mkdir ALLDIRS
do not forget
mkdir /MYDOTPETNAME-VERSION/usr/local/lib/X11/mini-icons
mkdir /MYDOTPETNAME-VERSION/usr/share/applications
echo > /MYDOTPETNAME-VERSION/pinstall.sh
echo > /MYDOTPETNAME-VERSION/puninstall.sh
geany /MYDOTPETNAME-VERSION/pinstall,sh
geany /MYDOTPETNAME-VERSION/puninstall.sh
save the p[un]install.sh
and run dir2pet
- Sit Heel Speak
- Posts: 2595
- Joined: Fri 31 Mar 2006, 03:22
- Location: downwind
I want to run one pre uninstall and post uninstall
I really think that is a suggestion for the installpkg.sh :puppy's package manager does not support pre-install or pre-remove scripts.
Code: Select all
if [ -f /ppreinstall.sh ];then #pet pkgs.
chmod +x /ppreinstall.sh
cd /
sh /ppreinstall.sh
rm -f /ppreinstall.sh
fi
Code: Select all
cd $DLPKG_PATH
case $DLPKG_BASE in
*.pet)
Code: Select all
if test -d /root/.PKG ; then mv /root/.PKG /root/.PKG-instNEWPKG.bak; fi
if test -f /usr/bin/PKGBIN ; then mv /usr/bin/PKGBIN /usr/bin/PKGBIN-instNEWWPKG.bak;fi
could have something like
Code: Select all
if [ -f /root/.packages/${DB_pkgname}.preremove ];then
/bin/sh /root/.packages/${DB_pkgname}.preremove
rm -f /root/.packages/${DB_pkgname}.preremove
Code: Select all
export REM_DIALOG="<window title=\"Puppy Package Manager\" icon-name=\"gtk-about\">
<vbox>
<pixmap><input file>/usr/local/lib/X11/pixmaps/question.xpm</input></pixmap>
<text><label>Click 'OK' button to confirm that you wish to uninstall package '$DB_pkgname'</label></text>
Code: Select all
if [ -f /ppreuninstall.sh ];then
mv -f /ppreuninstall.sh /root/.packages/${DLPKG_NAME}.preremove
fi
if [ -f /ppostuninstall.sh ];then
mv -f /ppostuninstall.sh /root/.packages/${DLPKG_NAME}.postremove
fi
actually the pinstall.sh and puninstall.sh are getting executed after the main part of the [un]installation and are practically postp[un]install.sh
An workaround for a pre-install.sh would be
which would install the PKG at "/"
and let the pinstall.sh `cp -r /MYPKGNAME/* /` and `rm -r /MYPKGNAME` at the very end of it .
Code: Select all
mkdir /MYPKGNAME
mkdir /MYPKGNAME/MYPKGNAME
mkdir /MYPKGNAME/MYPKGNAME/usr[etc root ...]
and let the pinstall.sh `cp -r /MYPKGNAME/* /` and `rm -r /MYPKGNAME` at the very end of it .
I must say , that I did not really understood the initial question either . I thought it would have been a typing mistake
But after reading the whole page several times i think that i even got sc0ttman's post :
Just create a preinstallscript that downloads the real package via wget or curl and installs it and a postinstallscript to remove everything .
And about a dot at the begining of the headline : I don't know if this forces this thread to be a hidden folder on the server .
But after reading the whole page several times i think that i even got sc0ttman's post :
Just create a preinstallscript that downloads the real package via wget or curl and installs it and a postinstallscript to remove everything .
And about a dot at the begining of the headline : I don't know if this forces this thread to be a hidden folder on the server .