Migration issue

Mojca Miklavec mojca at macports.org
Wed Dec 16 14:33:41 PST 2015


On 16 December 2015 at 21:50, Ryan Schmidt wrote:
>> On Dec 16, 2015, at 10:58 AM, Mojca Miklavec wrote:
>>
>> Dear Adam,
>>
>> On 16 December 2015 at 17:34, Adam Dershowitz wrote:
>>> I did a selfupdate.  I uninstalled per5, perl5.16 and perl5.22
>>> Next, I installed perl5 +perl5_16
>>> Next I installed perl5.16 +universal
>>>
>>> Then I did 5.22 and had the problem again:
>>>
>>> sudo port install perl5.22 +universal
>>> --->  Computing dependencies for perl5.22
>>> --->  Fetching archive for perl5.22
>>> --->  Attempting to fetch
>>> perl5.22-5.22.1_0+universal.darwin_15.i386-x86_64.tbz2 from
>>> http://packages.macports.org/perl5.22
>>> --->  Attempting to fetch
>>> perl5.22-5.22.1_0+universal.darwin_15.i386-x86_64.tbz2 from
>>> http://lil.fr.packages.macports.org/perl5.22
>>> --->  Attempting to fetch
>>> perl5.22-5.22.1_0+universal.darwin_15.i386-x86_64.tbz2 from
>>> http://nue.de.packages.macports.org/macports/packages/perl5.22
>>> --->  Fetching distfiles for perl5.22
>>> --->  Verifying checksums for perl5.22
>>> --->  Extracting perl5.22
>>> --->  Applying patches to perl5.22
>>> --->  Configuring perl5.22
>>> --->  Building perl5.22
>>> --->  Staging perl5.22 into destroot
>>> --->  Installing perl5.22 @5.22.1_0+universal
>>> --->  Activating perl5.22 @5.22.1_0+universal
>>> Error: org.macports.activate for port perl5.22 returned: Image error:
>>> /opt/local/bin/c2ph-5.22 is being used by the active perl5.16 port.  Please
>>> deactivate this port first, or use 'port -f activate perl5.22' to force the
>>> activation.
>>> Please see the log file for port perl5.22 for details:
>>>
>>> /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_perl5/perl5.22/main.log
>>> To report a bug, follow the instructions in the guide:
>>>    http://guide.macports.org/#project.tickets
>>> Error: Processing of port perl5.22 failed
>>>
>>> I did the check that you asked and I see a whole bunch of stuff:
>>>
>>> port contents perl5.16 | grep 5.22
>>>  /opt/local/bin/a2p-5.22
>>>  /opt/local/bin/c2ph-5.22
>> ...
>>
>> I need to investigate that. That shouldn't have happened.
>
> I don't see the above, but I do see this:
>
>
> $ port installed perl5
> The following ports are currently installed:
>   perl5 @5.22.1_0+perl5_22 (active)
> $ port destroot perl5.16 +universal
> --->  Computing dependencies for perl5.16
> --->  Fetching distfiles for perl5.16
> --->  Verifying checksums for perl5.16
> --->  Extracting perl5.16
> --->  Applying patches to perl5.16
> --->  Configuring perl5.16
> --->  Building perl5.16
> --->  Staging perl5.16 into destroot
> $ port log perl5.16 | grep '5\.22'
> DEBUG: system: cd /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_perl5/perl5.16/work/perl-5.16.3 && ed - /opt/local/var/macports/build/_Users_rschmidt_macports_dports_lang_perl5/perl5.16/work/perl-5.16.3/config.h < /Users/rschmidt/macports/dports/lang/perl5/files/5.22/config.h.ed
>
>
> That shouldn't have happened either. The 5.16 and 5.22 versions of config.h.ed happen to be the same, but the intention was obviously to use the correct version, and that's not happening.
>
> Combining multiple ports into a single port is fraught with peril; the php port is a rather extreme example, possibly even an antipattern.
>
> My initial attempt at understanding the problem goes something like this:
>
> In this case, you've got a foreach loop in which you're defining subports. However when you define a block inside a subport, such as the post-configure block that runs the ed script when the universal variant is chosen, the block gets stored verbatim for later use, without any variables (such as (${perl5.major}) being expanded. The variables get expanded later, when the block is actually used, in this case after the configure phase. By that time, the foreach loop is long over, and all of the variables over which the foreach loop was looping are now set to their ending values, rather than the intended value.
>
> However, that doesn't explain why, for me, the same is not happening in the post-destroot phase.

Oh, this reminded me on the following thread from the past:
    https://lists.macosforge.org/pipermail/macports-dev/2013-July/023498.html

Ryan, does the following patch help?

--- Portfile (revision 143624)
+++ Portfile (working copy)
@@ -37,8 +37,9 @@
     5.22 1 0 99e3af98d80ace857da6ce28679a2e35a4360144
e98e4075a3167fa40524abe447c30bcca10c60e02a54ee1361eff278947a1221
 }

-foreach {perl5.major perl5.subversion perl5.revision perl5.rmd160
perl5.sha256} ${perl5.versions_info} {
-    subport perl${perl5.major} {
+foreach {perl5.v perl5.subversion perl5.revision perl5.rmd160
perl5.sha256} ${perl5.versions_info} {
+    subport perl${perl5.v} {
+        set perl5.major     ${perl5.v}
         version             ${perl5.major}.${perl5.subversion}
         set minor           [lrange [split ${version} .] 1 1]
         revision            ${perl5.revision}

Mojca


More information about the macports-dev mailing list