NetBSD Problem Report #39271

From smb@cs.columbia.edu  Sat Aug  2 13:28:41 2008
Return-Path: <smb@cs.columbia.edu>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 3DEBA63B975
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  2 Aug 2008 13:28:41 +0000 (UTC)
Message-Id: <20080802132835.85D418388F0@yellowstone.machshav.com>
Date: Sat,  2 Aug 2008 09:28:35 -0400 (EDT)
From: smb@cs.columbia.edu
Reply-To: smb@cs.columbia.edu
To: gnats-bugs@gnats.NetBSD.org
Subject: rcd_scripts don't work if names match package directory
X-Send-Pr-Version: 3.95

>Number:         39271
>Category:       pkg
>Synopsis:       rcd_scripts don't work if names match package directory
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 02 13:30:00 +0000 2008
>Closed-Date:    Mon Aug 10 05:51:47 +0000 2015
>Last-Modified:  Mon Aug 10 05:51:47 +0000 2015
>Originator:     Steven M. Bellovin
>Release:        NetBSD 4.99.59
>Organization:
Department of Computer Science, Columbia University
>Environment:


System: NetBSD yellowstone.machshav.com 4.99.59 NetBSD 4.99.59 (YELLOWSTONE) #10: Fri Jun 6 15:51:05 EDT 2008 smb@yellowstone.machshav.com:/usr/BUILD/obj/sys/arch/amd64/compile/YELLOWSTONE amd64
Architecture: x86_64
Machine: amd64
>Description:
	When processing RCD_SCRIPTS, the files are copied to
	${WRKDIR}.  If, however, the script name matches ${PKGBASE} -- quite
	normal in many cases -- and the source tarball doesn't have a
	version name attached to its top-level directory (or indeed
	doesn't have a top-level direcotry at all, per pkgsrc.txt),
	this copy won't do the right thing, and the rc.d file won't get
	installed.
>How-To-Repeat:
	See above.
>Fix:
	The proper fix, I suspect, is for there to be another . subdirectory
	of ${WRKDIR} to hold the rc.d files.  (N.B. I suspect this
	can happen with other files staged to ${WRKDIR}.)  What I've
	done temporarily is have a post-extract rule to rename to
	extract directory to ${DISTNAME}.

>Release-Note:

>Audit-Trail:
From: "Jeremy C. Reed" <reed@reedmedia.net>
To: gnats-bugs@NetBSD.org
Cc: smb@cs.columbia.edu
Subject: Re: pkg/39271: rcd_scripts don't work if names match package directory
Date: Sat, 2 Aug 2008 10:05:46 -0500 (CDT)

 The following worked for me for the package you sent me. (Be sure to add 
 entry to PLIST too.) Just added a unique suffix to filename for the copy 
 in the work directory.

 Index: mk/pkginstall/bsd.pkginstall.mk
 ===================================================================
 RCS file: /cvsroot/pkgsrc/mk/pkginstall/bsd.pkginstall.mk,v
 retrieving revision 1.46
 diff -u -r1.46 bsd.pkginstall.mk
 --- mk/pkginstall/bsd.pkginstall.mk	4 Mar 2008 06:51:41 -0000	1.46
 +++ mk/pkginstall/bsd.pkginstall.mk	2 Aug 2008 15:04:09 -0000
 @@ -1135,7 +1135,7 @@

  .for _script_ in ${RCD_SCRIPTS}
  RCD_SCRIPT_SRC.${_script_}?=	${FILESDIR}/${_script_}.sh
 -RCD_SCRIPT_WRK.${_script_}?=	${WRKDIR}/${_script_}
 +RCD_SCRIPT_WRK.${_script_}?=	${WRKDIR}/${_script_}.rc.d-script

  .  if !empty(RCD_SCRIPT_SRC.${_script_})
  generate-rcd-scripts: ${RCD_SCRIPT_WRK.${_script_}}

From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/39271: rcd_scripts don't work if names match package
	directory
Date: Sat, 2 Aug 2008 22:53:48 +0200

 On Sat, Aug 02, 2008 at 03:10:03PM +0000, Jeremy C. Reed wrote:
 >  The following worked for me for the package you sent me. (Be sure to add 
 >  entry to PLIST too.) Just added a unique suffix to filename for the copy 
 >  in the work directory.

 I'd prefer if we don't obscure the file name for a single package that
 failed so far.

 Joerg

From: "Steven M. Bellovin" <smb@cs.columbia.edu>
To: gnats-bugs@NetBSD.org
Cc: joerg@britannica.bec.de, pkg-manager@NetBSD.org, gnats-admin@NetBSD.org,
 pkgsrc-bugs@NetBSD.org
Subject: Re: pkg/39271: rcd_scripts don't work if names match package
 directory
Date: Sat, 2 Aug 2008 21:38:02 -0400

 On Sat,  2 Aug 2008 20:55:04 +0000 (UTC)
 Joerg Sonnenberger <joerg@britannica.bec.de> wrote:

 > The following reply was made to PR pkg/39271; it has been noted by
 > GNATS.
 > 
 > From: Joerg Sonnenberger <joerg@britannica.bec.de>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: pkg/39271: rcd_scripts don't work if names match package
 > 	directory
 > Date: Sat, 2 Aug 2008 22:53:48 +0200
 > 
 >  On Sat, Aug 02, 2008 at 03:10:03PM +0000, Jeremy C. Reed wrote:
 >  >  The following worked for me for the package you sent me. (Be sure
 >  > to add entry to PLIST too.) Just added a unique suffix to filename
 >  > for the copy in the work directory.
 >  
 >  I'd prefer if we don't obscure the file name for a single package
 > that failed so far.
 >  
 I have several work-arounds, but the problem is not improbable and it
 cost me ~4 hours work trying to figure out what was wrong.  In other
 words, I don't need a change to be able to keep working on this
 particular package.  However, the fix is easy, and there's no strong
 reason that anyone needs to see the original filename in the work
 directory.  The work directory is just that, the work directory; it
 isn't normally looked at by pkgsrc users. (Actually, I find the
 existence of non-dot files in that directory to be problematic, since I
 like to do 'cd work/*' when debugging things. Thus, I'd personally
 prefer a new . subdirectory, but Jeremy's fix is easier and solves the
 problem.)


 		--Steve Bellovin, http://www.cs.columbia.edu/~smb

