[MacPorts] #6220: ENHANCEMENT: port upgrade checks ports multiple times

MacPorts noreply at macports.org
Thu Mar 24 06:07:11 PDT 2016


#6220: ENHANCEMENT: port upgrade checks ports multiple times
----------------------+---------------------
  Reporter:  dluke@…  |      Owner:  olegb@…
      Type:  defect   |     Status:  closed
  Priority:  Normal   |  Milestone:
 Component:  base     |    Version:  1.0
Resolution:  fixed    |   Keywords:
      Port:           |
----------------------+---------------------
Description changed by ryandesign@…:

Old description:

> port upgrade could be sped up by not attempting to walk up parts of the
> dependency tree where it's
> already been.
>
> Patch inline (tcl hates me, so it probably needs work):
>
> Index: darwinports1.0/darwinports.tcl
> ===============================================================
> ====
> RCS file:
> /Volumes/src/cvs/od/proj/darwinports/base/src/darwinports1.0/darwinports.tcl,v
> retrieving revision 1.200
> diff -u -r1.200 darwinports.tcl
> --- darwinports1.0/darwinports.tcl      14 Dec 2005 05:10:19 -0000
> 1.200
> +++ darwinports1.0/darwinports.tcl      23 Dec 2005 19:53:09 -0000
> @@ -1432,9 +1432,12 @@
>  }
>
>  # upgrade procedure
> -proc darwinports::upgrade {pname dspec variationslist optionslist} {
> +proc darwinports::upgrade {pname dspec variationslist optionslist
> {depscachename ""}} {
>         array set options $optionslist
>         array set variations $variationslist
> +       if {![string match "" $depscachename]} {
> +               upvar $depscachename depscache
> +       }
>
>         # set to no-zero is epoch overrides version
>         set epoch_override 0
> @@ -1571,22 +1574,31 @@
>                 # build depends is upgraded
>                 if {[info exists portinfo(depends_build)]} {
>                         foreach i $portinfo(depends_build) {
> -                               set d [lindex [split $i :] end]
> -                               upgrade $d $i $variationslist
> $optionslist
> +                               if {![llength [array get depscache $i]]}
> {
> +                                       set d [lindex [split $i :] end]
> +                                       set depscache($i) 1
> +                                       upgrade $d $i $variationslist
> $optionslist depscache
> +                               }
>                         }
>                 }
>                 # library depends is upgraded
>                 if {[info exists portinfo(depends_lib)]} {
>                         foreach i $portinfo(depends_lib) {
> -                               set d [lindex [split $i :] end]
> -                               upgrade $d $i $variationslist
> $optionslist
> +                               if {![llength [array get depscache $i]]}
> {
> +                                       set d [lindex [split $i :] end]
> +                                       set depscache($i) 1
> +                                       upgrade $d $i $variationslist
> $optionslist depscache
> +                               }
>                         }
>                 }
>                 # runtime depends is upgraded
>                 if {[info exists portinfo(depends_run)]} {
>                         foreach i $portinfo(depends_run) {
> -                               set d [lindex [split $i :] end]
> -                               upgrade $d $i $variationslist
> $optionslist
> +                               if {![llength [array get depscache $i]]}
> {
> +                                       set d [lindex [split $i :] end]
> +                                       set depscache($i) 1
> +                                       upgrade $d $i $variationslist
> $optionslist depscache
> +                               }
>                         }
>                 }
>         }

New description:

 port upgrade could be sped up by not attempting to walk up parts of the
 dependency tree where it's
 already been.

 Patch inline (tcl hates me, so it probably needs work):

 {{{
 Index: darwinports1.0/darwinports.tcl
 ===================================================================
 RCS file:
 /Volumes/src/cvs/od/proj/darwinports/base/src/darwinports1.0/darwinports.tcl,v
 retrieving revision 1.200
 diff -u -r1.200 darwinports.tcl
 --- darwinports1.0/darwinports.tcl      14 Dec 2005 05:10:19 -0000
 1.200
 +++ darwinports1.0/darwinports.tcl      23 Dec 2005 19:53:09 -0000
 @@ -1432,9 +1432,12 @@
  }

  # upgrade procedure
 -proc darwinports::upgrade {pname dspec variationslist optionslist} {
 +proc darwinports::upgrade {pname dspec variationslist optionslist
 {depscachename ""}} {
         array set options $optionslist
         array set variations $variationslist
 +       if {![string match "" $depscachename]} {
 +               upvar $depscachename depscache
 +       }

         # set to no-zero is epoch overrides version
         set epoch_override 0
 @@ -1571,22 +1574,31 @@
                 # build depends is upgraded
                 if {[info exists portinfo(depends_build)]} {
                         foreach i $portinfo(depends_build) {
 -                               set d [lindex [split $i :] end]
 -                               upgrade $d $i $variationslist $optionslist
 +                               if {![llength [array get depscache $i]]} {
 +                                       set d [lindex [split $i :] end]
 +                                       set depscache($i) 1
 +                                       upgrade $d $i $variationslist
 $optionslist depscache
 +                               }
                         }
                 }
                 # library depends is upgraded
                 if {[info exists portinfo(depends_lib)]} {
                         foreach i $portinfo(depends_lib) {
 -                               set d [lindex [split $i :] end]
 -                               upgrade $d $i $variationslist $optionslist
 +                               if {![llength [array get depscache $i]]} {
 +                                       set d [lindex [split $i :] end]
 +                                       set depscache($i) 1
 +                                       upgrade $d $i $variationslist
 $optionslist depscache
 +                               }
                         }
                 }
                 # runtime depends is upgraded
                 if {[info exists portinfo(depends_run)]} {
                         foreach i $portinfo(depends_run) {
 -                               set d [lindex [split $i :] end]
 -                               upgrade $d $i $variationslist $optionslist
 +                               if {![llength [array get depscache $i]]} {
 +                                       set d [lindex [split $i :] end]
 +                                       set depscache($i) 1
 +                                       upgrade $d $i $variationslist
 $optionslist depscache
 +                               }
                         }
                 }
         }
 }}}

--

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


More information about the macports-tickets mailing list