Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 427982 - app-arch/rpm: please review prefix changes
Summary: app-arch/rpm: please review prefix changes
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Stanislav Ochotnicky (RETIRED)
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: prefix-gx86
  Show dependency tree
 
Reported: 2012-07-25 03:10 UTC by Christoph Junghans (RETIRED)
Modified: 2012-08-21 03:40 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for rpm-5.3.5.ebuild (rpm-5.3.5.ebuild.patch,1.81 KB, patch)
2012-07-25 03:10 UTC, Christoph Junghans (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Junghans (RETIRED) gentoo-dev 2012-07-25 03:10:25 UTC
Created attachment 319176 [details, diff]
patch for rpm-5.3.5.ebuild

trivial changes only.
Comment 1 Stanislav Ochotnicky (RETIRED) gentoo-dev 2012-07-26 07:39:22 UTC
Frankly. I haven't looked at rpm-5.x in a long time. It's a different upstream from rpm-4.x and should probably be moved to a separate package. And if we should unmask it (=app-arch/rpm-5* is hard-masked) we really would have to move it elsewhere so we don't trigger automatic updates for people on rpm-4.x

All that said, changes look OK so I applied them. Thanks.
Comment 2 Stanislav Ochotnicky (RETIRED) gentoo-dev 2012-07-26 07:51:35 UTC
One thing I noticed a bit too late though:

"${EROOT}"/usr/bin/rpm --initdb --root="${ROOT}"

Shouldn't the second ${ROOT} be ${EROOT} as well?
Comment 3 Fabian Groffen gentoo-dev 2012-07-26 08:36:18 UTC
that depends a lot on what it does with --root=xxxx

Frankly, I don't have a clue.
Comment 4 Stanislav Ochotnicky (RETIRED) gentoo-dev 2012-07-26 09:14:00 UTC
$ rpm --initdb --root /tmp/rpmroot  
$ ls -lR /tmp/rpmroot
/tmp/rpmroot:
total 4
drwxr-xr-x. 3 w0rm w0rm 4096 Jul 26 10:55 var

/tmp/rpmroot/var:
total 4
drwxr-xr-x. 3 w0rm w0rm 4096 Jul 26 10:55 lib

/tmp/rpmroot/var/lib:
total 4
drwxr-xr-x. 2 w0rm w0rm 4096 Jul 26 10:55 rpm

/tmp/rpmroot/var/lib/rpm:
total 104
-rw-r--r--. 1 w0rm w0rm  8192 Jul 26 10:55 Basenames
-rw-r--r--. 1 w0rm w0rm  8192 Jul 26 10:55 Conflictname
-rw-r--r--. 1 w0rm w0rm  8192 Jul 26 10:55 Dirnames
-rw-r--r--. 1 w0rm w0rm  8192 Jul 26 10:55 Group
-rw-r--r--. 1 w0rm w0rm  8192 Jul 26 10:55 Installtid
-rw-r--r--. 1 w0rm w0rm  8192 Jul 26 10:55 Name
-rw-r--r--. 1 w0rm w0rm  8192 Jul 26 10:55 Obsoletename
-rw-r--r--. 1 w0rm w0rm 12288 Jul 26 10:55 Packages
-rw-r--r--. 1 w0rm w0rm  8192 Jul 26 10:55 Providename
-rw-r--r--. 1 w0rm w0rm  8192 Jul 26 10:55 Requirename
-rw-r--r--. 1 w0rm w0rm  8192 Jul 26 10:55 Sha1header
-rw-r--r--. 1 w0rm w0rm  8192 Jul 26 10:55 Sigmd5
-rw-r--r--. 1 w0rm w0rm  8192 Jul 26 10:55 Triggername


So in other word, --root tells rpm where to create/look for directory structure of database. In any case, if you were able to install prefixed rpm and tried basically any command without errors this should be OK. It's initializing db only when EROOT=="/" so it most probably does not matter much (unless user is overriding ROOT I guess). FYI we moved rpm-5.x to rpm5/rpm-5.x so you can look for it there. Feel free to commit away as well, package is now maintainer-needed (app-arch/rpm )
Comment 5 Fabian Groffen gentoo-dev 2012-07-26 09:18:03 UTC
EROOT == "/" is almost the same as "system is not Prefix".  That check is wrong.

The question is, if rpm stores it's --prefix argument during compile (if it has one), and uses it when given a --root.  I think not, but it could happen.  If not, EROOT would be to be used as you pointed out yourself.

Let's reopen for the time being, because this seems to be messy.
Comment 6 Christoph Junghans (RETIRED) gentoo-dev 2012-07-26 14:54:40 UTC
I had an rpm db in my home on AIX (without gentoo prefix) a long time ago, hence I think nothing speaks against initializing such an db on prefix.

So the [[ $EROOT = "/" ]] check should go and the init command should be 'rpm --initdb --root="${EROOT}"'.

But what was the reason for having the [[ ${ROOT} == "/" ]] check in gx86 in the first place?
Comment 7 Fabian Groffen gentoo-dev 2012-07-26 14:58:34 UTC
[[ ${ROOT} == "/" ]]

is something entirely different, and makes sense in this case, the ROOT -> EROOT conversion doesn't hold for this one
Comment 8 Christoph Junghans (RETIRED) gentoo-dev 2012-07-26 15:28:09 UTC
(In reply to comment #7)
> [[ ${ROOT} == "/" ]]
> 
> is something entirely different, and makes sense in this case, the ROOT ->
> EROOT conversion doesn't hold for this one
So $ROOT != / would only be the case if we are not on the live file-system, right? Can that ever happens in prefix?
Comment 9 Christoph Junghans (RETIRED) gentoo-dev 2012-07-26 16:39:57 UTC
(In reply to comment #7)
> [[ ${ROOT} == "/" ]]
> is something entirely different, and makes sense in this case, the ROOT ->
> EROOT conversion doesn't hold for this one
Would '[[ ${ROOT} == "/" ]] || use prefix' do the job? Are we planning a stage3 for prefix soon?
Comment 10 Fabian Groffen gentoo-dev 2012-07-26 16:42:21 UTC
(In reply to comment #9)
> (In reply to comment #7)
> > [[ ${ROOT} == "/" ]]
> > is something entirely different, and makes sense in this case, the ROOT ->
> > EROOT conversion doesn't hold for this one
> Would '[[ ${ROOT} == "/" ]] || use prefix' do the job? Are we planning a
> stage3 for prefix soon?

huh?

Just [[ ${ROOT} == "/" ]] is fine.
Comment 11 Christoph Junghans (RETIRED) gentoo-dev 2012-07-26 17:37:20 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > (In reply to comment #7)
> > > [[ ${ROOT} == "/" ]]
> > > is something entirely different, and makes sense in this case, the ROOT ->
> > > EROOT conversion doesn't hold for this one
> > Would '[[ ${ROOT} == "/" ]] || use prefix' do the job? Are we planning a
> > stage3 for prefix soon?
> 
> Just [[ ${ROOT} == "/" ]] is fine.
You are right, I got myself confused.

To conclude it should be [[ ${ROOT} == / ]] and initdb --root="${EROOT}", right?
Comment 12 Fabian Groffen gentoo-dev 2012-07-26 17:41:38 UTC
yes

(although I didn't check if the initdb thing works correctly when used so)
Comment 13 Christoph Junghans (RETIRED) gentoo-dev 2012-08-21 03:40:44 UTC
Test on my amd64-linux and added to the ebuild.