PPM2

Using applications, configuring, problems
Message
Author
stemsee

#181 Post by stemsee »

Hi Mavrothal
I hope to get your advice.
I am using this simple code

Code: Select all

#!/bin/sh
if [ ! -z "$2" ]; then
nm="$2"
else
. /tmp/name
fi
while read line
do
lined=`echo $line | rev | cut -f2,3,4,5,6,7,8,9,10,11,12,13,14 -d '/' | rev`
mkdir -p $HOME/"$nm"/"$lined"
cp -f $line $HOME/"$nm"/"$lined"/
done < "$1"
rox $HOME/"$nm" &
to create an apptree of any installed app. Which I can then right click and create a pet package. I simply open term and type

Code: Select all

apptree $HOME/packages/builtin/hiawatha.files hiawatha-1.5
for example and seems to work fine. Is there anything else obvious that may be missing?

Together with slocategui i can build a similar apptree but with only those elements dirs/files which share the search term. Which seems to be ok for transferring principle parts of apps.

Thanks
stemsee
Last edited by stemsee on Fri 08 May 2015, 12:33, edited 1 time in total.

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#182 Post by mavrothal »

stemsee wrote:I am using this simple code
I do not know how this relates to PPM(...) but it looks OK. However, modifications done by install scripts will be missed.
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

stemsee

#183 Post by stemsee »

Isn't ppm responsible for ~/.packages/* and ~/.package/builtin/*

Ah yeah! pinstall files, well spotted. Maybe ppm should back up pinstall files during install into an lz4 compressed archive for later use! That would be awesomeness personified! ;-)

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#184 Post by mavrothal »

stemsee wrote:Maybe ppm should back up pinstall files during install into an lz4 compressed archive for later use!
Install scripts are run during woof building by 3builddistro. :wink:
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

Re: A last check

#185 Post by mavrothal »

gjuhasz wrote:In most cases - feel free to kill me if I am wrong :) - the users try out the interesting pets they find in the forum.
So here is a patch for these adventurous puppians

Code: Select all

--- a/usr/local/petget/removepreview.sh	2015-04-16 08:32:03.626402670 +0300
+++ b/usr/local/petget/removepreview.sh	2015-05-09 09:01:47.643136701 +0300
@@ -85,7 +85,23 @@
       [ -f "/initrd${SAVE_LAYER}${DN}/.wh.${BN}" ] && rm -f "/initrd${SAVE_LAYER}${DN}/.wh.${BN}"
      fi
     else
-     rm -f "$ONESPEC"
+     cd /root/.packages
+     grep "${ONESPEC}" *.files | grep -v  "${DB_pkgname}" | cut -f 1 -d ':' | sed s'/\.files//' \
+     > /tmp/pets_with_common_files
+     cd -
+     for LINE in $(cat /tmp/pets_with_common_files)
+     do
+      [ "$(grep $LINE /tmp/pkgs_to_remove)" != "" ] && \
+       sed -i "/$LINE/d" /tmp/pets_with_common_files
+     done
+     OTHERPKG=$(cat /tmp/pets_with_common_files)
+     if [ "$OTHERPKG" ];then
+      OTHERPET=$(echo ${OTHERPKG} | tr ' ' ',')
+      . /usr/lib/gtkdialog/box_yesno "$(gettext 'Puppy Package Manager')" "$(gettext 'It appears that the') <b>${ONESPEC}</b> $(gettext 'file installed by the ') <b>${DB_pkgname}</b> $(gettext 'package you are removing,') <b> $(gettext 'was also installed by the') ${OTHERPET} $(gettext 'package(s)! ')</b> $(gettext 'This is likely because of some careless package generation but removing the file may break the other package(s). Do you want to remove it anyway?')"
+      [ "$EXIT" = "yes" ] && rm -f "$ONESPEC"
+     else
+      rm -f "$ONESPEC"
+     fi 
     fi
    fi
   done
Will generate a warning as shown.
However, I do not intend to put it in woof since grep'ing and sed'ing through all your installed files can slow down the remove process significantly as install packages increase.
Attachments
warning.png
(19.05 KiB) Downloaded 584 times
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

google ping

#186 Post by peebee »

