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 Mon 24 Nov 2014, 04:32
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Puppy Packages Updater Utility
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [26 Posts]   Goto page: Previous 1, 2
Author Message
linus.cl

Joined: 02 Apr 2014
Posts: 92
Location: Germany

PostPosted: Wed 20 Aug 2014, 02:21    Post subject:  

Now on Github:
https://github.com/linuscl/updatepuppy
Back to top
View user's profile Send private message 
mavrothal


Joined: 24 Aug 2009
Posts: 1794

PostPosted: Wed 20 Aug 2014, 02:22    Post subject:  

Take a look at /usr/bin/updates_mgr in the latest slacko. You may want to extend that to handle the puppy repos too.
The package version is the the 3rd field in package specs and *-installed-packages so
Code:
{echo,cat,while} $LINE |  cut -f 3 -d '|'
will give you the package version and then you can use vercmp to compare them.
_________________
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 
linus.cl

Joined: 02 Apr 2014
Posts: 92
Location: Germany

PostPosted: Wed 20 Aug 2014, 13:34    Post subject:  

I wrote some more code.
How can I continue?

https://github.com/linuscl/updatepuppy/blob/master/updatepuppy/updatepuppy.sh

Please write your tips here! Very Happy Very Happy

Thank you for all! Smile
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3393
Location: Oregon

PostPosted: Thu 21 Aug 2014, 01:27    Post subject:  

When I use Update in Puppy Package manager, It has to convert the lists to Puppy format for display. And in selecting repositories, old versions of Puppy are included in the update process. So... Can the Update script be rewritten to allow for exclusion of some of the repositories?
Having updates done for the 3 and 4 versions of Puppy seems to be overkill.
Back to top
View user's profile Send private message 
linus.cl

Joined: 02 Apr 2014
Posts: 92
Location: Germany

PostPosted: Thu 21 Aug 2014, 03:52    Post subject:  

Thank you, 8-bit! Smile
I've updated my script.

There's still a question:

How can I create a loop for this code block?
I'd like to check all applications in my /tmp/packages-install file.

Code:
FIRST=$(head -n 1 /tmp/packages-install | cut -d\| -f 1)
version=$(head -n 1 /tmp/packages-install | cut -d\| -f 2)
ausgabegrep=$(grep -n -w $FIRST /tmp/packages-puppy-*)
file=$(echo $ausgabegrep | cut -d ':' -f 1)
if [ $file == "/tmp/packages-puppy-4" ]; then
filedirectory="/root/.packages/Packages-puppy-5-official"
elif [ $file == "/tmp/packages-puppy-5" ]; then
filedirectory="/root/.packages/Packages-puppy-slacko-official"
elif [ $file == "/tmp/packages-puppy-6" ]; then
filedirectory="/root/.packages/Packages-puppy-slacko14-official"
elif [ $file == "/tmp/packages-puppy-7" ]; then
filedirectory="/root/.packages/Packages-puppy-common-official"
elif [ $file == "/tmp/packages-puppy-8" ]; then
filedirectory="/root/.packages/Packages-puppy-noarch-official"
else
fehler=$(echo $ausgabegrep | cut -d ':' -f 3)
echo "File wasn't found"
fi


All lines must be checked.
Back to top
View user's profile Send private message 
mavrothal


Joined: 24 Aug 2009
Posts: 1794

PostPosted: Thu 21 Aug 2014, 11:39    Post subject:  

linus.cl wrote:
How can I create a loop for this code block?

Time for some reading Wink
You also may want to look at some PPM scripts too.

_________________
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 
linus.cl

Joined: 02 Apr 2014
Posts: 92
Location: Germany

PostPosted: Sun 24 Aug 2014, 13:45    Post subject:  

There are nearly hundred lines of code now!

Look on Github!

How can I compare the versions?
Back to top
View user's profile Send private message 
mavrothal


Joined: 24 Aug 2009
Posts: 1794

PostPosted: Mon 25 Aug 2014, 05:59    Post subject:  

linus.cl wrote:

How can I compare the versions?

what versions?
you can see your commits in https://github.com/linuscl/updatepuppy/commits/master or locally with
Code:
git show <commit hash>

to go to a "version" (ie previous commit) you can use git checkout or reset.

_________________
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 
jamesbond

Joined: 26 Feb 2007
Posts: 2230
Location: The Blue Marble

PostPosted: Mon 25 Aug 2014, 08:24    Post subject:  

linus.cl wrote:
How can I compare the versions?

Use "git diff".

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
linus.cl

Joined: 02 Apr 2014
Posts: 92
Location: Germany

PostPosted: Mon 25 Aug 2014, 09:31    Post subject:  

Thank you!
updatepuppy.tar.gz
Description 
gz

 Download 
Filename  updatepuppy.tar.gz 
Filesize  1.28 KB 
Downloaded  24 Time(s) 
Back to top
View user's profile Send private message 
linus.cl

Joined: 02 Apr 2014
Posts: 92
Location: Germany

PostPosted: Tue 26 Aug 2014, 05:06    Post subject:  

Something goes wrong in my script... Sad

Some packages will be installed twice..

Look at the source!

I hope you can find the error Shocked
updatepuppy.tar.gz
Description 
gz

 Download 
Filename  updatepuppy.tar.gz 
Filesize  1.66 KB 
Downloaded  25 Time(s) 
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 2 [26 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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.0761s ][ Queries: 13 (0.0081s) ][ GZIP on ]