Bug 683011 - package symlinks in repos should be relative
Summary: package symlinks in repos should be relative
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: Sprint 21
Assignee: John Matthews
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: 563609 verified-to-close
TreeView+ depends on / blocked
 
Reported: 2011-03-08 10:18 UTC by Daniel Mach
Modified: 2011-08-16 12:22 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-16 12:11:28 UTC
Embargoed:


Attachments (Terms of Use)

Description Daniel Mach 2011-03-08 10:18:33 UTC
symlinks in repos point to the absolute path to a package:
zlib-1.2.3-3.x86_64.rpm
->
/var/lib/pulp//packages/zlib/1.2.3/3/x86_64/eb6/zlib-1.2.3-3.x86_64.rpm

This mean that syncing content under different root other than /var/lib/pulp won't work.

Can you re-work linking to use relative paths instead?
/var/lib/pulp/repos/<repo>/zlib-1.2.3-3.x86_64.rpm
->
../../packages/zlib/1.2.3/3/x86_64/eb6/zlib-1.2.3-3.x86_64.rpm

Comment 1 John Matthews 2011-03-08 14:35:57 UTC
To clarify, the perspective of this bug is from the CDN use case where the content is copied somewhere else.  For that case it's important the symlinks are relative.

Comment 2 John Matthews 2011-03-08 21:29:02 UTC
Here is an example of what the links look like now:

 /var/lib/pulp/repos/repo_resync_a/pulp-test-package-0.3.1-1.fc11.x86_64.rpm -> ../../packages/pulp-test-package/0.3.1/1.fc11/x86_64/6bc/pulp-test-package-0.3.1-1.fc11.x86_64.rpm




Requires grinder 0.85

Related pulp commits are below:
http://git.fedorahosted.org/git/?p=pulp.git;a=commitdiff;h=545f47fc4da098e8ceca09555084e755a5b8646a

http://git.fedorahosted.org/git/?p=pulp.git;a=commitdiff;h=c82616b88f7c4b8ea6ab6936fb52dd3645e8ff84

Comment 3 Jeff Ortel 2011-03-09 02:01:10 UTC
build: 0.146

Comment 4 John Matthews 2011-03-10 05:35:54 UTC
Moving back to MODIFIED.

I didn't fix the case when we call add_package from the API.  I only addressed this from the sync perspective.

Will have this fix 3/10/11

Comment 5 John Matthews 2011-03-10 14:57:21 UTC
Fixed case of 'add_packages'.
All usage of symlink in pulp will create relative links.

Commit:
http://git.fedorahosted.org/git/?p=pulp.git;a=commitdiff;h=45fbca1543d8a09729afff8fbc8bf9694783f7d0


QE Test:
1) local sync
2) yum sync
3) add_packages

Verify that under /var/lib/pulp/
all new symlinks created are relative
If you see any links that aren't fail this bug and add a comment please with details.

Look under /var/lib/pulp/published as well as /var/lib/pulp/repos

Comment 6 Jeff Ortel 2011-03-10 16:39:33 UTC
Build: 0.147

Comment 7 Preethi Thomas 2011-03-11 16:17:57 UTC
From the yum repo


[root@hp-ml370g4-01 ~]# ls -l /var/lib/pulp/repos/repos/pulp/pulp/testing/fedora-14/x86_64/
total 180
-rw-r--r-- 1 apache apache     0 Mar 11 10:48 cachecookie
-rw-r--r-- 1 apache apache  5028 Mar 10 11:26 filelists.xml.gz
lrwxrwxrwx 1 apache apache    87 Mar 11 10:48 gofer-0.20-1.fc14.noarch.rpm -> ../../../../../../../packages/gofer/0.20/1.fc14/noarch/775/gofer-0.20-1.fc14.noarch.rpm
lrwxrwxrwx 1 apache apache    95 Mar 11 10:48 grinder-0.0.86-1.fc14.noarch.rpm -> ../../../../../../../packages/grinder/0.0.86/1.fc14/noarch/816/grinder-0.0.86-1.fc14.noarch.rpm