ppm2's pinging of google is under discussion on the LxPup thread:

http://www.murga-linux.com/puppy/viewto ... 552#844552

Maybe there is a case to make the ping destination configurable for those people who view google with suspicion?

or maybe use 8.8.8.8
http://etherealmind.com/what-is-the-bes ... onnection/

peebee
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

Re: google ping

#187 Post by mavrothal »

peebee wrote:Maybe there is a case to make the ping destination configurable for those people who view google with suspicion?
Making it configurable it would appear an unnecessary hassle for the rest of us.
BTW service_pack.sh was not changed in PPM2. Is the original.
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

Re: google ping

#188 Post by mavrothal »

mavrothal wrote:Making it configurable it would appear an unnecessary hassle for the rest of us.
Here is a solution that involves some hassle only from my side. :roll:
PPM will check connectivity by ping'ing google only if puppy is allowed to check external IP through icanhazip.com (configurable in ipinfo).
I'm assuming if someone freaks out about ping'ing google will be also be freaking out about wget'ing icanhazip.com.
So here is the patch:

Code: Select all

--- a/usr/local/petget/service_pack.sh	2015-04-16 08:32:03.626402670 +0300
+++ b/usr/local/petget/service_pack.sh	2015-05-10 06:42:52.313401095 +0300
@@ -8,18 +8,24 @@
 #121206 faster internet check. remove window centralise.
 #121217 DISTRO_VERSION getting reset by 'init' in initrd, need workaround.
 
-IFCONFIG="`ifconfig | grep '^[pwe]' | grep -v 'wmaster'`"
-[ ! "$IFCONFIG" ] && exit 1 #no network connection.
-ping -4 -c 1 www.google.com
-if [ $? -ne 0 ];then
- sleep 1
- ping -4 -c 1 www.google.com
- [ $? -ne 0 ] && exit 1 #no internet.
-fi
-
 export TEXTDOMAIN=petget___service_pack.sh
 export OUTPUT_CHARSET=UTF-8
 
+[ -f $HOME/.ipinfo ] && . $HOME/.ipinfo || CB0=true
+if [ "$CB0" = "true" ];then
+ IFCONFIG="`ifconfig | grep '^[pwe]' | grep -v 'wmaster'`"
+ [ ! "$IFCONFIG" ] && exit 1 #no network connection.
+ ping -4 -c 1 www.google.com
+ if [ $? -ne 0 ];then
+  sleep 1
+  ping -4 -c 1 www.google.com
+  [ $? -ne 0 ] && exit 1 #no internet.
+ fi
+else
+ /usr/lib/gtkdialog/box_splash -timeout 5 -placement top -bg yellow -text \
+  "$(gettext 'Internet connectivity check, is skipped')" &
+fi
+
 . /etc/DISTRO_SPECS #has DISTRO_DB_SUBNAME
 . /root/.packages/DISTRO_PET_REPOS #has PET_REPOS, PKG_DOCS_PET_REPOS
 
Assuming there is some positive testing and feedback I'll commit it to woof-CE
Last edited by mavrothal on Sun 10 May 2015, 04:35, edited 1 time in total.
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
James C
Posts: 6618
Joined: Thu 26 Mar 2009, 05:12
Location: Kentucky

#189 Post by James C »

For those seriously concerned users all internet connectivity could be removed,

Nothing to worry about from the evil world wide web then.

stemsee

#190 Post by stemsee »

Hunk # Failed at 8. Tahr pup 6.0.1 .
Attachments
capture20926.jpg
(44.13 KiB) Downloaded 487 times

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#191 Post by mavrothal »

stemsee wrote:Hunk # Failed at 8. Tahr pup 6.0.1 .
The patch is against woof-CE but should be OK in 6.0.1
Most likely you missed the last blank line in the copy/paste (should be 3 lines at either end of the changed lines).
Anyway, attached is the patch gzipped.

BTW, posting the reject file would be more informative than providing "poof" that indeed it failed :wink:
Attachments
service_pack.sh.patch.gz
(679 Bytes) Downloaded 242 times
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

stemsee

#192 Post by stemsee »

That patch worked.
Attachments
capture20889.jpg
(10.88 KiB) Downloaded 414 times
capture27814.jpg
(34.85 KiB) Downloaded 426 times
capture27237.jpg
(9.06 KiB) Downloaded 433 times

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

