Ticket #829 (closed defect: invalid)

Opened 1 year ago

Last modified 1 year ago

How to get current path in %pre script?

Reported by: tigey Assigned to: RpmTickets
Priority: major Milestone:
Component: rpm Version: RPM Development
Keywords: Cc:

Description

I have a spec like the below: %pre echo "starting to install.." if [ -f ${"PWD"}/%cert_file ]

then

echo "The cert file exists!"

else

echo "please input the path for cert file : " exec 6<&0 0</dev/tty read cert_path exec 0<&6 6<&- if [ -f $cert_path/% ]

then

echo "The specified file $cert_path/%cert_file exists"

cp $cert_path/% %

else

echo "The specified file $cert_path/%cert_file doesn't exist!" exit 1

fi

fi

for example, if I run thr rpm like: #pwd /tmp #ls test.cert test.rmp #rpm -i test.rmp please input the path for cert file :

So, obviously, the script in %pre cann't locate the test.cert, I did some test, I found ${"PWD"} is / rather than /tmp

I want to get the current path ( /tmp) which the test.rmp located, Can somebody help me out about this issue?

thanks in advance!

Change History

03/03/11 17:39:17 changed by pmatilai

  • status changed from new to closed.
  • resolution set to invalid.

This is a bug tracker, not a support forum. Questions such as this belong to the rpm user mailing list: http://lists.rpm.org/mailman/listinfo/rpm-list