[MacPorts] #2895: Problem with patch and P4CONFIG in env

MacPorts noreply at macports.org
Thu Mar 24 06:01:39 PDT 2016


#2895: Problem with patch and P4CONFIG in env
---------------------+--------------------------------
  Reporter:  mat@…   |      Owner:  macports-tickets@…
      Type:  defect  |     Status:  closed
  Priority:  Normal  |  Milestone:
 Component:  base    |    Version:  1.0
Resolution:  fixed   |   Keywords:
      Port:          |
---------------------+--------------------------------
Description changed by ryandesign@…:

Old description:

> Hi,
>
> I recently got myself a PB, and yesterday, I began playing with
> DarwinPorts, I installed a few things, and I wanted to install
> lang/perl5.8, there, it borked with :
>
> --->  Applying patches to perl5.8
> Error: Target com.apple.patch returned: shell command "cd
> "/Volumes/Users/darwinports/dports/lang/perl5.8/work/perl-5.8.6" && patch
> -p0 <
> "/Volumes/Users/darwinports/dports/lang/perl5.8/files/patch-
> hints_darwin.sh""
> returned error 2
> Command output: Get file hints/darwin.sh from Perforce with lock? [y]
> sh: line 1: p4: command not found
> patch: **** Can't get file hints/darwin.sh from Perforce
>
> Which is quite obfuscated. I began to look at patch's man page, found out
> that running patch with -g0 was resolving the problem (I patched
> /opt/local/share/darwinports/Tcl/port1.0/portpatch.tcl to have it just
> work) and after, I told myself, no, that's not the right solution, so,
> hum,
> it happens that I use perforce from time to time, and that I have a
> P4CONFIG in my env. Unsetting P4CONFIG solved the problem...
> I have unlearned Tcl long time ago, and I don't know where I should begin
> looking at, but it should definitively be in the FAQ, or port should
> clean
> up it's env before running commands. (I agree that MacOS X's patch is
> behaving strangely there).
>
> The following patch fixes it :
> Index: base/src/darwinports1.0/darwinports.tcl
> ===================================================================
> RCS file:
> /Volumes/src/cvs/od/proj/darwinports/base/src/darwinports1.0/darwinports.tcl,v
> retrieving revision 1.159
> diff -u -u -r1.159 darwinports.tcl
> --- base/src/darwinports1.0/darwinports.tcl  9 Apr 2005 09:51:03 -0000
> 1.159
> +++ base/src/darwinports1.0/darwinports.tcl  13 Apr 2005 09:39:11 -0000
> @@ -267,6 +267,10 @@
>         set env(PATH) "$binpath"
>      }
>
> +    if {[info exists env(P4CONFIG)]} {
> +       unset env(P4CONFIG)
> +    }
> +
>      # Set the default umask
>      if {![info exists destroot_umask]} {
>          set destroot_umask 022

New description:

 Hi,

 I recently got myself a PB, and yesterday, I began playing with
 DarwinPorts, I installed a few things, and I wanted to install
 lang/perl5.8, there, it borked with :

 {{{
 --->  Applying patches to perl5.8
 Error: Target com.apple.patch returned: shell command "cd
 "/Volumes/Users/darwinports/dports/lang/perl5.8/work/perl-5.8.6" && patch
 -p0 < "/Volumes/Users/darwinports/dports/lang/perl5.8/files/patch-
 hints_darwin.sh""
 returned error 2
 Command output: Get file hints/darwin.sh from Perforce with lock? [y]
 sh: line 1: p4: command not found
 patch: **** Can't get file hints/darwin.sh from Perforce
 }}}

 Which is quite obfuscated. I began to look at patch's man page, found out
 that running patch with -g0 was resolving the problem (I patched
 /opt/local/share/darwinports/Tcl/port1.0/portpatch.tcl to have it just
 work) and after, I told myself, no, that's not the right solution, so,
 hum,
 it happens that I use perforce from time to time, and that I have a
 P4CONFIG in my env. Unsetting P4CONFIG solved the problem...
 I have unlearned Tcl long time ago, and I don't know where I should begin
 looking at, but it should definitively be in the FAQ, or port should clean
 up it's env before running commands. (I agree that MacOS X's patch is
 behaving strangely there).

 The following patch fixes it :
 {{{
 Index: base/src/darwinports1.0/darwinports.tcl
 ===================================================================
 RCS file:
 /Volumes/src/cvs/od/proj/darwinports/base/src/darwinports1.0/darwinports.tcl,v
 retrieving revision 1.159
 diff -u -u -r1.159 darwinports.tcl
 --- base/src/darwinports1.0/darwinports.tcl  9 Apr 2005 09:51:03 -0000
 1.159
 +++ base/src/darwinports1.0/darwinports.tcl  13 Apr 2005 09:39:11 -0000
 @@ -267,6 +267,10 @@
         set env(PATH) "$binpath"
      }

 +    if {[info exists env(P4CONFIG)]} {
 +       unset env(P4CONFIG)
 +    }
 +
      # Set the default umask
      if {![info exists destroot_umask]} {
          set destroot_umask 022
 }}}

--

-- 
Ticket URL: <https://trac.macports.org/ticket/2895#comment:3>
MacPorts <https://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list