#193 Post by peebee »

mavrothal wrote:Anyway, attached is the patch gzipped.
Hi mav

As I reported this as a concern to some people although I don't "own" the concern personally.....

My apologies for jumping to the wrong conclusion that the concern had been introduced by ppm2 and thanks to you for providing a patch anyway.....

BTW - testing patches is a bit difficult because "patch" only comes in the devx and not everybody downloads or runs all the time with devx installed....

Anyway - I got patch from pkgs.org and applied your patch to LxPup15.03 and all seems fine.

Cheers & thanks
peebee
Attachments
Screenshot.png
(24.35 KiB) Downloaded 365 times
Screenshot2.png
(18.45 KiB) Downloaded 358 times
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

stemsee

#194 Post by stemsee »

To whom it may concern.

Request for archiving of pinstall and punstall scripts from .pet and .deb ( .distro-base-ext), by ppm during install, to $HOME/.packages/pinpun/app-name.lz4

regards
stemsee

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#195 Post by mavrothal »

stemsee wrote:Request for archiving of pinstall and punstall scripts from .pet and .deb ( .distro-base-ext), by ppm during install, to $HOME/.packages/pinpun/app-name.lz4
Any good reason for it?
Regardless, I'm sure you can do it (and provide some patches here for other that may be interested).
The installpkg,sh script has a line that "rm -f /pinstall.sh" which you can change to "mv" to a desired location. It also has "mv -f /puninstall.sh /root/.packages/${DLPKG_NAME}.remove" which you can then "cp" to another location as needed.
Finally, removepreview.sh does "rm -f /root/.packages/${DB_pkgname}.remove". Just remember to rm also your .lz4 versions.
These should suffice :wink:
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

stemsee

#196 Post by stemsee »

Thanks @Mavrothal

The space those scripts will use when archived will be negligible, yet will give the option to recreate the exact original .pet with apptree, or some other as yet unwritten master-piece, with little overhead. For example Vivid-beta2 has vlc-2.2-rc2 installled. This cannot be installed from the internet via ppm. If I want to share this app with my other installations I must either locate source and build or use apptree to re-create the .pet . Well I like short-cuts, so I wrote apptree. Another exmple is if I have modified one or two scripts which are part of an installation, such as PeasyBT, or simple-remaster, I can create an upgrade package easily and automatically, providing the customised scripts retain their installed name and location, without having to remember to save the edited scripts in the system for testing and in the app dir-tree ready for packaging, and maybe some other location on the pc such as your personal scripts dir. (Does geany have the ability to save edited document in several different places automatically?)

You pointed out that my script 'apptree' cannot get the benefit of pinstall instructions. Well now it will be able to.

thanks
stemsee

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#197 Post by greengeek »

stemsee wrote: such as PeasyBT,
What is PeasyBT please? I can't find a reference to it. A bluetooth app maybe?

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#198 Post by mavrothal »

stemsee wrote:yet will give the option to recreate the exact original .pet
If an original pet, deb, tgz, exists somewhere why not use it again? :?
stemsee wrote:if I have modified one or two scripts which are part of an installation, such as PeasyBT, or simple-remaster, I can create an upgrade package easily and automatically, providing the customised scripts retain their installed name and location, without having to remember to save the edited scripts in the system for testing and in the app dir-tree ready for packaging, and maybe some other location on the pc such as your personal scripts dir.
You can do as you see fit, but I would think that providing different things under the same name may be handy/easy at the time but can only cause troubles down the road. :wink:
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

stemsee

#199 Post by stemsee »

An original exists somewhere but does not mean it is quickly accessible.

In Puppy Land / Linux no matter what you do, there will be troubles down the road, but I call them changes.

@greengeek

pm rcrsn51 for PeasyBT app.
(point in hand)

gcmartin

#200 Post by gcmartin »

Wasn't sure if this idea related to PPM processing, so I opened a separate thread. ... found here..

That post is posted as some developers of PETs may know of ability for PET user interaction for some packages. Browsers are an example as some PUP members takes steps to manage cache, locations, etc. JAVA needs may be another example.

Post Reply