Opened 20 years ago

Closed 20 years ago

Last modified 9 years ago

#2064 closed enhancement (fixed)

vim port (dports/editors/vim/Portfile

Reported by: jq@… Owned by: rshaw@…
Priority: Normal Milestone:
Component: ports Version: 1.0
Keywords: Cc: mij@…
Port: vim

Description (last modified by ryandesign (Ryan Carsten Schmidt))

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}

Attachments (1)

vimport.patch (1.1 KB) - added by jq@… 20 years ago.
Just the patch in a separate file

Download all attachments as: .zip

Change History (5)

Changed 20 years ago by jq@…

Attachment: vimport.patch added

Just the patch in a separate file

comment:1 Changed 20 years ago by olegb@…

Cc: mij@… added
Owner: changed from darwinports-bugs@… to rshaw@…

comment:2 Changed 20 years ago by rshaw@…

Status: newassigned

Thanks, I will take care of this. Incidently, I will be updating Vim to 6.3 now that it's stable, but I'll go ahead and utilize this method of patch retrieval since it's more efficient. :)

-rshaw

comment:3 Changed 20 years ago by rshaw@…

Resolution: fixed
Status: assignedclosed

Patch committed. Thanks. -rshaw

comment:4 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Port: vim added
Type: defectenhancement
Note: See TracTickets for help on using tickets.