From: Hauke Fath <hf@spg.tu-darmstadt.de>
To: gnats-bugs@NetBSD.org
Cc: Hauke Fath <hf@spg.tu-darmstadt.de>
Subject: Re: pkg/39271: rcd_scripts don't work if names match package 
	directory 
Date: Tue, 26 Mar 2013 15:27:08 +0100

 I just ran into this issue while building a package for radmind-git,=20
 applied Jeremy's patch, and was able to complete the package build.

 Given that most repository checkouts create a top directory named after=20
 the project without a version number, I contest J=F6rg's point that this=20
 is a singularity. I think the very unintrusive patch provided should be=20
 committed.

 hauke=20

 --=20
      The ASCII Ribbon Campaign                    Hauke Fath
 ()     No HTML/RTF in email            Institut f=FCr Nachrichtentechnik
 /\     No Word docs in email                     TU Darmstadt
      Respect for open standards              Ruf +49-6151-16-3281

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/39271: rcd_scripts don't work if names match package
 directory
Date: Thu, 4 Jul 2013 05:17:25 +0000

 On Sat, Aug 02, 2008 at 03:10:03PM +0000, Jeremy C. Reed wrote:
  >  The following worked for me for the package you sent me. (Be sure to add 
  >  entry to PLIST too.) Just added a unique suffix to filename for the copy 
  >  in the work directory.
  > [...]
  >
  >  -RCD_SCRIPT_WRK.${_script_}?=	${WRKDIR}/${_script_}
  >  +RCD_SCRIPT_WRK.${_script_}?=	${WRKDIR}/${_script_}.rc.d-script

 Since there was some objection to that (which is why this PR is still
 sitting around now), how about ${WKRDIR}/rc.d/${_script_}?

 -- 
 David A. Holland
 dholland@netbsd.org

From: "Jeremy C. Reed" <reed@reedmedia.net>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/39271: rcd_scripts don't work if names match package
 directory
Date: Thu, 4 Jul 2013 12:51:01 -0500 (CDT)

 On Thu, 4 Jul 2013, David Holland wrote:

 >  Since there was some objection to that (which is why this PR is still
 >  sitting around now), how about ${WKRDIR}/rc.d/${_script_}?

 That is fine with me, assuming the directory is created.

From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/39271 CVS commit: pkgsrc/mk/pkginstall
Date: Mon, 10 Aug 2015 05:41:10 +0000

 Module Name:	pkgsrc
 Committed By:	dholland
 Date:		Mon Aug 10 05:41:10 UTC 2015

 Modified Files:
 	pkgsrc/mk/pkginstall: bsd.pkginstall.mk

 Log Message:
 Construct rc.d scripts in a subdirectory of WRKDIR (.rc.d/) instead of
 right in it, to avoid name conflicts. PR 39271.


 To generate a diff of this commit:
 cvs rdiff -u -r1.62 -r1.63 pkgsrc/mk/pkginstall/bsd.pkginstall.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 10 Aug 2015 05:51:47 +0000
State-Changed-Why:
fixed, finally


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.