why hardcode RPM_DIR values for OSes in ostype.pm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In trying to build RPMs for LIO in a portable, non-privileged (one
should never "make" as root and all that) manner I have been running
up against the hard-coded definition of $rval->{RPM_DIR} in ostype.pm.

I wonder why that file bothers to try to hard-code the expected value
of RPM's "%_topdir" rather than just asking it such as:

    chomp($rval->{RPM_DIR}=`rpm --eval '%_topdir'`);

This has the added benefit of allowing a user or build farm machine
even to define it's own environment in it's ~/.rpmmacros file.

Is it the intention of ostype.pm to try to hardcode the RPM_DIR value
or is it just providing the value that is expected by default on each
OS and therefore the code above would be better suited?

I have been able to prove that the above works with the following patch
to ostype.pm and then running "make clean kernel_rpms" which I can even
do as my own non-root account since I have in ~/.rpmmacros:

%_topdir /home/brian/rpmbuild3/

and the resulting RPMs are, unsurprisingly, in /home/brian/rpmbuild3/RPMS/x86_64/:

$ ls -l /home/brian/rpmbuild3/RPMS/x86_64/
total 2492
-rw-r--r-- 1 brian intel 1323220 Oct 10 16:48 iscsi_target_mod-2.6.32-279.1.1.el6.x86_64-3.5.3-b4633dac.x86_64.rpm
-rw-r--r-- 1 brian intel 1223872 Oct 10 16:48 target_core_mod-2.6.32-279.1.1.el6.x86_64-3.5.3-b4633dac.x86_64.rpm

May I submit a more general patch that gets rid of all of the
$rval->{RPM_DIR}= assignments and replace them all with a single call
to "rpm --eval '%_topdir'" as I have done above?  I'd be happy to
submit it if my understanding of the itention of ostype.pm is correct
in this regard.

Cheers,
b.


Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux