tcl-hacks

Check-in [d3282bd58d]
Login

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

Overview
Comment:purge remnants of map_os/map_cpu
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d3282bd58d5bca00c0f3892101785bc073671024
User & Date: aspect 2018-07-24 11:17:44
Context
2018-07-24
11:24
more consistent error handling. Display TPM throws nicely, let others go through to the keeper check-in: 9c29f30147 user: aspect tags: trunk
11:17
purge remnants of map_os/map_cpu check-in: d3282bd58d user: aspect tags: trunk
11:15
find type should be generic, not just package check-in: 6211a10390 user: aspect tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to hacks/cuppa/tpc.tcl.

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
...
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
    return $arch
}

proc lmatch {item list} {
    expr {$list eq "*" || $item in $list}
}

variable map_os {
    tcl         %
    linux-%     linux
    win32       windows
    solaris%    {solaris sunos}
    freebsd     freebsd_%
    irix        irix_%
    macosx%     darwin
}
variable map_cpu {
    ix86        {x86 intel i_86 i86pc}
    sparc       sun4%
    sparc64     {sun4u sun4v}
    universal   %
    {""}        %
    powerpc     ppc
}

proc init_db {} {
    db eval {
        drop table if exists servers;
        drop table if exists pkgindex;
        drop table if exists map_os;
        drop table if exists map_cpu;
        drop table if exists packages;

        create table map_os ( teapot text, local text );
        create table map_cpu ( teapot text, local text );

        create table servers (
            rowid integer primary key asc,
            baseurl text not null,
            last_checked integer not null default 0,
            priority integer not null default 100,
            unique (baseurl)
        );
................................................................................
            package_id integer not null,
            key text not null,
            value text not null,
            primary key (package_id, key),
            foreign key (package_id) references packages (rowid) on delete cascade
        );
    }

    if 0 {
    variable map_os
    variable map_cpu
    foreach {teapot local} $map_os {
        foreach t $teapot {
            foreach l $local {
                db eval {
                    insert into map_os (teapot, local) values (:t, :l)
                }
            }
        }
    }
    foreach {teapot local} $map_cpu {
        foreach t $teapot {
            foreach l $local {
                db eval {
                    insert into map_cpu (teapot, local) values (:t, :l)
                }
            }
        }
    }
}
}

proc index:del {baseurl} {
    db eval {
        select baseurl from servers where baseurl like :baseurl
    } row {
        lappend result [row_as_dict row]







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<


<
<
<







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







156
157
158
159
160
161
162


















163
164
165
166


167
168



169
170
171
172
173
174
175
...
203
204
205
206
207
208
209























210
211
212
213
214
215
216
    return $arch
}

proc lmatch {item list} {
    expr {$list eq "*" || $item in $list}
}



















proc init_db {} {
    db eval {
        drop table if exists servers;
        drop table if exists pkgindex;


        drop table if exists packages;




        create table servers (
            rowid integer primary key asc,
            baseurl text not null,
            last_checked integer not null default 0,
            priority integer not null default 100,
            unique (baseurl)
        );
................................................................................
            package_id integer not null,
            key text not null,
            value text not null,
            primary key (package_id, key),
            foreign key (package_id) references packages (rowid) on delete cascade
        );
    }























}

proc index:del {baseurl} {
    db eval {
        select baseurl from servers where baseurl like :baseurl
    } row {
        lappend result [row_as_dict row]