Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch zip64-support Excluding Merge-Ins
This is equivalent to a diff from 9cc7bcdb0c to 3b2398ea3d
2014-03-21
| ||
07:37 | zip decoder work on zip64 support, handling the new end-of-archive structures, debug narrative. This last forces Tcl 8.5. Leaf check-in: 3b2398ea3d user: aku tags: zip64-support | |
07:35 | Extended fileutil::decoder (longlong, big-endian commands, debug narrative). The latter forces Tcl 8.5 check-in: ab8874d803 user: aku tags: zip64-support | |
2014-03-20
| ||
22:48 | Ticket [3439702fff]. Package "html". Fixed procedures "html::css", and "html::js". Ping and patch by Bogdan Puscas <[email protected]>. New procedures "html::css-clear", and "html::js-clear" for state control and testing. Updated documentation. Updated testsuite. (Both provided by patch, with modifications by myself). Version bumped to 1.4.2. check-in: 8564870e90 user: andreask tags: trunk | |
21:57 | Added prelim notes about zip64 support to the encoder check-in: 46f0908dcc user: andreask tags: zip64-support | |
21:51 | decode - Fixed copy-pasta error in manpage header check-in: 9cc7bcdb0c user: andreask tags: trunk | |
2014-03-19
| ||
20:12 | Ticket [1742078fff]. Package "html". Fixed proc nl2br. Was a typo for Windows EOL marker. Ping and patch by Bogdan Puscas <[email protected]>. Testsuite extended. Version bumped to 1.4.1. check-in: 3bc09ccbec user: andreask tags: trunk | |
Changes to modules/fileutil/decode.tcl.
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + | # -*- tcl -*- # ### ### ### ######### ######### ######### ## Copyright (c) 2008-2009 ActiveState Software Inc. ## Andreas Kupries ## BSD License ## # Package to help the writing of file decoders. Provides generic # low-level support commands. |
︙ | |||
183 184 185 186 187 188 189 | 252 253 254 255 256 257 258 259 260 | - + | # Buffer for accumulating structured results variable buf {} } # ### ### ### ######### ######### ######### ## Ready |
Changes to modules/fileutil/pkgIndex.tcl.
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 10 | - + | if {![package vsatisfies [package provide Tcl] 8.2]} {return} package ifneeded fileutil 1.14.6 [list source [file join $dir fileutil.tcl]] if {![package vsatisfies [package provide Tcl] 8.3]} {return} package ifneeded fileutil::traverse 0.4.3 [list source [file join $dir traverse.tcl]] if {![package vsatisfies [package provide Tcl] 8.4]} {return} package ifneeded fileutil::multi 0.1 [list source [file join $dir multi.tcl]] package ifneeded fileutil::multi::op 0.5.3 [list source [file join $dir multiop.tcl]] |
Changes to modules/zip/decode.tcl.
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | - + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + | # -*- tcl -*- # ### ### ### ######### ######### ######### ## Copyright (c) 2008-2012 ActiveState Software Inc. ## Andreas Kupries ## BSD License ## # Package providing commands for the decoding of basic zip-file # structures. |
︙ | |||
186 187 188 189 190 191 192 193 194 195 196 197 198 199 | 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | + | # FUTURE: Run crc checksum on created file and compare to the # ......: stored information. return } proc ::zipfile::decode::GetFile {src fdv} { debug.zip/decode {} upvar 1 $fdv fd # Entry is a directory. if {[string match */ $src]} {return {}} # Empty files are a special case, we have # nothing to decompress. |
︙ | |||
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | + + | return {} } # ### ### ### ######### ######### ######### ## proc ::zipfile::decode::tag {etag} { debug.zip/decode {} mark long-le return [match 0x${etag}4b50] ; # 'PK x y', little-endian integer. } proc ::zipfile::decode::localfileheader {} { debug.zip/decode {} clear putloc @ if {![tag 0403]} {clear ; return 0} short-le ; unsigned ; recode VER ; put vnte ; # version needed to extract short-le ; unsigned ; put gpbf ; # general purpose bitflag short-le ; unsigned ; recode CM ; put cm ; # compression method |
︙ | |||
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | + + + | skip $hdr(efieldlen) putloc fileloc array set hdr [get] clear set hdr(gpbf) [GPBF $hdr(gpbf) $hdr(cm)] debug.zip/decode {[debug nl][debug parray hdr]} setbuf [array get hdr] return 1 } proc ::zipfile::decode::centralfileheader {} { debug.zip/decode {} clear putloc @ if {![tag 0201]} {clear ; return 0} # The items marked with ++ do not exist in the local file # header. Everything else exists in the local file header as well, # and has to match that information. |
︙ | |||
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 | + + + + | skip $hdr(efieldlen2) nbytes $hdr(fcommentlen) ; put comment array set hdr [get] clear set hdr(gpbf) [GPBF $hdr(gpbf) $hdr(cm)] debug.zip/decode {[debug nl][debug parray hdr]} setbuf [array get hdr] return 1 } ## NOT USED proc ::zipfile::decode::datadescriptor {} { debug.zip/decode {} if {![tag 0807]} {return 0} clear long-le ; unsigned ; put crc ; # crc32 long-le ; unsigned ; put csize ; # compressed file size long-le ; unsigned ; put ucsize ; # uncompressed file size return 1 } proc ::zipfile::decode::endcentralfiledir {} { debug.zip/decode {} clear putloc ecdloc if {![tag 0605]} {clear ; return 0} short-le ; unsigned ; put nd ; # short-le ; unsigned ; put ndscd ; # short-le ; unsigned ; put tnecdd ; # |
︙ | |||
342 343 344 345 346 347 348 349 350 351 352 353 354 355 | 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | + | setbuf [array get hdr] return 1 } ## NOT USED proc ::zipfile::decode::afile {} { debug.zip/decode {} if {![localfileheader]} {return 0} array set hdr [get] if {($hdr(ucsize) == 0) || ($hdr(csize) > 0)} { # The header entry specifies either # 1. A zero-length file (possibly a directory entry), or # 2. a non-empty file (compressed size > 0). |
︙ | |||
369 370 371 372 373 374 375 376 377 378 379 380 381 382 | 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | + + | return -code error -errorcode {ZIP DECODE INCOMPLETE} \ "Search data descriptor. Not Yet Implementyed" } return 1 } proc ::zipfile::decode::archive {} { debug.zip/decode {} variable eoa array set cb $eoa # Position us at the beginning of CFH, using the data provided to # us by 'LocateEnd', called during 'open'. go [expr {$cb(base) + $cb(coff)}] |
︙ | |||
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 | 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 | + - + + + + - + + + + + | } set _(files) [array get fn] return [array get _] } proc ::zipfile::decode::hdrmatch {lhv chv} { debug.zip/decode {} upvar 1 $lhv lh $chv ch #puts ______________________________________________ #parray lh #parray ch foreach key { vnte gpbf cm lmft lmfd fnamelen fname } { |
︙ | |||
493 494 495 496 497 498 499 500 501 502 503 504 505 506 | 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 | + | 12 SMS/QDOS 13 {Acorn RISC OS} 14 VFAT 15 MVS 16 BeOS 17 Tandem } } proc ::zipfile::decode::VER {v} { debug.zip/decode {} variable vhost set u [expr {($v & 0xff00) >> 16}] set l [expr {($v & 0x00ff)}] set major [expr {$l / 10}] set minor [expr {$l % 10}] |
︙ | |||
519 520 521 522 523 524 525 526 527 528 529 530 531 532 | 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 | + | 6 implode 7 reserved 8 deflate 9 reserved 10 implode-pkware-dcl } } proc ::zipfile::decode::CM {v} { debug.zip/decode {} variable cm return $cm($v) } # ### ### ### ######### ######### ######### ## |
︙ | |||
545 546 547 548 549 550 551 552 553 554 555 556 557 558 | 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 | + | deflate,1 maximum deflate,2 fast deflate,3 superfast } } proc ::zipfile::decode::GPBF {v cm} { debug.zip/decode {} variable gbits set res {} if {$cm eq "deflate"} { # bit 1, 2 are treated together for deflate lappend res $gbits($cm,[expr {($v >> 1) & 0x3}]) |
︙ | |||
577 578 579 580 581 582 583 584 585 586 587 588 | 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 | + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + - + - - - + + - - - - + + - - + - - - - - - - - - + - - - + - - + - - - - - - - - + | ## Decode the zip file by locating its end (of the central file ## header). The higher levels will then use the information ## inside to locate and read the CFH. No scanning from the beginning ## This piece of code lifted from tclvs/library/zipvfs (v 1.0.3). proc ::zipfile::decode::LocateEnd {path} { debug.zip/decode {} set fd [::open $path r] fconfigure $fd -translation binary ;#-buffering none debug.zip/decode {= $fd} array set cb {} # First locate the regular end of central directory structure. set hdr [LocateMarker $fd "PK\05\06" pos at] |
Changes to modules/zip/encode.tcl.
︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | + + + | package require fileutil ; # zipdir convenience method # ### ### ### ######### ######### ######### ## logger::initNamespace ::zipfile::encode snit::type ::zipfile::encode { # ZIP64 modi: always, never, as-required constructor {} {} destructor {} # ### ### ### ######### ######### ######### ## |
︙ | |||
93 94 95 96 97 98 99 | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | - + + + + + + | $self writeEndOfCentralDir $ch $cfh $cfhsize close $ch return } # ### ### ### ######### ######### ######### |
︙ | |||
149 150 151 152 153 154 155 | 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | - + - - + + + + - + + + + + + + | # should we own it, then switch the upcoming copy # operation over to the compressed file. Which we do # own. if {$owned} { file delete -force $src } |
︙ | |||
221 222 223 224 225 226 227 228 229 230 231 232 233 234 | 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | + + | return } method writeCentralFileHeader {ch dst} { foreach {owned src size ctime attr cm gpbf csize offset crc} $files($dst) break set fnlen [string bytelength $dst] # zip64 - version needed = 4.5 tag $ch 2 1 byte $ch 20 ; # vmb/lsb/version = 2.0 byte $ch 3 ; # vmb/msb/host = UNIX (file attributes = mode). byte $ch 20 ; # vnte/lsb/version = 2.0 byte $ch 3 ; # vnte/msb/host = UNIX (file attributes = mode). short-le $ch $gpbf ; # gpbf /deflate info |
︙ | |||
250 251 252 253 254 255 256 | 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | str $ch $dst ; # file name # no extra field return } method writeEndOfCentralDir {ch cfhoffset cfhsize} { |
︙ |