You are not logged in.

#1 2009-08-22 05:21:04

keenerd
Trusted User (TU)
Registered: 2007-02-22
Posts: 647
Website

pacmatic: No more surprises!

Pacmatic is a little wrapper for pacman.  It adds some much needed introspection and information to the installation process.  If the devs have news for you, you'll see it before updating your system.  If people have been talking about your apps on the ML, you will see it.  It will also throw a warning before letting you "pacman -Sy break-everything".  Finally, it will inform you about any pacnew files that popped up, and prod you to take care of them.

Treat it just like normal pacman, as all the arguments are passed through transparently.  So "pacman -Syu" becomes "pacmatic -Syu".  You might need to add it to your sudo config, too.

Homepage:
http://kmkeen.com/pacmatic/

It is in the AUR:
http://aur.archlinux.org/packages.php?ID=29541

And on GitHub:
http://github.com/keenerd/pacmatic/

There are a few known issues that I am stuck on.  The RSS parser is very brittle.  It can not tell if you aborted an update partway through.

Last edited by keenerd (2011-03-20 23:44:13)

Offline

#2 2009-08-22 05:41:17

Ranguvar
Member
From: Our collective subconscious
Registered: 2008-08-12
Posts: 2,515
Website

Re: pacmatic: No more surprises!

Sounds interesting. Could you please explain in further detail? Your site page for it is down smile

Offline

#3 2009-08-22 06:10:52

bender02
Member
From: Germany
Registered: 2007-02-04
Posts: 1,328

Re: pacmatic: No more surprises!

Interesting project, but so far it only checks the news and checks whether the last time syncing wasn't too long ago. I was kinda hoping that arch users are wise enough to remember and do these things themselves...

Offline

#4 2009-08-22 07:47:45

keenerd
Trusted User (TU)
Registered: 2007-02-22
Posts: 647
Website

Re: pacmatic: No more surprises!

edit: place holder webpage is up.

bender02, Are slackware users more wise because they figure out dependencies by themselves?  It might sound like a silly example, but pacman is supposed to be an awesome package manager, and these are two areas where it falls flat.  Besides, it is very easy for Archers to forget to do these things.  (And simple for the computer to do them automatically.)  Heck, I was an Archer for three years before I even heard about doing them!  These are the only things it does because these are the only (known) holes in pacman's otherwise flawless interface.

So, a little more about what it does.

