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 19 Apr 2014, 03:00
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
SFS-TCZ_Linker-2.2.pet
Post new topic   Reply to topic View previous topic :: View next topic
Page 4 of 10 [136 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Next
Author Message
WarMocK


Joined: 05 Jul 2007
Posts: 169

PostPosted: Tue 23 Mar 2010, 18:40    Post subject:  

You're welcome, man. Wink
This means that now I can fully implement your script into K-9 Linux and embed my SFS management framework into the ISO.
Oh, and I just realized there's still one little issue with the unlinking process: if there's a petget running while you try to unlink a module, it might occur that the unlinker takes a snapshot of the required libs BEFORE petget managed to add the installing dotpet's *.files to the package directory. Needless to say, that would be pretty bad if this dotpet would contain files that overwrite some of the symlinks.
A simple solution would be an Xdialog window telling the user that they need to make sure there are no other installations running while the SFS is unlinked. Add a yes-no option to the mix ("yes" starts unlinking, "no" cancels the process), and the prob would be solved as well. Of course, you could also use ps to check the system for running installation processes and either pause your own script or tell linux to pause the petgets and block any new instances of petget right away.
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4134

PostPosted: Thu 25 Mar 2010, 16:58    Post subject:  

jrb wrote:
technosaurus,
This is the code that I used to create the symlinks from /mnt/SFSpackage to /
Code:
cp -rs /mnt/"$SFSNAME"/* /
It doesn't overwrite other existing files or symlinks.


Wouldn't that generate an error message for files that exist that you could capture?
Something like
Code:
cp -rs /mnt/"$SFSNAME"/* 2>>/tmp/DONOTUNLINK


then add a grep of /tmp/DONOTUNLINK in the unlink script (you may also need to use cut or something to remove the rest of the error message)

If the other way works though - that's great, just that sometimes find can be really slow

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
WarMocK


Joined: 05 Jul 2007
Posts: 169

PostPosted: Sat 27 Mar 2010, 11:28    Post subject:  

Damn, I knew there was something fishy about the whole thing with the modification.
@jrb: I think that diff is not the best way to check out what files are already there. I made a new attempt using "sort" and "uniq", which removes duplicate lines from the filedump before comparing it to a second dump with the sfs list included. These two dumps are then compared with sort AND uniq, sending only the unique files of the SFS to the standard output. Several checks with my .packages folder were successful, and it worked DAMN fast!Very Happy

The code is:
Code:
cat $HOME/.packages/*.files | sort -u > /tmp/dump0
mv $HOME/.packages/$SFSFILE $HOME
cat $HOME/.packages/*.files | sort -u > /tmp/dump1
sort /tmp/dump0 /tmp/dump1 | uniq -u > /tmp/difference
mv $HOME/$SFSFILE $HOME/.packages


Add this one to both the linker AND the unlinker, and use the generated difference list for adding symlinks or removing them (after you verified that it is a symlink at all). Please keep in mind that this check only works with the FULL list of the SFS content, otherwise you might accidently skip files that were added or removed after the sfs file was linked.
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4134

PostPosted: Sun 28 Mar 2010, 00:56    Post subject:  

@Warmock - sort |uniq is a nice useful combo especially with the latest busybox (use #! /bin/ash vs. #! /bin/sh)

this should give you the duplicates list in case you want an option for user override
Code:
mv $HOME/.packages/$SFSFILE $HOME/$SFSFILE
cat $HOME/.packages/*.files | sort -u > /tmp/dump0
mv $HOME/$SFSFILE $HOME/.packages/$SFSFILE
cat $HOME/.packages/$SFSFILE /tmp/dump0 |sort |uniq -d > /tmp/duplicates #don't unlink automatically
#next line is optional depending on how you implement unlinking
cat $HOME/.packages/$SFSFILE /tmp/duplicates |sort |uniq -u > /tmp/difference #safe to unlink

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 878

PostPosted: Sun 28 Mar 2010, 11:48    Post subject:  

I have alot of files that are not registered and probably others do as well.

This method of technosaurus's -

Code:
cp -rs /mnt/"$SFSNAME"/* / 2>>DONOTUNLINK


would protect against removing files that should be kept and are not registered.

Another approach afterwards, might be something like this -

Copy SFSPACKAGE file to /tmp/SAFE-TO-UNLINK and then:

Code:
for NAME in $(cat DONOTUNLINK)
do
  sed -ie "\|^$NAME\$|d" /tmp/SAFE-TO-UNLINK
done


This would match the linking errors (those files that couldn't be linked because they already existed) to the presumed installed SFSPACKAGE list and output a SAFE-TO-UNLINK list.

(Might even be faster - not sure, though.... Very Happy Very Happy )

s
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 1017
Location: Smithers, BC, Canada

PostPosted: Sun 04 Apr 2010, 01:18    Post subject:  

OK guys,
Here it is. I used Technosaurus idea to generate an error list of files that already exist and then added that to the list of files contained in the sfs. Then I used WarMocks idea to sort and uniq the file list resulting in a list of files unique to the sfs and not already existing in the files system. This becomes the list of files that will be uninstalled. Seems to work very well.

I also took the precaution of putting in an abort if someone tries to install the same .sfs twice, without uninstalling. Not a problem before but now it would have resulted in an empty file list and no removals.

I used .pets and sfs's which contained some but not all of the same files. The only way I see to get in trouble is to install a .pet after installing a .sfs. I'm sure somebody will but what can you do?

Here's the new sfs_linker. Extract it, set it executable and place it in /usr/local/bin. If it works okay I"ll repackage the .pet and post it.

Bye for now, J
sfs_linker-1.4.gz
Description  For testing - extract, set executable and place in /usr/local/bin
gz

 Download 
Filename  sfs_linker-1.4.gz 
Filesize  1.93 KB 
Downloaded  286 Time(s) 
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 1017
Location: Smithers, BC, Canada

PostPosted: Tue 06 Apr 2010, 11:28    Post subject: SFS-TCZ_Linker-1.4  

I have just uploaded SFS-TCZ_Linker-1.4.pet and sfs_linker_default_apps431-0.1.pet

SFS-TCZ_Linker-1.4 has some new safeguards against removing common files that were installed before the SFS that you are removing. I have also modified it to be Upup compatible.

Rather than have two versions of SFS-TCZ_Linker, one with modified /usr/local/bin/defaults and one without, I have made those into a seperate .pet for Puppy431. If you like them use this .pet. If there is a demand I will make .pets for other pups as well.

Enjoy, J

http://puppylinux.ca/members/choicepup/ChoicePup431/pets/SFS-TCZ_Linker-1.4.pet-md5.txt
http://puppylinux.ca/members/choicepup/ChoicePup431/pets/sfs_linker_default_apps431-0.1.pet-md5.txt
Back to top
View user's profile Send private message 
WarMocK


Joined: 05 Jul 2007
Posts: 169

PostPosted: Tue 06 Apr 2010, 15:12    Post subject:  

Hey jrb,
a dotpet installed after the sfs was linked shouldn't pose a problem if you both compare the original filelist of the sfs to the list of installed files (which also should have the *.files of the installed dotpet in it) and make sure the file you're about to delete is a dead symlink. All you need to do is to make sure there are no alterations to the filelist after you took a snapshpt of the .packages directory and sorted out the files that were not listed in the other *.files
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 1017
Location: Smithers, BC, Canada

PostPosted: Thu 08 Apr 2010, 22:14    Post subject:  

WarMock wrote:
a dotpet installed after the sfs was linked shouldn't pose a problem
I think I have workable solution. I"ve built a little script for sfs_unlinker:
Code:
   #jrb - compare SFS filelist with other installed filelists. 
   #Duplicates should not be uninstalled
   mv /root/.packages/$SFSNAME.files /tmp/$SFSNAME.files
   cat /root/.packages/*.files > /tmp/installedpackages.files
   cat /tmp/$SFSNAME.files >> /tmp/installedpackages.files
   sort /tmp/installedpackages.files | uniq -d >> /tmp/$SFSNAME.files
   #jrb - send twice to make them duplicates
   sort /tmp/installedpackages.files | uniq -d >> /tmp/$SFSNAME.files 
   sort /tmp/$SFSNAME.files | uniq -u > /root/.packages/$SFSNAME.files

As you can see it moves the SFSNAME.files to /tmp from /root/.packages then creates a new list of all the other installed files and then compares the SFSNAME.files to that, creating a new /root/.packages/SFSNAME.files with only files unique to the SFS listed.

Haven't much time to test right now but will work on it this weekend.

Thanks for the inspiration, J
Back to top
View user's profile Send private message 
OldYogi

Joined: 12 Jan 2008
Posts: 27

PostPosted: Tue 13 Apr 2010, 20:06    Post subject:  

Jrb,

this looks excellent. I have two dumb questions:
first -- I'm running the alpha version of Puppy 4.4 (i.e. Pupply 4.31-2) which has SFS Linker installed. Somehow I deleted the sfs_mnt_home folder in ~/my_links on the desktop. How do I restore it?

second: will this handle tcz files without modification? There is a link in the menu to the Tiny Core repository, but it isn't clear whether those are sfs3 or sfs4. I know they can be converted -- but will that happen automatically?

thanks.
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 1017
Location: Smithers, BC, Canada

PostPosted: Tue 13 Apr 2010, 21:37    Post subject:  

OldYogi wrote:
Somehow I deleted the sfs_mnt_home folder in ~/my_links on the desktop. How do I restore it?

I'm a little puzzled. If the SFS_TCZ_LInker script in Puppy4.4 is the same as mine it should make a new /root/my_links/sfs_mnt_home folder automatically after rebooting.

Have you tried opening that folder and making one manually? Rt-click in the folder, choose "New" - "Directory" and name it "sfs_mnt_home". Try that and let me know if it disappears.
Quote:
will this handle tcz files without modification?

Yes. The .tcz files listed in that website are all SFS4's. Older tinycore .tcz's are SFS3's but they are in a different directory at ibiblio.

Keep me posted, J
Back to top
View user's profile Send private message 
reckrhodes

Joined: 30 May 2007
Posts: 116

PostPosted: Tue 13 Apr 2010, 22:26    Post subject:  

Hello jrb!

This linker to sfs is a very useful one. Thank you so much for this. The improvements are so good. Hope that this contribution of yours will be included in all official or community pupplets.

I tried using the lucid puppy and it works so fine. Just converting the pet to tar.gz(pet2tgz) and copying tar.gz contents to a directory and converting directory to sfs(dir2sfs) is enough to load using your sfs linker.

Thanks also to sir BK and the Puppy Linux community.


Have a great day! Very Happy Very Happy

Eric
Cebu, Philippines
Back to top
View user's profile Send private message 
OldYogi

Joined: 12 Jan 2008
Posts: 27

PostPosted: Wed 14 Apr 2010, 10:37    Post subject:  

Jrb,

Yes, I did recreate the sfs_mnt_home directory -- but on reboot it doesn't pick up the Opera.tcz file.

I'm booting off of a usb, and as I have two versions of Puppy there, each in its own subdirectory, I put the .tcz file both in the top layer of the usb (mnt/home) and in the subdirectory (mnt/home/Puppy4312). But either way it doesn't display in sfs_mnt_home, which I assume it should do. When I click on it directly to install with sfs linker it turns up in the next folder in /my_links, suggesting it is loaded, an icon appears in the System menu, but it won't run.

I'm puzzled.
Back to top
View user's profile Send private message 
WarMocK


Joined: 05 Jul 2007
Posts: 169

PostPosted: Wed 14 Apr 2010, 11:08    Post subject:  

@OldYogi,
did you run it from a terminal (like rxvt) as well? If you haven't done this yet, you should give it a try and see what error messages it gives you. In case it DOES give you some error messages, redirect the error output into a text file and post it here so we can see what's going on:

Code:
$nameofprogram > /tmp/erroroutput
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 1017
Location: Smithers, BC, Canada

PostPosted: Wed 14 Apr 2010, 11:23    Post subject:  

OldYogi wrote:
I put the .tcz file both in the top layer of the usb (mnt/home) and in the subdirectory (mnt/home/Puppy4312). But either way it doesn't display in sfs_mnt_home, which I assume it should do.

It should, but it doesn't. The version of SFS Linker (1.2) in Puppy4.4 doesn't link .tcz's from /mnt/home to /sfs_mnt_home. An oversight on my part. Install the latest version (1.4) and it wil.
Quote:
but it won't run
TinyCore breaks everything down into the smallest possible .tcz units. This is the list of dependencies from opera10.tcz.dep:
Code:
qt-4.5-base.tcz
expat2.tcz
fontconfig.tcz

In actual fact puppy already has the last two. You only neet to install qt-4.5-base.tcz.
WarMock wrote:
did you run it from a terminal (like rxvt) as well?

WarMock is exactly right. If you open a terminal and type
Code:
opera
it will tell you any deps that are missing. You then have to track them down and install.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 4 of 10 [136 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
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.1208s ][ Queries: 12 (0.0238s) ][ GZIP on ]