Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 27 May 2017, 02:25
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
more efficient pet removal
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [5 Posts]  
Author Message
mavrothal


Joined: 24 Aug 2009
Posts: 2851

PostPosted: Tue 10 Jan 2017, 09:45    Post subject:  more efficient pet removal  

When PPM removes a pet that had overwritten original files of the puppy.sfs, copies the originals to the current savelayer. As a result the savefile gets filled up with duplicate files.
Presumably this is because whiteout files may have escaped removal and break the application/system.

The attached pet of removepreview.sh does not copy-up the originals after removal and instead removes the whiteouts more effectively.
Has been tested (briefly) in pupmodes 2, 5, 6, 7, 12 and 13 and works as expected. Additional testing is more than welcome.

It has NOT been tested with a multisession CD/DVD, so if anyone could try it there and report would be nice. Just install a newer version of an app already installed, remove it and check that the original (and everything else) still works as expected.

The attached pet has the following changes
Code:
--- a/usr/local/petget/removepreview.sh
+++ b/usr/local/petget/removepreview.sh
@@ -72,20 +72,16 @@
     else
      S=$(ls /initrd/pup_ro{?,??}"$ONESPEC" 2>/dev/null| grep -v '^/initrd/pup_ro1/'| head -n 1)
     fi # pup_ro2 - pup_ro99
+    rm -f "$ONESPEC"
+    # In PUPMODE 3|7|13 the file will remain till merging.
+    # Better remove now in case we do not shutdown properly.
+    rm -f "/initrd${SAVE_LAYER}${ONESPEC}" 2>/dev/null
+    # Now delete the whiteouts that will hide the original
     if [ "$S" ]; then
-     #the problem is, deleting the file on the top layer places a ".wh" whiteout file,
-     #that hides the original file. what we want is to remove the installed file, and
-     #restore the original pristine file...
-     cp -a --remove-destination "$S" "$ONESPEC" #120103 shinobar.
-     #120103 apparently for odd# PUPMODEs, save layer may have a lurking old file and/or whiteout...
-     if [ $PUPMODE -eq 3 -o $PUPMODE -eq 7 -o $PUPMODE -eq 13 ];then
-      [ -f "/initrd${SAVE_LAYER}${ONESPEC}" ] && rm -f "/initrd${SAVE_LAYER}${ONESPEC}" #normally /pup_ro1
-      BN="`basename "$ONESPEC"`"
-      DN="`dirname "$ONESPEC"`"
-      [ -f "/initrd${SAVE_LAYER}${DN}/.wh.${BN}" ] && rm -f "/initrd${SAVE_LAYER}${DN}/.wh.${BN}"
-     fi
-    else
-     rm -f "$ONESPEC"
+     BN="`basename "$ONESPEC"`"
+     DN="`dirname "$ONESPEC"`"
+     rm -f "/initrd/pup_rw/${DN}/.wh.${BN}" 2>/dev/null
+     rm -f "/initrd${SAVE_LAYER}${DN}/.wh.${BN}" 2>/dev/null
     fi
    fi
   done
@@ -96,6 +92,7 @@
  do
   if [ -d "$ONESPEC" ];then
    [ "`ls -1 "$ONESPEC"`" = "" ] && rmdir "$ONESPEC" 2>/dev/null #120107
+   rmdir "/initrd${SAVE_LAYER}${ONESPEC}" 2>/dev/null
   fi
  done
  ###+++2011-12-27 KRG
Should work with most puppies but if you have an older one (Precise, Slacko-5.x) you will also need libsturdust
removepreview_test-1.pet
Description 
pet

 Download 
Filename  removepreview_test-1.pet 
Filesize  5.79 KB 
Downloaded  35 Time(s) 

_________________
Kids all over the world go around with an XO laptop. They deserve one puppy (or many) too Very Happy
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 12509
Location: Arizona USA

PostPosted: Tue 10 Jan 2017, 11:18    Post subject:  

Argh, I'll test it if you'll tell me the latest version of Puppy that can still do multisession. I've been using Quirky Werewolf 64 for a while, but it only remasters. Barry doesn't like multisession for some reason.
Back to top
View user's profile Send private message 
mavrothal


Joined: 24 Aug 2009
Posts: 2851

PostPosted: Tue 10 Jan 2017, 13:00    Post subject:  

Flash wrote:
Argh, I'll test it if you'll tell me the latest version of Puppy that can still do multisession. I've been using Quirky Werewolf 64 for a while, but it only remasters. Barry doesn't like multisession for some reason.

Thank you.
My understanding is that both "official" puppies (Tahr-6.0.5 and Slacko-6.3.2) are OK with multisession CD/DVD. However any older puppy that you may have around should also work as long as you also install the aforementioned libstardust pet.

BTW, I believe that multisession is now fixed in the new puppy init and the next woof-CE puppy that comes out (LxPupSc?) should be OK again

_________________
Kids all over the world go around with an XO laptop. They deserve one puppy (or many) too Very Happy
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1325
Location: Brisbane, Australia

PostPosted: Wed 11 Jan 2017, 05:51    Post subject:  

mavrothal wrote:
BTW, I believe that multisession is now fixed in the new puppy init and the next woof-CE puppy that comes out (LxPupSc?) should be OK again
Unfortunately there was one more thing to fix, a 1 line change to the "copy_folders" whiteout file processing code in "init".
It's fixed in woof-ce 'rationalise' but I suspect that LxPupSc-17.01.22 just missed it.

gyro
Back to top
View user's profile Send private message 
mavrothal


Joined: 24 Aug 2009
Posts: 2851

PostPosted: Wed 11 Jan 2017, 06:38    Post subject:  

gyro wrote:

It's fixed in woof-ce 'rationalise' but I suspect that LxPupSc-17.01.22 just missed it.

It did.
Actually is from the Jan 6 git so more mode-77 changes are missing.
Next one then.

BTW rationalised was deemed stable enough and merged back into testing. So you might want to commit into testing instead.

_________________
Kids all over the world go around with an XO laptop. They deserve one puppy (or many) too Very Happy
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [5 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1079s ][ Queries: 14 (0.0182s) ][ GZIP on ]