Right now: not much and poorly.  It still misses a lot of dangerous edge cases (it will say everything is okay when it's not) but it works in the general sense and doesn't produce false positives.

Specifically, it checks to make sure you are following two unwritten rules.

First, always check the Arch homepage before updating.  It's got a very crude RSS parser in a dozen lines of bash.  (30 real lines, what with functions and comments.)  The news is also recorded to "/var/log/arch-news.log".  Since the news is saved to the log file, you will only see each new item once.  If you run pacmatic again in a few seconds, your output will be empty and normal.

Second, don't let your sync get ahead of your local install.  This is the dreaded "-Sy" issue. It is not perfect, and I am trying to figure out how to coax important (but unlogged) information from pacman.  It parses pacman.log for the last sync and the last complete upgrade.  If the sync is more than an hour ahead of the upgrade, it will throw a warning.

If you know any other common ways to shoot yourself in the foot, could you tell me?

Last edited by keenerd (2009-08-22 18:09:57)

Offline

#5 2009-08-22 12:56:49

bender02
Member
From: Germany
Registered: 2007-02-04
Posts: 1,328

Re: pacmatic: No more surprises!

Another common way to shoot yourself in the sensitive area is by ignoring .pacnew and .pacsave config files. Although pacman emits a warning each time these are created, users still ignore them...

Offline

#6 2009-08-22 15:32:54

keenerd
Trusted User (TU)
Registered: 2007-02-22
Posts: 647
Website

Re: pacmatic: No more surprises!

Ah, yeah.  Pacnew files.  I am guilty of that, too.  Someone (Brisbin?  Xyne?) has made an app for dealing with them.  Maybe something simple, like the intersection of pacnew files from the logs with pacnew files on the drive.  Or call their app automatically from pacmann.

Lets see: pacman-contrib has pacdiff, yaourt has pacdiffviewer, Brisbin has pacnews, dotpac from a few years ago.  I think I will go with pacdiff.  It's the lightest on deps.

Wasn't there also a horrible bug involving free hard drive space?  Something like if you ran out of drive space while extracting the core/extra/community lists, pacman would not be able to sync properly again.  Silly bug tracker is down...

Offline

#7 2009-08-23 02:04:02

keenerd
Trusted User (TU)
Registered: 2007-02-22
Posts: 647
Website

Re: pacmatic: No more surprises!

Updated!  It calls out to the excellent pacdiff when you've got pacnew files floating around.

I would like to try to make the whole experience slicker, but I imagine this will require a bit of dogfooding.

Random thing I just found out while testing pacdiff:  our vi package (which is not really vi but a cut down vim) has vimdiff support.  But not the vimdiff command.  You can alias "vi -d" and it works as a perfectly functional vimdiff.

Offline

#8 2009-08-23 10:08:37

xduugu
Member
Registered: 2008-10-16
Posts: 288

Re: pacmatic: No more surprises!

keenerd wrote:

Random thing I just found out while testing pacdiff:  our vi package (which is not really vi but a cut down vim) has vimdiff support.  But not the vimdiff command.  You can alias "vi -d" and it works as a perfectly functional vimdiff.

This was changed some while ago, but the package is still in testing. So don't be surprised if the next vi update breaks your setup. smile

http://www.archlinux.org/packages/testing/i686/vi/

Offline

#9 2009-08-23 20:02:50

b9anders
Member
Registered: 2007-11-07
Posts: 681

Re: pacmatic: No more surprises!

sweet app. Thanks. Changed my upgrade alias ('pyu') from 'sudo pacman-color -Syu' to 'sudo pacmatic -Syu' for upgrades now. smile

Offline

#10 2009-09-02 03:11:19

keenerd
Trusted User (TU)
Registered: 2007-02-22
Posts: 647
Website

Re: pacmatic: No more surprises!

New release!

Very minor changes, mostly cosmetic and related to removing an excess of newlines in the output.

Offline

#11 2009-09-02 05:52:23

ugkbunb
Member
Registered: 2009-02-26
Posts: 227

Re: pacmatic: No more surprises!

nice release... running into some issues with the updating from the pacnew files...

35 pacnew files found (0 added).  Update files now? (Y/n) y
File: /etc/fam/fam.conf
  /etc/fam/fam.conf does not exist
rm: remove regular file `/etc/fam/fam.conf.pacsave'? y
File: /etc/logrotate.d/slim
  Files are identical, removing...
File: /etc/php/php.ini
  File differences found. (V)iew, (S)kip, (R)emove: [v/s/r] v
2 files to edit

Cannot execute shell zsh

Error detected while processing /usr/share/vim/vim72/ftplugin/man.vim:
line   47:
E484: Can't open file /tmp/v888042/0
Cannot execute shell zsh

Error detected while processing /home/geota/.vim/plugin/c.vim:
line   85:
E484: Can't open file /tmp/v888042/1
Taglist: Exuberant ctags (http://ctags.sf.net) not found in PATH. Plugin is not loaded.

Offline

#12 2009-09-02 10:09:07

keenerd
Trusted User (TU)
Registered: 2007-02-22
Posts: 647
Website

Re: pacmatic: No more surprises!

It looks like your issue is with pacdiff (part of pacman_contrib), somewhere between prompting you and running vimdiff.

First question, do you have vimdiff?

Second question:  what do you have $DIFFPROG set to?

Third question:  any bash experts around?  Relevant part of Aaron's code:

                echo -n "  File differences found. (V)iew, (S)kip, (R)emove: [v/s/r] "
                while read c; do
                        case $c in
                                r|R) rm "$pacfile"; break ;;
                                v|V)
                                $diffprog "$pacfile" "$file"
                                rm -i "$pacfile"; break ;;
                                s|S) break ;;
                                *) echo -n "  Invalid answer. Try again: [v/s/r] "; continue ;;
                        esac
                done

Offline

#13 2009-09-02 10:14:15

Shapeshifter
Member
Registered: 2008-03-11
Posts: 217

Re: pacmatic: No more surprises!

I have already made something similar to this:

Safepac: http://bbs.archlinux.org/viewtopic.php?id=66822

It reads the news and can automatically update your system while not touching anything that is mentioned in the news. It's designed for autoupdating, but you can easily use it manually (just don't use the silent option).

I've been using it on two boxes for months now without problems.

btw: I don't use an rss parser but simply curl to parse the news page wink it works!

Last edited by Shapeshifter (2009-09-02 10:14:56)

Offline

#14 2009-09-02 11:49:14

keenerd
Trusted User (TU)
Registered: 2007-02-22
Posts: 647
Website

Re: pacmatic: No more surprises!

Interesting and clever.  From what I gather, Safepac is designed so that the computer can update everything automatically.  For comparison, Pacmatic is designed to bring information to humans so they can make smarter choices.  Safepac certainly is ambitious, but it was not quite what I was looking for.

Offline

#15 2009-09-02 20:46:24

ugkbunb
Member
Registered: 2009-02-26
Posts: 227

Re: pacmatic: No more surprises!

keenerd wrote:

It looks like your issue is with pacdiff (part of pacman_contrib), somewhere between prompting you and running vimdiff.

First question, do you have vimdiff?

Second question:  what do you have $DIFFPROG set to?

when I run vimdiff from the console I get the exact same error...

Cannot execute shell zsh

Error detected while processing /usr/share/vim/vim72/ftplugin/man.vim:
line   47:
E484: Can't open file /tmp/v946889/0
Cannot execute shell zsh

Error detected while processing /home/geota/.vim/plugin/c.vim:
line   85:
E484: Can't open file /tmp/v946889/1
Taglist: Exuberant ctags (http://ctags.sf.net) not found in PATH. Plugin is not loaded.
Press ENTER or type command to continue

I am not sure how to check what $DIFFPROF is set to... I did an echo $DIFFPROF and it returned nothing/a  blank line.

Offline

#16 2009-09-02 21:00:27

Arm-the-Homeless
Member
Registered: 2008-12-22
Posts: 273

Re: pacmatic: No more surprises!

keenerd wrote:

Third question:  any bash experts around?  Relevant part of Aaron's code:

                echo -n "  File differences found. (V)iew, (S)kip, (R)emove: [v/s/r] "
                while read c; do
                        case $c in
                                r|R) rm "$pacfile"; break ;;
                                v|V)
                                $diffprog "$pacfile" "$file"
                                rm -i "$pacfile"; break ;;
                                s|S) break ;;
                                *) echo -n "  Invalid answer. Try again: [v/s/r] "; continue ;;
                        esac
                done

It's just so if you type r or R it removes the file, if you type v or V is diffs the file, and if you type s or S is skips the file. Anything else says invalid answer.

Offline

#17 2009-09-03 02:21:08

keenerd
Trusted User (TU)
Registered: 2007-02-22
Posts: 647
Website

Re: pacmatic: No more surprises!

ugkbunb wrote:

when I run vimdiff from the console I get the exact same error...

Looks like you found the problem.  Does "vim -d file1 file2" cause the same error?  Anyway, this is something to bring to the attention of the vim maintainer.

Offline

#18 2009-09-03 02:55:54

ugkbunb
Member
Registered: 2009-02-26
Posts: 227

Re: pacmatic: No more surprises!

keenerd wrote:

Does "vim -d file1 file2" cause the same error?

Yup it does... guess I will try and get in contact with the vim maintainer.

Offline

#19 2009-09-03 10:47:37

keenerd
Trusted User (TU)
Registered: 2007-02-22
Posts: 647
Website

Re: pacmatic: No more surprises!

Hrm.  That is really no good.

You can get around this by setting/exporting $DIFFPROG to something else.  If you need console diff, emacs has a diff mode.  If gui is acceptable, there are more options (kdiff, meld [my favorite], fldiff).

Offline

#20 2009-09-03 12:14:40

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: pacmatic: No more surprises!

ugkbunb wrote:

nice release... running into some issues with the updating from the pacnew files...

35 pacnew files found (0 added).  Update files now? (Y/n) y
File: /etc/fam/fam.conf
  /etc/fam/fam.conf does not exist
rm: remove regular file `/etc/fam/fam.conf.pacsave'? y
File: /etc/logrotate.d/slim
  Files are identical, removing...
File: /etc/php/php.ini
  File differences found. (V)iew, (S)kip, (R)emove: [v/s/r] v
2 files to edit

Cannot execute shell zsh

Error detected while processing /usr/share/vim/vim72/ftplugin/man.vim:
line   47:
E484: Can't open file /tmp/v888042/0
Cannot execute shell zsh

Error detected while processing /home/geota/.vim/plugin/c.vim:
line   85:
E484: Can't open file /tmp/v888042/1
Taglist: Exuberant ctags (http://ctags.sf.net) not found in PATH. Plugin is not loaded.

can you run vim and zsh from your shell ?
are you using zsh as a shell ?


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#21 2009-09-04 04:55:41

ugkbunb
Member
Registered: 2009-02-26
Posts: 227

Re: pacmatic: No more surprises!

shining wrote:

can you run vim and zsh from your shell ?
are you using zsh as a shell ?

I think I figured it out... it was an error in .vimrc that I had grabbed from some persons config package... After removing the lines that are causing the rror from my vimrc everything works great... I was getting the following error but installing ctags fixed it right up.

Taglist: Exuberant ctags (http://ctags.sf.net) not found in PATH. Plugin is not loaded.
Press ENTER or type command to continue

I am not using zsh as a shell although I do have it installed... I tried using it as my default shell but could not get my PS1 converted properly... and I am rather attached to it tongue

Last edited by ugkbunb (2009-09-04 05:00:31)

Offline

#22 2009-09-06 20:09:40

ugkbunb
Member
Registered: 2009-02-26
Posts: 227

Re: pacmatic: No more surprises!

How hard would it be to add support for meld in editing / viewing the differences?

Offline

#23 2009-10-18 15:11:11

keenerd
Trusted User (TU)
Registered: 2007-02-22
Posts: 647
Website

Re: pacmatic: No more surprises!

New version.  More pacman option lines are detected.

Did I get them all?  For example, ways to sync and update:
-Syu -Suy -Syyu -Syuy -Suyy

Offline

#24 2009-10-18 15:15:55

keenerd
Trusted User (TU)
Registered: 2007-02-22
Posts: 647
Website

Re: pacmatic: No more surprises!

ugkbunb,
Sorry about missing your question.  Meld is certainly doable.  The "pacdiff" script checks for an environment variable "$diffprog". Normally this is set to vimdiff, but you can export meld to it.  Naturally, don't do that outside of X.

Offline

#25 2010-01-14 15:41:36

keenerd
Trusted User (TU)
Registered: 2007-02-22
Posts: 647
Website

Re: pacmatic: No more surprises!

I fixed my silly little bash based RSS parser.  Now you will never miss another feed update again.  It prints a bit more nicely, too.

Offline

Board footer

Powered by FluxBB