Tcl Library Source Code

Changes On Branch bug-b01462dff7
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch bug-b01462dff7 Excluding Merge-Ins

This is equivalent to a diff from ce253d70e3 to c6a7152cd0

2025-01-15
19:49
fix: ticket b01462dff7, integrated from branch. version bumped. testsuite extended. doc regenerated. check-in: 870b1002a4 user: aku tags: trunk, main
2025-01-14
22:20
Added testcase demonstrating issue and fix Closed-Leaf check-in: c6a7152cd0 user: aku tags: bug-b01462dff7
2025-01-13
20:20
Bump package version. check-in: 6f3a4044b6 user: aku tags: bug-b01462dff7
2025-01-10
13:55
Proposed fix for tar::untar bug [b01462dff7] check-in: cef77068e4 user: apnadkarni tags: bug-b01462dff7
2025-01-04
18:37
Correct mistakes in the man page for the filter package. check-in: ce253d70e3 user: arjenmarkus tags: trunk, main
16:16
Re-implement the filter procedures, this time based on source code with an MIT license check-in: 79ae95d9e3 user: arjenmarkus tags: trunk, main

Changes to modules/tar/tar.man.
1
2
3
4
5
6
7
8
9
[comment {-*- mode: tcl ; fill-column: 80 -*- doctools manpage}]
[vset PACKAGE_VERSION 0.13]
[manpage_begin tar n [vset PACKAGE_VERSION]]
[keywords archive]
[keywords {tape archive}]
[keywords tar]
[moddesc   {Tar file handling}]
[titledesc {Tar file creation, extraction & manipulation}]
[category  {File formats}]

|







1
2
3
4
5
6
7
8
9
[comment {-*- mode: tcl ; fill-column: 80 -*- doctools manpage}]
[vset PACKAGE_VERSION 0.14]
[manpage_begin tar n [vset PACKAGE_VERSION]]
[keywords archive]
[keywords {tape archive}]
[keywords tar]
[moddesc   {Tar file handling}]
[titledesc {Tar file creation, extraction & manipulation}]
[category  {File formats}]
Changes to modules/tar/tar.tcl.
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Copyright (c) 2024    Christian Werner <[email protected]>
#                       (zlib support).
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.

package require Tcl 8.5 9
package provide tar 0.13

# # ## ### ##### ######## ############# #####################
##
# Gzip support
#
# |Id  |Question            |Check                |Notes|
# |---:|:---                |:---                 |:---|







|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Copyright (c) 2024    Christian Werner <[email protected]>
#                       (zlib support).
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.

package require Tcl 8.5 9
package provide tar 0.14

# # ## ### ##### ######## ############# #####################
##
# Gzip support
#
# |Id  |Question            |Check                |Notes|
# |---:|:---                |:---                 |:---|
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
	name mode uid gid size mtime cksum type \
	linkname magic version uname gname devmajor devminor prefix

    foreach x {name type linkname} {
        set $x [string trim [set $x] "\x00"]
    }
    foreach x {uid gid size mtime cksum} {
        set $x [format %d 0[string trim [set $x] " \x00"]]
    }
    set mode [string trim $mode " \x00"]

    if {$magic eq "ustar "} {
        # gnu tar
        # not fully supported
        foreach x {uname gname prefix} {
            set $x [string trim [set $x] "\x00"]
        }
        foreach x {devmajor devminor} {
            set $x [format %d 0[string trim [set $x] " \x00"]]
        }
    } elseif {$magic eq "ustar\x00"} {
        # posix tar
        foreach x {uname gname prefix} {
            set $x [string trim [set $x] "\x00"]
        }
        foreach x {devmajor devminor} {
            set $x [format %d 0[string trim [set $x] " \x00"]]
        }
    } else {
        # old style tar
        foreach x {uname gname devmajor devminor prefix} { set $x {} }
        if {$type eq ""} {
            if {[string match */ $name]} {
                set type 5







|










|







|







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
	name mode uid gid size mtime cksum type \
	linkname magic version uname gname devmajor devminor prefix

    foreach x {name type linkname} {
        set $x [string trim [set $x] "\x00"]
    }
    foreach x {uid gid size mtime cksum} {
        set $x [format %d 0o0[string trim [set $x] " \x00"]]
    }
    set mode [string trim $mode " \x00"]

    if {$magic eq "ustar "} {
        # gnu tar
        # not fully supported
        foreach x {uname gname prefix} {
            set $x [string trim [set $x] "\x00"]
        }
        foreach x {devmajor devminor} {
            set $x [format %d 0o0[string trim [set $x] " \x00"]]
        }
    } elseif {$magic eq "ustar\x00"} {
        # posix tar
        foreach x {uname gname prefix} {
            set $x [string trim [set $x] "\x00"]
        }
        foreach x {devmajor devminor} {
            set $x [format %d 0o0[string trim [set $x] " \x00"]]
        }
    } else {
        # old style tar
        foreach x {uname gname devmajor devminor prefix} { set $x {} }
        if {$type eq ""} {
            if {[string match */ $name]} {
                set type 5
Changes to modules/tar/tar.test.
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136












137
138
139
} -body {
    string trim [tar::get $tarfile 02]
} -cleanup {
    cleanup-tkt-9f4c0e3e95
    unset tarfile
} -result {zero-two}

test tar-tkt-9f4c0e3e95-1.1 {Ticket 9f4c0e3e95, B, } -setup {
    set tarfile [setup-tkt-9f4c0e3e95]
} -body {
    tar::get $tarfile 0b10
} -cleanup {
    cleanup-tkt-9f4c0e3e95
    unset tarfile
} -returnCodes error -result {Tar "tartest/t.tar": File "0b10" not found}













# -------------------------------------------------------------------------
testsuiteCleanup







|







>
>
>
>
>
>
>
>
>
>
>
>



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
} -body {
    string trim [tar::get $tarfile 02]
} -cleanup {
    cleanup-tkt-9f4c0e3e95
    unset tarfile
} -result {zero-two}

test tar-tkt-9f4c0e3e95-1.1 {Ticket 9f4c0e3e95, B} -setup {
    set tarfile [setup-tkt-9f4c0e3e95]
} -body {
    tar::get $tarfile 0b10
} -cleanup {
    cleanup-tkt-9f4c0e3e95
    unset tarfile
} -returnCodes error -result {Tar "tartest/t.tar": File "0b10" not found}

# -------------------------------------------------------------------------

test tar-tkt-b01462dff7-1.0 {Ticket b01462dff7} -setup {
    set tarfile [localPath tests/b01462dff7.tar]
} -body {
    tar::untar $tarfile ; set _ "" ;# squash and ignore untar result
} -cleanup {
    # remove the extracted files
    file delete cp.html fields.c grammar.lsp sum xargs.1
    unset tarfile _
} -result {}

# -------------------------------------------------------------------------
testsuiteCleanup
Added modules/tar/tests/b01462dff7.tar.

cannot compute difference between binary files