Bug 211623 - [PATCH] Mk/Scripts/do-fetch fails when DISTDIR is symlink
Summary: [PATCH] Mk/Scripts/do-fetch fails when DISTDIR is symlink
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Port Management Team
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-08-06 11:34 UTC by Harald Schmalzbauer
Modified: 2016-08-08 12:57 UTC (History)
1 user (show)

See Also:


Attachments
Patch do-fetch.sh to do mkdir DISTDIR only if onexistant (350 bytes, patch)
2016-08-06 11:34 UTC, Harald Schmalzbauer
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Schmalzbauer 2016-08-06 11:34:35 UTC
Created attachment 173355 [details]
Patch do-fetch.sh to do mkdir DISTDIR only if onexistant

In do-fetch.sh, there's a unconditional 'mkdir -p "${dp_DISTDIR}"'
This doesn't work if ${DISTDIR} exists and is a symbolic link.
I'm not aware of problems with DISTDIR beeing a symlink, so here's a patch which only does 'mkdir' if DISTDIR doesn't exist at all – no checks for read/write permissions suitable at that point, nor if the link is dead.
Further check's shouldn't be affected, if there are any in place (long time ago I included own Makefiles doing such checks because they were missing at that time – haven't checked if that changed during the last 5 years)
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-08-08 12:57:52 UTC
A commit references this bug:

Author: mat
Date: Mon Aug  8 12:57:34 UTC 2016
New revision: 419840
URL: https://svnweb.freebsd.org/changeset/ports/419840

Log:
  Only try to create DISTDIR if it does not exist already.

  It turns out, some people, instead of setting DISTDIR, replace it with a
  symlink pointing to where DISTDIR should be pointing.

  And mkdir -p <symlink> fails.

  PR:		211623
  Reported by:	Harald Schmalzbauer
  Sponsored by:	Absolight

Changes:
  head/Mk/Scripts/do-fetch.sh