You are not logged in.

#1 2009-04-30 09:32:31

ash
Member
Registered: 2008-12-17
Posts: 134

[half solved] re-packing an arch package - symlinks trouble

i took a package from extra

mkdir NewFolder

cp /var/cache/pacman/pkg/1.pkg.tr.gz ./

tar -xvzpf 1.pkg.tar.gz -C NewFolder

cd NewFolder

tar -cvzpf 2.pkg.tar.gz * .[a-zA-Z]*
# just tar -ing up everything again (without change) (.[a-zA-Z]* to include .PKGINFO etc)

pacman -Qip newpkg.tar.gz
# all output seems ok

pacman -Rd 1
# the installed package that worked

pacman -Ud 2.pkg.tar.gz
# application is broken now

the package 2 (made by just un-tar and tar back again package 1) is broken

i think it has something to do with symlinks being altered in some way

output of tar -tzf on the 2 packages is identical (except display order) (output of tar -tzf |sort is identical)

what is done wrong ?

Last edited by ash (2009-04-30 11:00:25)

Offline

#2 2009-04-30 09:42:50

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: [half solved] re-packing an arch package - symlinks trouble

Let's take a step back and ask what you're trying to achieve?

It seems like you may be going about things in an overly-complicated and convoluted fashion... smile

Offline

#3 2009-04-30 09:45:38

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [half solved] re-packing an arch package - symlinks trouble

Maybe have a look at bacman in the pacman-contrib package - it recreates installed packages, so it might give you some ideas.

Offline

#4 2009-04-30 09:50:56

ash
Member
Registered: 2008-12-17
Posts: 134

Re: [half solved] re-packing an arch package - symlinks trouble

i am trying to rename an existing package (xorg related) to prevent it from being updated in pacman -Syu

i want to hold this package (and some others) in a local mirror and include it in pacman - instead of ignorepkgs

to do this i edit the .PKGINFO inside the existing binary package

the problem exists with few packages only

if i just repack the package (without changing anything inside - not the pkginfo either) the new package still does not work

this makes me think that its somehow related to tar and symlinks

Offline

#5 2009-04-30 09:56:39

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

Re: [half solved] re-packing an arch package - symlinks trouble

Why don't you look in /usr/bin/makepkg and look for the exact command that makepkg uses:

bsdtar -czf pkgname-pkgver-pkgrel-arch.pkg.tar.gz .PKGINFO .INSTALL .CHANGELOG *

Of course, get rid of .INSTALL and .CHANGELOG if they are not in the package.

Offline

#6 2009-04-30 10:15:32

ash
Member
Registered: 2008-12-17
Posts: 134

Re: [half solved] re-packing an arch package - symlinks trouble

deleted all files from the previous try

mkdir NewFolder

cp /var/cache/pacman/pkg/1.pkg.tr.gz ./

bsdtar -xzf 1.pkg.tar.gz -C NewFolder

cd NewFolder

bsdtar -czf 2.pkg.tar.gz .INSTALL .PKGINFO *

pacman -Qip newpkg.tar.gz
# all output seems ok

pacman -Rd 1
# the installed package that worked

pacman -Ud 2.pkg.tar.gz
# the new package is still broken

Offline

#7 2009-04-30 10:24:04

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

Re: [half solved] re-packing an arch package - symlinks trouble

Give us the error message.

Offline

#8 2009-04-30 10:42:44

ash
Member
Registered: 2008-12-17
Posts: 134

Re: [half solved] re-packing an arch package - symlinks trouble

example 1

libdrm - when i install it

then every time i use pacman to un/install any other package

bash-3.2# pacman -Ud /home/ash/xorg14/xorg14-libdrm-2.3.1-2-i686.pkg.tar.gz
loading package data...
(1/1) checking for file conflicts                   [########################################################################################################################] 100%
(1/1) upgrading xorg14-libdrm                       [########################################################################################################################] 100%
/sbin/ldconfig: /usr/lib/libdrm.so.2 is not a symbolic link <------- ???

example 2

when i startx - from xorg.0.log

package is xserver-xorg

Fatal server error:
xf86OpenConsole: Cannot open /dev/tty0 (Permission denied)

(WW) xf86CloseConsole: KDSETMODE failed: Bad file descriptor
(WW) xf86CloseConsole: VT_GETMODE failed: Bad file descriptor
(WW) xf86OpenConsole: VT_GETSTATE failed: Bad file descriptor

Offline

#9 2009-04-30 11:00:01

ash
Member
Registered: 2008-12-17
Posts: 134

Re: [half solved] re-packing an arch package - symlinks trouble

i now tried to do the exact same as root and now the packages work and dont make pacman errors etc

(i checked and now 'chmod' permissions and links are done right)

but is there possibility that some files in the packages are not supposed to be owned by root ? (so that i add security trouble or something by packing the tar as root)

Offline

#10 2009-04-30 11:13:19

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

Re: [half solved] re-packing an arch package - symlinks trouble

Try:

fakeroot bsdtar -czf 2.pkg.tar.gz .INSTALL .PKGINFO *

Offline

#11 2009-04-30 12:00:54

u_no_hu
Member
Registered: 2008-06-15
Posts: 453

Re: [half solved] re-packing an arch package - symlinks trouble

ash wrote:

i am trying to rename an existing package (xorg related) to prevent it from being updated in pacman -Syu

i want to hold this package (and some others) in a local mirror and include it in pacman - instead of ignorepkgs

to do this i edit the .PKGINFO inside the existing binary package

the problem exists with few packages only

if i just repack the package (without changing anything inside - not the pkginfo either) the new package still does not work

this makes me think that its somehow related to tar and symlinks

Instead of a local mirror, create a local repo with these packages you want to hold, and put that as your first repo in pacman.conf . That is a much simpler and cleaner solution than editing .PKGINFO files and such IMHO.  And if you want to know if these files have been updated, just call pacman with another pacman.conf without that local repo.


Don't be a HELP VAMPIRE. Please search before you ask.

Subscribe to The Arch Daily News.

Offline

#12 2009-04-30 18:53:03

ash
Member
Registered: 2008-12-17
Posts: 134

Re: [half solved] re-packing an arch package - symlinks trouble

i want to rename all of xorg-packages-1.4 to xorg14-xorg-packages-1.4 so that i can just -S xorg14 or xorg depending on the box

i dont want too much the solution with just repo priority. it can lead to all kinds of pacman hell (which i allready had and dont want it again) + it requires making a repo for xorg only (while i have other stuff in my repo too)

thanks !

Offline

Board footer

Powered by FluxBB