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 Thu 02 Oct 2014, 11:15
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 Posts_count   Goto page: Previous 1, 2
Author Message
linus.cl

Joined: 02 Apr 2014
Posts: 79
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: 1638

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: 79
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: 3368
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: 79
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: 1638

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: 79
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: 1638

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: 2191
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: 79
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  11 Time(s) 
Back to top
View user's profile Send_private_message 
linus.cl

Joined: 02 Apr 2014
Posts: 79
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  17 Time(s) 
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 2 of 2 Posts_count   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:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0683s ][ Queries: 13 (0.0088s) ][ GZIP on ]