Bug 170784 - [bsd.port.mk] [patch] resolve symlinks in PREFIX on deinstall
Summary: [bsd.port.mk] [patch] resolve symlinks in PREFIX on deinstall
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Bryan Drewery
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-20 14:50 UTC by Pietro Cerutti
Modified: 2014-10-01 07:48 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (594 bytes, patch)
2012-08-20 14:50 UTC, Pietro Cerutti
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pietro Cerutti freebsd_committer freebsd_triage 2012-08-20 14:50:06 UTC
The deinstall target checks whether PREFIX equals the cwd registered at install time, but fails to resolve symlinks.

Fix: Patch attached with submission follows:
How-To-Repeat: mkdir -p /usr/tmp/prefix
ln -sf prefix /usr/tmp/link
sudo make -C /usr/ports/audio/etcd (whatever) install deinstall

===>  Deinstalling for audio/etcd
===>   etcd-1.0.1 has a different PREFIX: /usr/tmp/prefix, skipping
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-08-20 14:50:17 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

bsd.port.mk is portmgr territory (via the GNATS Auto Assign Tool)
Comment 2 Beat Gaetzi freebsd_committer freebsd_triage 2012-08-22 10:32:38 UTC
Responsible Changed
From-To: portmgr->beat

Take for exp-run.
Comment 3 Beat Gaetzi freebsd_committer freebsd_triage 2012-08-30 16:34:22 UTC
State Changed
From-To: open->closed

Committed. Thanks!
Comment 4 TAKATSU Tomonari freebsd_committer freebsd_triage 2012-09-01 15:48:14 UTC
/usr/bin/readlink does not have option -f but /usr/local/bin/readlink which is
installed from ports/sysutils/readlink has it.
readlink: illegal option -- f error occurred in the following procedure.

# cd /usr/ports
# svn up
# ident Mk/bsd.port.mk
Mk/bsd.port.mk:
     $FreeBSD: head/Mk/bsd.port.mk 303381 2012-08-30 15:31:25Z beat $
     $NetBSD: $
     $entry: category $
# mkdir -p /usr/tmp/prefix
# ln -s /usr/tmp/prefix /usr/tmp/link
# make -C /usr/ports/audio/etcd PREFIX=/usr/tmp/link install deinstall
===>  Installing for etcd-1.0.1
===>   etcd-1.0.1 depends on shared library: SDL-1.2.11 - found
===>   Generating temporary packing list
===>  Checking if audio/etcd already installed
install  -s -o root -g wheel -m 555
/usr/ports/audio/etcd/work/etcd-1.0.1/etcd /usr/tmp/link/bin/
===>   Registering installation for etcd-1.0.1
===>  Deinstalling for audio/etcd
readlink: illegal option -- f
usage: readlink [-n] [file ...]
===>   etcd-1.0.1 has a different PREFIX: /usr/tmp/link, skipping

Please see also
http://docs.freebsd.org/cgi/mid.cgi?201208311007.q7VA7WrN066173 .

Thanks,

-- 
TAKATSU Tomonari
Comment 5 Garrett Cooper 2012-09-05 22:09:05 UTC
FreeBSD 7.4 fails to grok readlink -f as well:

===>  Deinstalling for benchmarks/netperf
readlink: illegal option -- f
usage: readlink [-n] [file ...]
===>   netperf-2.5.0_2 has a different PREFIX: /usr/local, skipping
===>  Installing for netperf-2.6.0
===>   Generating temporary packing list
===>  Checking if benchmarks/netperf already installed
===>   An older version of benchmarks/netperf is already installed
(netperf-2.5.0_2)
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of benchmarks/netperf
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** Error code 1

Stop in /usr/ports/benchmarks/netperf.
*** Error code 1

Stop in /usr/ports/benchmarks/netperf.
# uname -a
FreeBSD  7.4-STABLE FreeBSD 7.4-STABLE #0: Fri Aug 24 15:41:28 UTC
2012     root@bf049.west.isilon.com:/usr/obj/mnt/freebsd/stable/7/sys/ISI-GENERIC
 amd64
# readlink --help
readlink: illegal option -- -
usage: readlink [-n] [file ...]
Comment 6 Pietro Cerutti freebsd_committer freebsd_triage 2012-09-06 07:31:34 UTC
Thanks Takatsu, Garrett,

this has been backed off for now..

-- 
Pietro Cerutti
The FreeBSD Project
gahr@FreeBSD.org

PGP Public Key:
http://gahr.ch/pgp
Comment 7 Beat Gaetzi freebsd_committer freebsd_triage 2012-09-06 07:55:08 UTC
State Changed
From-To: closed->open

Change has been backed out with r303524. Pietro, do you like to have 
another look at it? 


Comment 8 Beat Gaetzi freebsd_committer freebsd_triage 2012-09-06 07:55:08 UTC
Responsible Changed
From-To: beat->gahr

Change has been backed out with r303524. Pietro, do you like to have 
another look at it?
Comment 9 Pietro Cerutti freebsd_committer freebsd_triage 2012-11-02 11:33:26 UTC
Responsible Changed
From-To: gahr->portmgr

An alternative solution has been suggested, back to portmgr@
Comment 10 Bryan Drewery freebsd_committer freebsd_triage 2013-08-30 03:25:55 UTC
Responsible Changed
From-To: portmgr->bdrewery

I'll take it.
Comment 11 Carlo Strub freebsd_committer freebsd_triage 2014-09-14 10:43:16 UTC
Is this PR still relevant?
Comment 12 Pietro Cerutti freebsd_committer freebsd_triage 2014-10-01 07:48:30 UTC
Nah, let's get rid of it.