FS#19860 - makepkg command line option to create gzip or xz files

Attached to Project: Pacman
Opened by ef (fredre) - Saturday, 19 June 2010, 06:27 GMT
Last edited by Allan McRae (Allan) - Monday, 11 April 2011, 04:15 GMT
Task Type Feature Request
Category makepkg
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version 3.3.3
Due in Version 4.0.0
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
makepkg should have options for producing .gz or .xz files. For example, makepkg -J (default) could produce .pkg.tar.xz, while makepkg -z could produce .pkg.tar.gz
This would be similar to the effects of editing PKGEXT= array in /etc/makepkg.conf.
Also, uncompressed tar files might also be useful option to avoid compression times, e.g. .pkg.tar

Reasons for feature:
Convenience and time-saving.
Consider a user building a large package from AUR, such as sage-mathematics-bin which is 3.4 gb. Compressing a file that size into xz could take a very long time and is generally not practical if the file is not going to be distributed. (see http://bbs.archlinux.org/viewtopic.php?pid=721137#p721137 )

Currently users can use PKGEXT='.pkg.tar.gz' in /etc/makepkg.conf to achieve this effect, but it is cumbersome having to change the config for each package.

Furthermore, as the PKGEXT config is not listed in the man pages, many users are likely unaware of it. A command line option would be listed in the man pages and would make the .gz feature more visible.
This task depends upon

Closed by  Allan McRae (Allan)
Monday, 11 April 2011, 04:15 GMT
Reason for closing:  Implemented
Additional comments about closing:  http://projects.archlinux.org/pacman.git /commit/?id=43dacceb
Comment by Nicolas Doualot (slubman) - Saturday, 19 June 2010, 07:26 GMT
The PKGEXT variable can be defined in the PKGBUILD, so you don't have to change the global setting.
Even setting the variable to .pkg.tar in the PKGBUILD works (with a warning), but you can still install the generated package with pacman.
Comment by Allan McRae (Allan) - Saturday, 19 June 2010, 07:51 GMT
  • Field changed: Attached to Project (Arch Linux → Pacman)
Please file pacman bugs in the pacman section.
Comment by xduugu (xduugu) - Saturday, 19 June 2010, 16:44 GMT
> Furthermore, as the PKGEXT config is not listed in the man pages, many users are likely unaware of it.
> A command line option would be listed in the man pages and would make the .gz feature more visible.

Actually, it is listed in makepkg.conf man page, but not documented. ;)

> PKGEXT, SRCEXT
> Do not touch these unless you know what you are doing.


> Currently users can use PKGEXT='.pkg.tar.gz' in /etc/makepkg.conf to achieve this effect,
> but it is cumbersome having to change the config for each package.

I don't understand what you mean by "change the config for each package". When you install arch, you change PKGEXT in makepkg.conf to gz and you're done for the next few years. Xz doesn't make much sense for packages that are not distributed.


> makepkg should have options for producing .gz or .xz files.

Since this is a feature that presumably won't be used often, I favor setting the PKGEXT variable from the commandline as it's already done for PKGDEST/SRCPKGDEST and SRCDEST:
PKGEXT=.tar.gz makepkg
Comment by Andres P (llanero) - Sunday, 20 June 2010, 00:14 GMT
@xduugu
> Since this is a feature that presumably won't be used often, I favor setting
> the PKGEXT variable from the commandline as it's already done for
> PKGDEST/SRCPKGDEST and SRCDEST
> PKGEXT=.tar.gz makepkg

Doesn't work.

makepkg doesn't treat PKGEXT as environmental:

$ echo PKGEXT=.pkg.tar.gz >> ~/.makepkg.conf
$ PKGEXT=.pkg.tar.xz makepkg >/dev/null
$ ls *.pkg.*
dwm-5.8.2-2-i686.pkg.tar.gz

On the other hand, {SRC,PKG}DEST does prioritize exported values.

PACMAN has the same inconsistency.
Comment by Dan McGee (toofishes) - Sunday, 20 June 2010, 02:11 GMT
-1 from me. Change it in the PKGBUILD like we do for some of our more essential packages in core (e.g. pacman, libfetch, libarchive).
Comment by xduugu (xduugu) - Monday, 21 June 2010, 09:31 GMT
@Andres:
Of course it doesn't work. I just said I would prefer an environment variable over wasting a commandline flag for this.
Comment by Allan McRae (Allan) - Wednesday, 30 June 2010, 13:21 GMT
I am -1 for a command line flag but allowing it to be overridden by environmental values would be fine with me.
Comment by Dan McGee (toofishes) - Wednesday, 12 January 2011, 05:31 GMT
These things don't patch themselves- if you guys want this to happen please submit a patch.
Comment by guido (qqqqqqqqq9) - Sunday, 16 January 2011, 12:45 GMT
You could use the --config-option to specify a different config-file which contains the modified options.
Comment by Ray (ataraxia) - Saturday, 26 March 2011, 01:37 GMT
This small patch allows PKGEXT and SRCEXT to be overridden by environmental values, such that you can now do:

PKGEXT=.pkg.tar.gz makepkg
SRCEXT=.pkg.tar.gz makepkg --source

to override these on the command line.
Comment by Allan McRae (Allan) - Saturday, 26 March 2011, 03:10 GMT
Thanks. Pushed to my working branch.

Loading...