From the local repo


[root@hp-ml370g4-01 ~]# ls -l /var/lib/pulp/repos/local-repo1/
total 96
drwxr-sr-x 2 apache apache 4096 Mar 11 10:54 drpms
lrwxrwxrwx 1 apache apache   72 Mar 11 10:54 gofer-0.20-1.fc14.noarch.rpm -> ../../packages/gofer/0.20/1.fc14/noarch/775/gofer-0.20-1.fc14.noarch.rpm
lrwxrwxrwx 1 apache apache   80 Mar 11 10:54 grinder-0.0.86-1.fc14.noarch.rpm -> ../../packages/grinder/0.0.86/1.fc14/noarch/816/grinder-0.0.86-1.fc14.noarch.rpm

From a upload repo with add_package

[root@hp-ml370g4-01 upload]# ls -l /var/lib/pulp/repos/upload/
total 16
lrwxrwxrwx 1 apache apache  110 Mar 11 11:15 kalpana-0.1.30-1.git.26.0642cff.fc14.noarch.rpm -> ../../packages/kalpana/0.1.30/1.git.26.0642cff.fc14/noarch/b39/kalpana-0.1.30-1.git.26.0642cff.fc14.noarch.rpm
drwxr-sr-x 2 apache apache 4096 Mar 11 11:15 repodata
[root@hp-ml370g4-01 upload]#

Comment 8 Preethi Thomas 2011-03-11 16:23:56 UTC
[root@hp-ml370g4-01 upload]# pulp-admin repo  add_package --id=upload -p gofer-0.20-1.fc14.noarch.rpm --source=local-repo1 

Following dependencies are suggested. ['python-gofer-0.20-1.fc14.noarch.rpm', 'gofer-0.20-1.fc14.noarch.rpm'] 
Would you like us to add these?(Y/N/Q):y
Successfully added packages ['gofer-0.20-1.fc14.noarch', 'python-gofer-0.20-1.fc14.noarch', 'gofer-0.20-1.fc14.noarch'] to repo [upload].

[root@hp-ml370g4-01 upload]# 
[root@hp-ml370g4-01 upload]# 
[root@hp-ml370g4-01 upload]# 
[root@hp-ml370g4-01 upload]# ls -l /var/lib/pulp/repos/upload/total 32
lrwxrwxrwx 1 apache apache   72 Mar 11 11:23 gofer-0.20-1.fc14.noarch.rpm -> ../../packages/gofer/0.20/1.fc14/noarch/942/gofer-0.20-1.fc14.noarch.rpm
lrwxrwxrwx 1 apache apache  110 Mar 11 11:15 kalpana-0.1.30-1.git.26.0642cff.fc14.noarch.rpm -> ../../packages/kalpana/0.1.30/1.git.26.0642cff.fc14/noarch/b39/kalpana-0.1.30-1.git.26.0642cff.fc14.noarch.rpm
lrwxrwxrwx 1 apache apache   86 Mar 11 11:23 python-gofer-0.20-1.fc14.noarch.rpm -> ../../packages/python-gofer/0.20/1.fc14/noarch/e35/python-gofer-0.20-1.fc14.noarch.rpm
drwxr-sr-x 2 apache apache 4096 Mar 11 11:23 repodata

Comment 9 Preethi Thomas 2011-03-11 16:34:12 UTC
verified

results in above 2 comments

[root@hp-ml370g4-01 upload]# rpm -q pulp
pulp-0.0.147-1

Comment 10 Preethi Thomas 2011-08-16 12:11:28 UTC
Closing with Community Release 15

pulp-0.0.223-4.

Comment 11 Preethi Thomas 2011-08-16 12:22:57 UTC
Closing with Community Release 15

pulp-0.0.223-4.


Note You need to log in before you can comment on or make changes to this bug.