[pacman-dev] [PATCH] Add ShowOldVersion Option
First of all, I just wanted to thank all of you for your hard work on pacman, I think it is one of the best package management tools out there. I have been following the list for a bit with the intent of starting to help out with the development of pacman (Or at least to try to help out anyway) so I figured I might as well dive in with a feature that I have had in mind for a while. This patch adds the option of allowing the old package version that is being updated from to be displayed. It takes advantage of the data element in the sync package struct which is populated with the currently installed version of the package. This feature can be beneficial in many ways, but mostly it is a good indicator (at least for me) of whether I should check out the change log of the program. With minor version increases, it is most likely minor updates or bug fixes, but if it is a major version increase, many things might have been changed that are worth checking up on before going through with the install. The following is some output with the ShowOldVersion option enabled as well as the ShowSize option ---- $ sudo src/pacman/pacman.static -Qu Checking for package upgrades... warning: xpdf: forcing upgrade to version 3.02_pl2-1 Remove: lib32-gcc Total Removed Size: 0.00 MB Targets: lib32-gcc-libs-4.2.2-2 [New] [1.05 MB] audacious-player-1.4.0-1 [1.3.2-4] [1.07 MB] audacious-plugins-1.4.0-2 [1.3.5-5.1] [1.68 MB] eclipse-pydev-1.3.10-1 [1.3.9-1] [3.39 MB] fakeroot-1.8.4-1 [1.7.1-3] [0.06 MB] glibc-2.7-6 [2.7-4] [10.78 MB] glproto-1.4.9-1 [1.4.8-1] [0.02 MB] hal-info-0.20071030-1 [0.20071011-1] [0.03 MB] imagemagick-6.3.6.10-1 [6.3.6.6-1] [2.30 MB] lib32-glibc-2.7-5 [2.6.1-2] [3.64 MB] libarchive-2.4.0-1 [2.2.6-2] [0.32 MB] libgphoto2-2.4.0-2 [2.3.1-3] [1.36 MB] libmcs-0.6.0-1 [0.4.1-2] [0.02 MB] libsamplerate-0.1.2-4 [0.1.2-3] [0.20 MB] lincity-ng-1.1.2-1 [1.1.1-1] [29.16 MB] lm_sensors-2.10.5-2 [2.10.5-1] [0.32 MB] tcl-8.4.16-2 [8.4.16-1] [1.63 MB] tk-8.4.16-2 [8.4.16-1] [1.40 MB] ttf-dejavu-2.21-1 [2.20-1] [3.79 MB] xf86-video-ati-6.7.195-3 [6.7.195-1] [3.67 MB] xorg-server-1.4-5 [1.4-4] [7.25 MB] xpdf-3.02_pl2-1 [3.02_pl1-1] [0.49 MB] Total Download Size: 73.64 MB Total Installed Size: 91.08 MB ---- Let me know what you think. Thanks, Justin Lampley
On Tue, Nov 13, 2007 at 11:57:49PM -0500, Justin Lampley wrote:
This feature can be beneficial in many ways, but mostly it is a good indicator (at least for me) of whether I should check out the change log of the program. With minor version increases, it is most likely minor updates or bug fixes, but if it is a major version increase, many things might have been changed that are worth checking up on before going through with the install.
For me too, it's a very valuable information that I missed several times in pacman (apt-get probably had it, but I don't remember how it was displayed..). So the only thing that bothers me is the way it's displayed, I don't find it very readable. But I don't have a better suggestion yet, besides maybe taking inspiration from other package managers.
2007/11/14, Xavier <shiningxc@gmail.com>:
On Tue, Nov 13, 2007 at 11:57:49PM -0500, Justin Lampley wrote:
This feature can be beneficial in many ways, but mostly it is a good indicator (at least for me) of whether I should check out the change log of the program. With minor version increases, it is most likely minor updates or bug fixes, but if it is a major version increase, many things might have been changed that are worth checking up on before going through with the install.
For me too, it's a very valuable information that I missed several times in pacman (apt-get probably had it, but I don't remember how it was displayed..).
So the only thing that bothers me is the way it's displayed, I don't find it very readable. But I don't have a better suggestion yet, besides maybe taking inspiration from other package managers.
I suggest this: Remove: lib32-gcc Total Removed Size: 0.00 MB Targets: lib32-gcc-libs-4.2.2-2 [New] 1.05 MB audacious-player-1.4.0-1 [1.3.2-4] 1.07 MB audacious-plugins-1.4.0-2 [1.3.5-5.1] 1.68 MB eclipse-pydev-1.3.10-1 [1.3.9-1] 3.39 MB fakeroot-1.8.4-1 [1.7.1-3] 0.06 MB glibc-2.7-6 [2.7-4] 10.78 MB glproto-1.4.9-1 [1.4.8-1] 0.02 MB hal-info-0.20071030-1 [0.20071011-1] 0.03 MB imagemagick-6.3.6.10-1 [6.3.6.6-1] 2.30 MB lib32-glibc-2.7-5 [2.6.1-2] 3.64 MB libarchive-2.4.0-1 [2.2.6-2] 0.32 MB libgphoto2-2.4.0-2 [2.3.1-3] 1.36 MB libmcs-0.6.0-1 [0.4.1-2] 0.02 MB libsamplerate-0.1.2-4 [0.1.2-3] 0.20 MB lincity-ng-1.1.2-1 [1.1.1-1] 29.16 MB lm_sensors-2.10.5-2 [2.10.5-1] 0.32 MB tcl-8.4.16-2 [8.4.16-1] 1.63 MB tk-8.4.16-2 [8.4.16-1] 1.40 MB ttf-dejavu-2.21-1 [2.20-1] 3.79 MB xf86-video-ati-6.7.195-3 [6.7.195-1] 3.67 MB xorg-server-1.4-5 [1.4-4] 7.25 MB xpdf-3.02_pl2-1 [3.02_pl1-1] 0.49 MB Total Download Size: 73.64 MB Total Installed Size: 91.08 MB Every package is printed on a new line, pkgname-pkgver-pkgrel, old pkgver-pkgname and size are separated with 2 spaces. -- Roman Kyrylych (Роман Кирилич)
Well, I suggest using a fixed width for the size and putting it first on the line so that at least size & package name line up.
Roman Kyrylych wrote:
I suggest this:
Remove: lib32-gcc
Total Removed Size: 0.00 MB
Targets: lib32-gcc-libs-4.2.2-2 [New] 1.05 MB audacious-player-1.4.0-1 [1.3.2-4] 1.07 MB audacious-plugins-1.4.0-2 [1.3.5-5.1] 1.68 MB eclipse-pydev-1.3.10-1 [1.3.9-1] 3.39 MB fakeroot-1.8.4-1 [1.7.1-3] 0.06 MB glibc-2.7-6 [2.7-4] 10.78 MB glproto-1.4.9-1 [1.4.8-1] 0.02 MB hal-info-0.20071030-1 [0.20071011-1] 0.03 MB imagemagick-6.3.6.10-1 [6.3.6.6-1] 2.30 MB lib32-glibc-2.7-5 [2.6.1-2] 3.64 MB libarchive-2.4.0-1 [2.2.6-2] 0.32 MB libgphoto2-2.4.0-2 [2.3.1-3] 1.36 MB libmcs-0.6.0-1 [0.4.1-2] 0.02 MB libsamplerate-0.1.2-4 [0.1.2-3] 0.20 MB lincity-ng-1.1.2-1 [1.1.1-1] 29.16 MB lm_sensors-2.10.5-2 [2.10.5-1] 0.32 MB tcl-8.4.16-2 [8.4.16-1] 1.63 MB tk-8.4.16-2 [8.4.16-1] 1.40 MB ttf-dejavu-2.21-1 [2.20-1] 3.79 MB xf86-video-ati-6.7.195-3 [6.7.195-1] 3.67 MB xorg-server-1.4-5 [1.4-4] 7.25 MB xpdf-3.02_pl2-1 [3.02_pl1-1] 0.49 MB
Total Download Size: 73.64 MB Total Installed Size: 91.08 MB
Every package is printed on a new line, pkgname-pkgver-pkgrel, old pkgver-pkgname and size are separated with 2 spaces.
I was also thinking about using a very similar format to this when I initially created this patch. The reason I did not initially put it in a format like this is because I wanted to leave alone the way things were currently displayed and just add in the old version. If I use this format, a couple of questions pop into my mind. What would happen if they just wanted to only enable ShowSize? Would it use the old format with the size in brackets and no separate line for each package? Would the above format only be used if both ShowSize and ShowOldVersion were enabled? What if only ShowOldVersion was enabled? Would each package be on its own line then as well? I personally would prefer each package to always appear on its own line, whether or not ShowSize and/or ShowOldVersion were set to display. Of course, I am sure others would disagree with me since that is not the way it is currently set up. Justin Lampley
2007/11/14, R. Dale Thomas <rdt@knoppmyth.net>:
Well, I suggest using a fixed width for the size and putting it first on the line so that at least size & package name line up.
I like your suggestion. 2007/11/14, Justin Lampley <jrlampley@gmail.com>:
I personally would prefer each package to always appear on its own line, whether or not ShowSize and/or ShowOldVersion were set to display. Of course, I am sure others would disagree with me since that is not the way it is currently set up.
Actually, I'd like to see every package on new line (*optionally* as there are people who prefer the current way). -- Roman Kyrylych (Роман Кирилич)
On Nov 14, 2007 9:09 AM, Justin Lampley <jrlampley@gmail.com> wrote:
Roman Kyrylych wrote:
I suggest this:
Remove: lib32-gcc
Total Removed Size: 0.00 MB
Targets: lib32-gcc-libs-4.2.2-2 [New] 1.05 MB audacious-player-1.4.0-1 [1.3.2-4] 1.07 MB audacious-plugins-1.4.0-2 [1.3.5-5.1] 1.68 MB eclipse-pydev-1.3.10-1 [1.3.9-1] 3.39 MB fakeroot-1.8.4-1 [1.7.1-3] 0.06 MB glibc-2.7-6 [2.7-4] 10.78 MB glproto-1.4.9-1 [1.4.8-1] 0.02 MB hal-info-0.20071030-1 [0.20071011-1] 0.03 MB imagemagick-6.3.6.10-1 [6.3.6.6-1] 2.30 MB lib32-glibc-2.7-5 [2.6.1-2] 3.64 MB libarchive-2.4.0-1 [2.2.6-2] 0.32 MB libgphoto2-2.4.0-2 [2.3.1-3] 1.36 MB libmcs-0.6.0-1 [0.4.1-2] 0.02 MB libsamplerate-0.1.2-4 [0.1.2-3] 0.20 MB lincity-ng-1.1.2-1 [1.1.1-1] 29.16 MB lm_sensors-2.10.5-2 [2.10.5-1] 0.32 MB tcl-8.4.16-2 [8.4.16-1] 1.63 MB tk-8.4.16-2 [8.4.16-1] 1.40 MB ttf-dejavu-2.21-1 [2.20-1] 3.79 MB xf86-video-ati-6.7.195-3 [6.7.195-1] 3.67 MB xorg-server-1.4-5 [1.4-4] 7.25 MB xpdf-3.02_pl2-1 [3.02_pl1-1] 0.49 MB
Total Download Size: 73.64 MB Total Installed Size: 91.08 MB
Every package is printed on a new line, pkgname-pkgver-pkgrel, old pkgver-pkgname and size are separated with 2 spaces.
I was also thinking about using a very similar format to this when I initially created this patch. The reason I did not initially put it in a format like this is because I wanted to leave alone the way things were currently displayed and just add in the old version.
If I use this format, a couple of questions pop into my mind. What would happen if they just wanted to only enable ShowSize? Would it use the old format with the size in brackets and no separate line for each package? Would the above format only be used if both ShowSize and ShowOldVersion were enabled? What if only ShowOldVersion was enabled? Would each package be on its own line then as well?
I personally would prefer each package to always appear on its own line, whether or not ShowSize and/or ShowOldVersion were set to display. Of course, I am sure others would disagree with me since that is not the way it is currently set up.
I guess I'll chime in here since I haven't yet and I'm the one that merges your patch anyway. If the code looks OK (haven't looked yet), then I will merge this for now because it is optional, so it will not affect anyone that doesn't want to see this. We can worry about changing the format later. Personally, I like less clutter, and moving each package to its own line when I am installing 60 packages would make my terminal scroll, which is not ideal. But thats just me. However, I would not be against some option to rectify this. Of course, we are going to reach the point soon where the output of this function is getting quite bloated, and will need a rewrite in order to keep it clean and well-organized with all these new output options. Aaron, any thoughts? -Dan
On Wed, Nov 14, 2007 at 09:29:37AM -0600, Dan McGee wrote:
On Nov 14, 2007 9:09 AM, Justin Lampley <jrlampley@gmail.com> wrote:
Roman Kyrylych wrote:
I suggest this:
Remove: lib32-gcc
Total Removed Size: 0.00 MB
Targets: lib32-gcc-libs-4.2.2-2 [New] 1.05 MB audacious-player-1.4.0-1 [1.3.2-4] 1.07 MB audacious-plugins-1.4.0-2 [1.3.5-5.1] 1.68 MB eclipse-pydev-1.3.10-1 [1.3.9-1] 3.39 MB fakeroot-1.8.4-1 [1.7.1-3] 0.06 MB glibc-2.7-6 [2.7-4] 10.78 MB glproto-1.4.9-1 [1.4.8-1] 0.02 MB hal-info-0.20071030-1 [0.20071011-1] 0.03 MB imagemagick-6.3.6.10-1 [6.3.6.6-1] 2.30 MB lib32-glibc-2.7-5 [2.6.1-2] 3.64 MB libarchive-2.4.0-1 [2.2.6-2] 0.32 MB libgphoto2-2.4.0-2 [2.3.1-3] 1.36 MB libmcs-0.6.0-1 [0.4.1-2] 0.02 MB libsamplerate-0.1.2-4 [0.1.2-3] 0.20 MB lincity-ng-1.1.2-1 [1.1.1-1] 29.16 MB lm_sensors-2.10.5-2 [2.10.5-1] 0.32 MB tcl-8.4.16-2 [8.4.16-1] 1.63 MB tk-8.4.16-2 [8.4.16-1] 1.40 MB ttf-dejavu-2.21-1 [2.20-1] 3.79 MB xf86-video-ati-6.7.195-3 [6.7.195-1] 3.67 MB xorg-server-1.4-5 [1.4-4] 7.25 MB xpdf-3.02_pl2-1 [3.02_pl1-1] 0.49 MB
Total Download Size: 73.64 MB Total Installed Size: 91.08 MB
Every package is printed on a new line, pkgname-pkgver-pkgrel, old pkgver-pkgname and size are separated with 2 spaces.
I was also thinking about using a very similar format to this when I initially created this patch. The reason I did not initially put it in a format like this is because I wanted to leave alone the way things were currently displayed and just add in the old version.
If I use this format, a couple of questions pop into my mind. What would happen if they just wanted to only enable ShowSize? Would it use the old format with the size in brackets and no separate line for each package? Would the above format only be used if both ShowSize and ShowOldVersion were enabled? What if only ShowOldVersion was enabled? Would each package be on its own line then as well?
I personally would prefer each package to always appear on its own line, whether or not ShowSize and/or ShowOldVersion were set to display. Of course, I am sure others would disagree with me since that is not the way it is currently set up.
I guess I'll chime in here since I haven't yet and I'm the one that merges your patch anyway. If the code looks OK (haven't looked yet), then I will merge this for now because it is optional, so it will not affect anyone that doesn't want to see this. We can worry about changing the format later.
Personally, I like less clutter, and moving each package to its own line when I am installing 60 packages would make my terminal scroll, which is not ideal. But thats just me. However, I would not be against some option to rectify this. Of course, we are going to reach the point soon where the output of this function is getting quite bloated, and will need a rewrite in order to keep it clean and well-organized with all these new output options.
Aaron, any thoughts?
-Dan
How about combining the two options into ShowTargetInfo (or whatever) which would display the target list in a tabular form using more information. lib32-gcc-libs New 4.2.2-2 1.05 MB audacious-player 1.3.2-4 1.4.0-1 1.07 MB audacious-plugins 1.3.5-5.1 1.4.0-2 1.68 MB I like the ShowSize option, but I do find it a bit messy. Displaying targets one per line would be best I think.
On Wed, Nov 14, 2007 at 11:38:45AM -0500, Nathan Jones wrote:
How about combining the two options into ShowTargetInfo (or whatever) which would display the target list in a tabular form using more information.
lib32-gcc-libs New 4.2.2-2 1.05 MB audacious-player 1.3.2-4 1.4.0-1 1.07 MB audacious-plugins 1.3.5-5.1 1.4.0-2 1.68 MB
I like the ShowSize option, but I do find it a bit messy. Displaying targets one per line would be best I think.
I like this suggestion. Exactly the same here, I already found ShowSize a bit messy, and the old version just made it worse :) And if the packages are going to be displayed one per line, better use all the available space.
Idézés Xavier <shiningxc@gmail.com>:
On Wed, Nov 14, 2007 at 11:38:45AM -0500, Nathan Jones wrote:
How about combining the two options into ShowTargetInfo (or whatever) which would display the target list in a tabular form using more information.
lib32-gcc-libs New 4.2.2-2 1.05 MB audacious-player 1.3.2-4 1.4.0-1 1.07 MB audacious-plugins 1.3.5-5.1 1.4.0-2 1.68 MB
I like the ShowSize option, but I do find it a bit messy. Displaying targets one per line would be best I think.
I like this suggestion. Exactly the same here, I already found ShowSize a bit messy, and the old version just made it worse :) And if the packages are going to be displayed one per line, better use all the available space. I also like this.
---------------------------------------------------- SZTE Egyetemi Könyvtár - http://www.bibl.u-szeged.hu This mail sent through IMP: http://horde.org/imp/
On Nov 14, 2007 10:38 AM, Nathan Jones <nathanj@insightbb.com> wrote:
On Wed, Nov 14, 2007 at 09:29:37AM -0600, Dan McGee wrote:
On Nov 14, 2007 9:09 AM, Justin Lampley <jrlampley@gmail.com> wrote:
Roman Kyrylych wrote:
I suggest this:
Remove: lib32-gcc
Total Removed Size: 0.00 MB
Targets: lib32-gcc-libs-4.2.2-2 [New] 1.05 MB audacious-player-1.4.0-1 [1.3.2-4] 1.07 MB audacious-plugins-1.4.0-2 [1.3.5-5.1] 1.68 MB eclipse-pydev-1.3.10-1 [1.3.9-1] 3.39 MB fakeroot-1.8.4-1 [1.7.1-3] 0.06 MB glibc-2.7-6 [2.7-4] 10.78 MB glproto-1.4.9-1 [1.4.8-1] 0.02 MB hal-info-0.20071030-1 [0.20071011-1] 0.03 MB imagemagick-6.3.6.10-1 [6.3.6.6-1] 2.30 MB lib32-glibc-2.7-5 [2.6.1-2] 3.64 MB libarchive-2.4.0-1 [2.2.6-2] 0.32 MB libgphoto2-2.4.0-2 [2.3.1-3] 1.36 MB libmcs-0.6.0-1 [0.4.1-2] 0.02 MB libsamplerate-0.1.2-4 [0.1.2-3] 0.20 MB lincity-ng-1.1.2-1 [1.1.1-1] 29.16 MB lm_sensors-2.10.5-2 [2.10.5-1] 0.32 MB tcl-8.4.16-2 [8.4.16-1] 1.63 MB tk-8.4.16-2 [8.4.16-1] 1.40 MB ttf-dejavu-2.21-1 [2.20-1] 3.79 MB xf86-video-ati-6.7.195-3 [6.7.195-1] 3.67 MB xorg-server-1.4-5 [1.4-4] 7.25 MB xpdf-3.02_pl2-1 [3.02_pl1-1] 0.49 MB
Total Download Size: 73.64 MB Total Installed Size: 91.08 MB
Every package is printed on a new line, pkgname-pkgver-pkgrel, old pkgver-pkgname and size are separated with 2 spaces.
I was also thinking about using a very similar format to this when I initially created this patch. The reason I did not initially put it in a format like this is because I wanted to leave alone the way things were currently displayed and just add in the old version.
If I use this format, a couple of questions pop into my mind. What would happen if they just wanted to only enable ShowSize? Would it use the old format with the size in brackets and no separate line for each package? Would the above format only be used if both ShowSize and ShowOldVersion were enabled? What if only ShowOldVersion was enabled? Would each package be on its own line then as well?
I personally would prefer each package to always appear on its own line, whether or not ShowSize and/or ShowOldVersion were set to display. Of course, I am sure others would disagree with me since that is not the way it is currently set up.
I guess I'll chime in here since I haven't yet and I'm the one that merges your patch anyway. If the code looks OK (haven't looked yet), then I will merge this for now because it is optional, so it will not affect anyone that doesn't want to see this. We can worry about changing the format later.
Personally, I like less clutter, and moving each package to its own line when I am installing 60 packages would make my terminal scroll, which is not ideal. But thats just me. However, I would not be against some option to rectify this. Of course, we are going to reach the point soon where the output of this function is getting quite bloated, and will need a rewrite in order to keep it clean and well-organized with all these new output options.
Aaron, any thoughts?
-Dan
How about combining the two options into ShowTargetInfo (or whatever) which would display the target list in a tabular form using more information.
lib32-gcc-libs New 4.2.2-2 1.05 MB audacious-player 1.3.2-4 1.4.0-1 1.07 MB audacious-plugins 1.3.5-5.1 1.4.0-2 1.68 MB
I like the ShowSize option, but I do find it a bit messy. Displaying targets one per line would be best I think.
VerboseTargetInfoList? Ha. Figure out something shorter along those lines and its good with me. +1 from me if anyone wants to whip this up. It would also keep us down to one option instead of having to worry about combinations of options. Be sure to update the manpage while you are at it. I'll hold off on merging the other patch, so feel free to make it against the current master. You'll have to figure out the column sizes somehow, not sure how that magic should work. And looking at Justin's original patch, make sure the "New" string is gettext-ed (and you don't make any assumptions about it only being 3 chars). His refactoring was also nice, although this will need to be a slightly different code layout. -Dan
Dan McGee wrote:
VerboseTargetInfoList? Ha. Figure out something shorter along those lines and its good with me.
+1 from me if anyone wants to whip this up. It would also keep us down to one option instead of having to worry about combinations of options. Be sure to update the manpage while you are at it. I'll hold off on merging the other patch, so feel free to make it against the current master.
You'll have to figure out the column sizes somehow, not sure how that magic should work. And looking at Justin's original patch, make sure the "New" string is gettext-ed (and you don't make any assumptions about it only being 3 chars). His refactoring was also nice, although this will need to be a slightly different code layout.
-Dan
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
First of all, attached is an update of the original patch with a possible bug correction. Initially I tried to take depends and such into account by checking if the data was NULL in the sync package. Turns out there is a much easier way, check the sync type for PM_SYNC_TYPE_UPGRADE (duh!), if it isn't an upgrade then assume it is new. This cleans up the code a bit, and I believe the other way might have had some instances where a non-upgrade would get through and garbage would be printed. I will try to take a stab at creating the columned output, but like Dan, I do not know exactly how I will get it to work, if someone else has a great idea, feel free to beat me to the implementation of this new output scheme.
On Nov 14, 2007 9:29 AM, Dan McGee <dpmcgee@gmail.com> wrote:
I guess I'll chime in here since I haven't yet and I'm the one that merges your patch anyway. If the code looks OK (haven't looked yet), then I will merge this for now because it is optional, so it will not affect anyone that doesn't want to see this. We can worry about changing the format later.
Personally, I like less clutter, and moving each package to its own line when I am installing 60 packages would make my terminal scroll, which is not ideal. But thats just me. However, I would not be against some option to rectify this. Of course, we are going to reach the point soon where the output of this function is getting quite bloated, and will need a rewrite in order to keep it clean and well-organized with all these new output options.
Aaron, any thoughts?
Heh, my only thoughts were "man, that sure is a lot of info crammed into a paragraph like that". But I see what you're saying about this function getting out of control with ShowSize, and this option, and maybe more later. I could probably throw some refactoring at display_targets to break it apart a little /me shrugs
participants (8)
-
Aaron Griffin
-
Dan McGee
-
Justin Lampley
-
Nagy Gabor
-
Nathan Jones
-
R. Dale Thomas
-
Roman Kyrylych
-
Xavier