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 21 Sep 2019, 19:48
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Mass conversion using tgz2pet?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [5 Posts]  
Author Message
Stormson5150

Joined: 06 Feb 2009
Posts: 40

PostPosted: Fri 03 Apr 2009, 14:21    Post subject:  Mass conversion using tgz2pet?  

I am (slowly) building up towards my own puplet or, possibly, actual fork of puppy... I would like it to be as slackware based as possible. In that aim, I have transferred the entire slackware 12.2 tree locally, and would like to convert the tgz's to pet's... tgz2pet works great on single files, however it will not convert an entire directory using
Code:
tgz2pet *.tgz

Is it possible to mass convert?
Back to top
View user's profile Send private message 
pcampbell87

Joined: 02 Apr 2009
Posts: 29

PostPosted: Fri 03 Apr 2009, 15:24    Post subject:  

You could try a script... I am not particularly good at shell scripting so this might not be the best way but it should work.

First, make a list of all the .tgz files. Run the following from the terminal:
Code:
find . | grep tgz > list


Second, loop over the list, running tgz2pet on each line. Run the following from the terminal:
Code:
if [ -f list ]; then while read FILE; do tgz2pet $FILE; done < list; fi


Hope this helps! Wink
Back to top
View user's profile Send private message 
Stormson5150

Joined: 06 Feb 2009
Posts: 40

PostPosted: Fri 03 Apr 2009, 18:54    Post subject:  

SWEET!

He shoots.. and he scores! Thank you pcampbell87, it worked great!

It did leave a "list" file file in the directory, containing the names of the converted packages.... And I'm not sure if the permissions will hold though the transfer, but if you or anyone can use it, here's the completed script, may have to be reset to "executable" if the permissions dont make it through...

Same exact code you gave me, just added the first /bin/sh part...

It is ~NOT~ a tar.gz file... But scripts are not allowed to be uploaded apparently, so just delete the ".tar.gz" extension and copy to /usr/bin...
mtgz2pet.tar.gz
Description 
gz

 Download 
Filename  mtgz2pet.tar.gz 
Filesize  118 Bytes 
Downloaded  531 Time(s) 

Last edited by Stormson5150 on Fri 03 Apr 2009, 20:20; edited 1 time in total
Back to top
View user's profile Send private message 
pcampbell87

Joined: 02 Apr 2009
Posts: 29

PostPosted: Fri 03 Apr 2009, 19:03    Post subject:  

Glad to have helped Wink

You can safely remove the list file after you are done, you could also add
Code:
rm list

to the end of your script to remove it automatically.
Back to top
View user's profile Send private message 
Stormson5150

Joined: 06 Feb 2009
Posts: 40

PostPosted: Fri 03 Apr 2009, 20:22    Post subject:  

HA! I'm brain dead today... I actually knew that one, just didnt think about it... Thanks again pcampbell87! Very Happy

Tested... works.. Updated the above...
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 » House Training » Users ( For the regulars )
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.0450s ][ Queries: 12 (0.0134s) ][ GZIP on ]