You are not logged in.
So I was kind of bummed that Arch didn't really have nice changelogs like I remember from Ubuntu. It never occurred to me that someone was doing those manually for each package update, which is obviously not realistic for a project like Arch. But after some searching, I found out that most of the devs write decently verbose commit messages. And since all that clicking is way too much work for every package, I made a little ruby program to get "changelogs" from commit messages.
Here's the help output:
Usage: pkgcl [options] <packages>
-c, --commits=NUM Show NUM commit messages
--show-git-svn-id Show git-svn-id messages
-h, --help Show this message
It takes STDIN too! For all packages that need updating:
pacman -Qqu | pkgcl
Writing this doubled as a ruby learning experience for me, so I'm sure this could be better/faster. Let me know what you think!
Last edited by alexpbrown (2012-01-28 19:01:21)
Offline
I really like this idea and it worked for me.
A suggestion, you could create a gemspec file and upload pkgcl to rubygems
Offline
Thanks!
I always thought rubygems were for libraries for some reason, but I just looked at the docs and it says "applications or libraries". So I guess that means I'm looking into it!
Offline
@alexpbrown,
Thanks for the pkgcl - two days ago I have started a thread about your - as I know now - package: https://bbs.archlinux.org/viewtopic.php?id=134732
"I exist" is the best myth I know..
Offline
Woah, I had no idea! I had seen some talk on the forums about wanting something like this, but I must have missed this thread. Thanks for checking out my script
Offline
Voted on AUR. Keep the work. Very useful.
There is a difference between knowing the path and walking the path.
Offline
Bug
pkgcl foo
[foo]
Not Found
[foo]
/usr/lib/ruby/1.9.1/open-uri.rb:35:in `initialize': No such file or directory - &showmsg=1 (Errno::ENOENT)
from /usr/lib/ruby/1.9.1/open-uri.rb:35:in `open'
from /usr/lib/ruby/1.9.1/open-uri.rb:35:in `open'
from /usr/bin/pkgcl:132:in `block in <main>'
from /usr/bin/pkgcl:127:in `each'
from /usr/bin/pkgcl:127:in `<main>'
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
Packages in [testing] will never be found unless they're brand new. Diff belows fixes that, as well as the explosion when open() fails (by avoiding it). That said, you should probably do a proper begin/rescue for that call since its dependent on the network and could fail for a menagerie of reasons, even if get_pkg() suceeds.
diff --git a/pkgcl b/pkgcl
index b32e2b9..e226a27 100755
--- a/pkgcl
+++ b/pkgcl
@@ -63,6 +63,8 @@ def get_pkg(pkg)
repo = $2
when /^Architecture(\s?)*: (.+)$/
arch = $2
+ when /^$/
+ break
end
end
end
@@ -125,7 +127,7 @@ def show_commit(n)
end
packages.each do |p|
- git_link = get_pkg(p)
+ git_link = get_pkg(p) or next
puts "["+colorize(p, 31)+"]"
# get the page with the messages expanded
Last edited by falconindy (2012-02-10 21:24:16)
Offline
Bug
pkgcl foo [foo] Not Found [foo] /usr/lib/ruby/1.9.1/open-uri.rb:35:in `initialize': No such file or directory - &showmsg=1 (Errno::ENOENT) from /usr/lib/ruby/1.9.1/open-uri.rb:35:in `open' from /usr/lib/ruby/1.9.1/open-uri.rb:35:in `open' from /usr/bin/pkgcl:132:in `block in <main>' from /usr/bin/pkgcl:127:in `each' from /usr/bin/pkgcl:127:in `<main>'
I just pushed a version to AUR that should fix this. Let me know!
Offline
Packages in [testing] will never be found unless they're brand new. Diff belows fixes that, as well as the explosion when open() fails (by avoiding it). That said, you should probably do a proper begin/rescue for that call since its dependent on the network and could fail for a menagerie of reasons, even if get_pkg() suceeds.
*awesome patch snipped*
Thanks for the patch! I don't have [testing] enabled so I'm not sure I know what you're referring to, but I'll turn it on and see what's up.
Good call on the "begin/rescue" too. Might take a bit since this is a ruby learning experience for me, bear with me!
Offline
fsckd wrote:Bug
I just pushed a version to AUR that should fix this. Let me know!
Yes it does.
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
Thanks for the patch! I don't have [testing] enabled so I'm not sure I know what you're referring to
The problem is that calling 'pacman -Si <pkg>' will return multiple instances of the package when it exists in multiple repos, for example:
$ pacman -Si kmod
Repository : testing
Name : kmod
Version : 5-2
URL : http://git.profusion.mobi/cgit.cgi/kmod.git
Licenses : GPL2
Groups : None
Provides : module-init-tools=3.16
Depends On : glibc zlib
Optional Deps : None
Conflicts With : module-init-tools
Replaces : module-init-tools
Download Size : 69.71 KiB
Installed Size : 312.00 KiB
Packager : Dave Reisner <dreisner@archlinux.org>
Architecture : x86_64
Build Date : Fri 10 Feb 2012 02:08:36 PM EST
MD5 Sum : 0df4e6b14d272712bd3f08cfd1dc1f80
SHA256 Sum : 3fa39adc75c460c924c92c8e727a656767da027ac92a58bc3fa12e7ffa201321
Signatures : Yes
Description : Linux kernel module handling
Repository : core
Name : kmod
Version : 4-2
URL : http://git.profusion.mobi/cgit.cgi/kmod.git
Licenses : GPL2
Groups : None
Provides : module-init-tools=3.16
Depends On : glibc zlib
Optional Deps : None
Conflicts With : module-init-tools
Replaces : module-init-tools
Download Size : 75.64 KiB
Installed Size : 292.00 KiB
Packager : Dave Reisner <dreisner@archlinux.org>
Architecture : x86_64
Build Date : Tue 31 Jan 2012 12:16:01 AM EST
MD5 Sum : f9b608f832ffdc3cf4b550e8d71e3494
SHA256 Sum : d71dc1cd3340ec8cf25c3efbbf02d412019e05fa025ff2230948f7567ffec04f
Signatures : Yes
Description : Linux kernel module handling
Your while loop will read the entirety of the output, leaving repo/arch set according to the last occurrences of those keys. I'd say 99% of the time, you want info about the package that pacman is going to favor, e.g. the first result, so simply quit parsing after the end of the first result.
I don't really know ruby either, but it's readable enough that it's easy to hack on for simple bug fixes like this.
Last edited by falconindy (2012-02-11 00:43:37)
Offline
Yes it does.
/dance
Your while loop will read the entirety of the output, leaving repo/arch set according to the last occurrences of those keys. I'd say 99% of the time, you want info about the package that pacman is going to favor, e.g. the first result, so simply quit parsing after the end of the first result.
Ah, that makes sense. I updated it with your patch. This ends up working pretty much exactly like calling `pkgcl --enable-testing`
I don't really know ruby either, but it's readable enough that it's easy to hack on for simple bug fixes like this.
This is one of the things I'm really liking about ruby so far.
Offline
Voted on AUR. I hope to see it in the official repositories soon.
Last edited by FernandoBasso (2012-11-05 09:59:55)
There is a difference between knowing the path and walking the path.
Offline
When trying to use this, I got the following error:
/usr/lib/ruby/1.9.1/open-uri.rb:216:in `open_loop': redirection forbidden: http://www.archlinux.org -> https://www.archlinux.org/ (RuntimeError)
from /usr/lib/ruby/1.9.1/open-uri.rb:146:in `open_uri'
from /usr/lib/ruby/1.9.1/open-uri.rb:677:in `open'
from /usr/lib/ruby/1.9.1/open-uri.rb:33:in `open'
from ./test.rb:6:in `<main>'
So I replaced the "http" in line 83 with "https", and now it works as expected.
Anyway, very cool stuff! I was looking for something like this for a long time!
Offline