You are not logged in.

#1 2009-07-06 17:44:35

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

repo-add results in "corrupted" pkg file, every other time [SOLVED]

I got tired of my messy folder of home-built packages and decided to script everything so that what I makepkg-ed gets put into a custom local repository and installed from there.

I have PKGDEST in /etc/makepkg.conf set to /abs/packages.
I also have these lines in /etc/pacman.conf:

[custom]
Server = file:///abs/packages

In the directory /abs/packages, I have all the packages I've built so far, and I run:

sudo repo-add custom.db.tar.gz *.pkg.tar.gz

Everything looks good. Now when I go to some folder with a PKGBUILD in it, and type:

makepkg -fi

The resulting package files get moved directly to the packages folder. But (I think) repo-add isn't run. So my script prompts me whether to run it, and if I confirm, it runs:

sudo repo-add custom.db.tar.gz $NEWLY_BUILT_PACKAGE_FILE

which seems to work with no problems. However, if I then type:

sudo pacman -Sy custom/$NEWLY_BUILT_PACKAGE_NAME

then, seemingly every other time, I get this error:

Proceed with installation? [Y/n] y
checking package integrity...
:: File dzen2-0.8.5-4-i686.pkg.tar.gz is corrupted. Do you want to delete it? [Y/n] n
error: failed to commit transaction (invalid or corrupted package)
dzen2-0.8.5-4-i686.pkg.tar.gz is invalid or corrupted
Errors occurred, no packages were upgraded.

What gives? So far as I can tell, neither the custom.db.tar.gz file nor the newly built package file is really corrupted: at least, I can "tar -tf" it just fine. And if I tell pacman yes, delete the package---then although it looks like the package still appears in the custom.db.tar.gz file---repeating this whole procedure seems to work fine.

I tried doing a repo-remove before the repo-add to see if that would clean things up, but doesn't seem to help.

I also tried "rm -rf /var/lib/pacman/sync/custom/$NEWLY_BUILT_PACKAGE_NAME-$VERSION", before doing the:

sudo pacman -Sy custom/$NEWLY_BUILT_PACKAGE_NAME

but that doesn't help either.

I've only encountered this problem when trying to add a package with the same version number as one already existing in the repo. That's not the normal course of things, admitted. But I'd like to know what's going wrong here so that I can figure out whether I'm making some mistake that will affect me in the normal course of things, too.

Last edited by Profjim (2009-07-06 18:37:45)

Offline

#2 2009-07-06 18:23:17

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

Re: repo-add results in "corrupted" pkg file, every other time [SOLVED]

Profjim wrote:

I've only encountered this problem when trying to add a package with the same version number as one already existing in the repo. That's not the normal course of things, admitted. But I'd like to know what's going wrong here so that I can figure out whether I'm making some mistake that will affect me in the normal course of things, too.

because your custom package has the same name than the official one, pacman will find the official package in your local cache (/var/cache/pacman/pkg), which is different than your custom one, so it complains.


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

Offline

#3 2009-07-06 18:37:17

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: repo-add results in "corrupted" pkg file, every other time [SOLVED]

Thanks shining, that's it.

Offline

Board footer

Powered by FluxBB