You are not logged in.

#1 2014-03-18 23:47:59

Deciare
Member
From: UTC -8:00
Registered: 2005-05-05
Posts: 79

remakepkg - Convert installed packages back into installable archives

This is a script to convert a package that has already been installed, back into an installable package file. It takes modified files (as reported by pacman -Qqkk) into account, and will regenerate the mtree entries corresponding to those files, if the original package had an mtree.

I've been searching for an utility like this, and didn't find it. If I am entirely mistaken and such a thing does already exist, please point me in its direction. Thank you!


Why would I possibly want this?

The creation of this script was inspired by 2 incidents.

1. wine-silverlight takes about 2 hours to build from AUR on my desktop computer. The package file was automatically deleted after installation. And then I realised, my netbook has the same architecture, but the package file was already gone, so I had to build it again.

2. While troubleshooting an issue with font rendering, I had to flip between freetype2-infinality and freetype2 a few times to isolate the problem. It would have been nice if I only had to build freetype2-infinality from AUR once.


Limitations

This script is unable to guess information that is not present pacman's local database. For example, the .PKGINFO file produced by the script will not have any makepkgopt entries.

I also do not have a perfect understanding of pacman's package format, and you may encounter errors resulting from omissions or misunderstandings on my part, or changes to pacman.



Well, that's everything. I hope this helps someone!

AUR: https://aur.archlinux.org/packages/remakepkg/
Github: https://github.com/deciare/remakepkg

Last edited by Deciare (2014-03-19 00:14:43)

Offline

#2 2014-03-18 23:52:07

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: remakepkg - Convert installed packages back into installable archives

Have you tried bacman?

$ bacman -h
This program recreates a package using pacman's db and system files
Usage:   bacman [--nocolor] <installed package name>
Example: bacman kernel26

Offline

#3 2014-03-19 00:05:17

GSF1200S
Member
Registered: 2008-12-24
Posts: 474

Re: remakepkg - Convert installed packages back into installable archives

Never heard of bacman. Ive been using repacman-en, but that still puts it in .tar.gz format. I think ill try both the OPs and bacman...

Thanks for the contribution OP smile

Offline

#4 2014-03-19 00:07:17

Deciare
Member
From: UTC -8:00
Registered: 2005-05-05
Posts: 79

Re: remakepkg - Convert installed packages back into installable archives

I hadn't the slightest idea bacman existed. Probably should have asked outright instead of just Googling. Thank you!

At least the making of this script was educational.

Offline

#5 2014-03-19 00:12:11

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: remakepkg - Convert installed packages back into installable archives

Offline

#6 2014-03-19 00:28:08

Deciare
Member
From: UTC -8:00
Registered: 2005-05-05
Posts: 79

Re: remakepkg - Convert installed packages back into installable archives

Just found that when not running as root/sudo, file ownership in the output package is broken. I need to learn how to use fakeroot...

Edit: And fixed.

Last edited by Deciare (2014-03-19 00:44:00)

Offline

#7 2014-03-19 01:04:24

GSF1200S
Member
Registered: 2008-12-24
Posts: 474

Re: remakepkg - Convert installed packages back into installable archives

Deciare wrote:

I hadn't the slightest idea bacman existed. Probably should have asked outright instead of just Googling. Thank you!

At least the making of this script was educational.

Neither did I. I went to the package search and then the AUR looking for it after he mentioned it- then I realize its with pacman.

Offline

#8 2014-03-19 01:09:58

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: remakepkg - Convert installed packages back into installable archives

pkgfile FTW :-)

Offline

#9 2014-03-19 01:17:22

Deciare
Member
From: UTC -8:00
Registered: 2005-05-05
Posts: 79

Re: remakepkg - Convert installed packages back into installable archives

karol wrote:

pkgfile FTW :-)

Oh, that does something I've been wanting very much. You're a veritable fountain of information.

Offline

#10 2014-03-19 01:22:25

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: remakepkg - Convert installed packages back into installable archives

bacman is a niche application, but pkgfile is in the FAQ: https://wiki.archlinux.org/index.php/FA … ge_is_X.3F and even has its own wiki page: https://wiki.archlinux.org/index.php/Pkgfile
It's also mentioned in https://wiki.archlinux.org/index.php/Pa … _databases

Offline

#11 2014-03-19 01:36:51

GSF1200S
Member
Registered: 2008-12-24
Posts: 474

Re: remakepkg - Convert installed packages back into installable archives

karol wrote:

pkgfile FTW :-)

I did know about that. I simply assumed it was in the repos or AUR and went there first tongue

Offline

#12 2014-03-19 10:07:44

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: remakepkg - Convert installed packages back into installable archives

Deciare wrote:
Why would I possibly want this?

The creation of this script was inspired by 2 incidents.

1. wine-silverlight takes about 2 hours to build from AUR on my desktop computer. The package file was automatically deleted after installation. And then I realised, my netbook has the same architecture, but the package file was already gone, so I had to build it again.

2. While troubleshooting an issue with font rendering, I had to flip between freetype2-infinality and freetype2 a few times to isolate the problem. It would have been nice if I only had to build freetype2-infinality from AUR once

I just edit /etc/makepkg.conf and set the PKGDEST variable.
This way I always have a copy of my built packages in case I need to reinstall or use on a different machine.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#13 2014-03-19 11:37:20

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,500
Website

Re: remakepkg - Convert installed packages back into installable archives

Or...  you could use a less shitty AUR builder.

Offline

#14 2014-03-19 20:47:07

GSF1200S
Member
Registered: 2008-12-24
Posts: 474

Re: remakepkg - Convert installed packages back into installable archives

slithery wrote:
Deciare wrote:
Why would I possibly want this?

The creation of this script was inspired by 2 incidents.

1. wine-silverlight takes about 2 hours to build from AUR on my desktop computer. The package file was automatically deleted after installation. And then I realised, my netbook has the same architecture, but the package file was already gone, so I had to build it again.

2. While troubleshooting an issue with font rendering, I had to flip between freetype2-infinality and freetype2 a few times to isolate the problem. It would have been nice if I only had to build freetype2-infinality from AUR once

I just edit /etc/makepkg.conf and set the PKGDEST variable.
This way I always have a copy of my built packages in case I need to reinstall or use on a different machine.

Only issue with that is that the config files will be default. By using remakepkg or bacman it takes the existing config file and rolls it into the package.

**EDIT** Well actually, thats because I elect to have pacman ditch the config files whenever I remove something. I usually remove something with -Rcsn options a pay close attention to what it says it will remove..

Last edited by GSF1200S (2014-03-19 20:50:17)

Offline

Board footer

Powered by FluxBB