[MacPorts] #2064: vim port (dports/editors/vim/Portfile

MacPorts noreply at macports.org
Thu Mar 24 07:38:42 PDT 2016


#2064: vim port (dports/editors/vim/Portfile
--------------------------+---------------------
  Reporter:  jq@…         |      Owner:  rshaw@…
      Type:  enhancement  |     Status:  closed
  Priority:  Normal       |  Milestone:
 Component:  ports        |    Version:  1.0
Resolution:  fixed        |   Keywords:
      Port:  vim          |
--------------------------+---------------------
Changes (by ryandesign@…):

 * type:  defect => enhancement
 * port:   => vim


Old description:

> The current implementation fetches 1 file per patch level.
> The patches are also available in chunks of 100 (e.g. 6.2.001-100.gz,
> 6.2.101-200.gz,...)
> Thus O(N) is used where O((N/100) +(N%100)) is available.
> At the current patch level 532 this fetches 532 files when 37 would
> suffice.
>
> I was not sure what is kosher in Portfiles, so did not complete the work
> by uncompressing the gzipped patchfiles or modifying patch_checksums.
> I merely tested by confirming that port -d configure, fetched all sources
> and
> patches.
>
> Included find a diff -u of a Portfile illustrating the general form of a
> fix.
> --- Portfile.orig       Wed Jun  2 19:30:37 2004
> +++ Portfile    Fri Jul 16 13:19:08 2004
> @@ -46,9 +46,30 @@
>
>  set vim_badpatches     {}
>
> -eval patchfiles                [split [exec /usr/bin/jot -s " " -w \
> -                                               [strsed $version
> {s/\.[0-9]*$//}].%03d \
> -                                               $vim_patchlevel 1
> $vim_patchlevel] " "]
> +proc list_patches {version patchnum} {
> +        set low 1
> +        set patch_list []
> +        while { $low <= $patchnum } {
> +                set high [expr $low + 99];
> +                if { $high < $patchnum } {
> +                        patchfiles-append [ format "%s.%03d-%03d.gz"
> $version $low $high]
> +                        incr low 100
> +                } {
> +                        patchfiles-append [ format "%s.%03d" $version
> $low]
> +                        incr low 1
> +                }
> +        }
> +}
> +list_patches [strsed $version {s/\.[0-9]*$//}] $vim_patchlevel
> +
> +#eval patchfiles [list_patches [strsed $version {s/\.[0-9]*$//}] 534]
> +
> +
> +
> +#eval patchfiles               [split [exec /usr/bin/jot -s " " -w \
> +#                                      [strsed $version
> {s/\.[0-9]*$//}].%03d \
> +#                                      $vim_patchlevel 1
> $vim_patchlevel] " "]
> +
>
>  foreach p ${vim_badpatches} {
>         patchfiles-delete 6.2.${p}

New description:

 The current implementation fetches 1 file per patch level.
 The patches are also available in chunks of 100 (e.g. 6.2.001-100.gz,
 6.2.101-200.gz,...)
 Thus O(N) is used where O((N/100) +(N%100)) is available.
 At the current patch level 532 this fetches 532 files when 37 would
 suffice.

 I was not sure what is kosher in Portfiles, so did not complete the work
 by uncompressing the gzipped patchfiles or modifying patch_checksums.
 I merely tested by confirming that port -d configure, fetched all sources
 and
 patches.

 Included find a diff -u of a Portfile illustrating the general form of a
 fix.
 {{{
 --- Portfile.orig       Wed Jun  2 19:30:37 2004
 +++ Portfile    Fri Jul 16 13:19:08 2004
 @@ -46,9 +46,30 @@

  set vim_badpatches     {}

 -eval patchfiles                [split [exec /usr/bin/jot -s " " -w \
 -                                               [strsed $version
 {s/\.[0-9]*$//}].%03d \
 -                                               $vim_patchlevel 1
 $vim_patchlevel] " "]
 +proc list_patches {version patchnum} {
 +        set low 1
 +        set patch_list []
 +        while { $low <= $patchnum } {
 +                set high [expr $low + 99];
 +                if { $high < $patchnum } {
 +                        patchfiles-append [ format "%s.%03d-%03d.gz"
 $version $low $high]
 +                        incr low 100
 +                } {
 +                        patchfiles-append [ format "%s.%03d" $version
 $low]
 +                        incr low 1
 +                }
 +        }
 +}
 +list_patches [strsed $version {s/\.[0-9]*$//}] $vim_patchlevel
 +
 +#eval patchfiles [list_patches [strsed $version {s/\.[0-9]*$//}] 534]
 +
 +
 +
 +#eval patchfiles               [split [exec /usr/bin/jot -s " " -w \
 +#                                      [strsed $version
 {s/\.[0-9]*$//}].%03d \
 +#                                      $vim_patchlevel 1 $vim_patchlevel]
 " "]
 +

  foreach p ${vim_badpatches} {
         patchfiles-delete 6.2.${p}
 }}}

--

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


More information about the macports-tickets mailing list