Bug 194567 - [PATCH] sysutils/bsdadminscripts - distviper deletes all distfiles if /usr/ports is a symlink
Summary: [PATCH] sysutils/bsdadminscripts - distviper deletes all distfiles if /usr/...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-23 22:37 UTC by rwmaillists
Modified: 2014-11-07 22:54 UTC (History)
2 users (show)

See Also:


Attachments
Adds a -H to all uses of find(1) in distviper so symlinks are handled correctly (1.16 KB, patch)
2014-10-23 22:37 UTC, rwmaillists
no flags Details | Diff
bsdadminscripts.diff (7.11 KB, patch)
2014-10-26 18:51 UTC, Carlos J Puga Medina
cjpm: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description rwmaillists 2014-10-23 22:37:58 UTC
Created attachment 148596 [details]
Adds a -H to all uses of find(1) in distviper so symlinks are handled correctly

By default find(1) will not follow symlinks given on the command-line. There are several places in distviper where find is used without allowing for this. 

In particular in the default mode, if PORTSDIR is a link and DISTDIR isn't, then no distinfo files are found and all the distfiles are deleted. 

This can be fixed by either making sure that find is given directory names that end in a "/" or with the -H option.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-10-23 22:37:58 UTC
Maintainers CC'd
Comment 2 Carlos J Puga Medina 2014-10-26 18:51:12 UTC
Created attachment 148676 [details]
bsdadminscripts.diff

Patch attached with your modification.

Thanks
Comment 4 commit-hook freebsd_committer freebsd_triage 2014-11-07 22:53:43 UTC
A commit references this bug:

Author: pi
Date: Fri Nov  7 22:53:15 UTC 2014
New revision: 372302
URL: https://svnweb.freebsd.org/changeset/ports/372302

Log:
  sysutils/bsdadminscripts: fix distviper

  Adds a -H to all uses of find(1) in distviper so symlinks are handled
  correctly

  By default find(1) will not follow symlinks given on the command-line.
  There are several places in distviper where find is used without
  allowing for this.

  In particular in the default mode, if PORTSDIR is a link and DISTDIR
  isn't, then no distinfo files are found and all the distfiles are
  deleted.

  This can be fixed by either making sure that find is given directory
  names that end in a "/" or with the -H option.

  PR:		194567
  Submitted by:	rwmaillists@googlemail.com
  Approved by:	Carlos Jacobo Puga Medina <cpm@fbsd.es> (maintainer)

Changes:
  head/sysutils/bsdadminscripts/Makefile
  head/sysutils/bsdadminscripts/files/distviper.in
  head/sysutils/bsdadminscripts/pkg-plist
Comment 5 Kurt Jaeger freebsd_committer freebsd_triage 2014-11-07 22:54:10 UTC
Committed, thanks.