Overview
Comment: | Added executable bit |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: | 99c9d35a89e44a419adc9d05813c9f21fc3cc8b5 |
User & Date: | rkeene on 2014-09-09 06:10:49 |
Other Links: | manifest | tags |
Context
2014-09-09
| ||
06:46 | Updated to download files as binary check-in: d0513156ec user: rkeene tags: trunk | |
06:10 | Added executable bit check-in: 99c9d35a89 user: rkeene tags: trunk | |
06:01 | Updated with basic functionality check-in: f66a795908 user: rkeene tags: trunk | |
Changes
Modified README.md from [1bb6f9042d] to [399b33ad33].
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
/opt/appfs/hostname/package/os-cpuArch/version /opt/appfs/hostname/sha1/ Fetches: http://hostname/appfs/sha1/<sha1> Contains CSV file: type,time,extraData,name type == directory; extraData = (null) type == symlink; extraData = source type == file; extraData = size,sha1 /opt/appfs/hostname/{sha1,package/os-cpuArch/version}/file Fetches: http://hostname/appfs/sha1/<sha1> Database -------- packages(hostname, sha1, package, version, os, cpuArch, isLatest, haveManifest) files(package_sha1, type, time, source, size, file_sha1, file_name, file_directory) |
| | |
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
/opt/appfs/hostname/package/os-cpuArch/version /opt/appfs/hostname/sha1/ Fetches: http://hostname/appfs/sha1/<sha1> Contains CSV file: type,time,extraData,name type == directory; extraData = (null) type == symlink; extraData = source type == file; extraData = size,perms,sha1 /opt/appfs/hostname/{sha1,package/os-cpuArch/version}/file Fetches: http://hostname/appfs/sha1/<sha1> Database -------- packages(hostname, sha1, package, version, os, cpuArch, isLatest, haveManifest) files(package_sha1, type, time, source, size, perms, file_sha1, file_name, file_directory) |
Modified appfs-mk from [de5f8534e5] to [1fd261ccc1].
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
extra_data='' ;; symlink) stat_format='%Y' extra_data="$(readlink "${filename}")" ;; file) stat_format='%Y,%s' filename_hash="$(sha1 "${filename}")" extra_data="${filename_hash}" filename_intree="${appfsdir}/sha1/${filename_hash}" if [ ! -e "${filename_intree}" ]; then cat "${filename}" > "${filename_intree}.tmp" mv "${filename_intree}.tmp" "${filename_intree}" |
> > > > > > | |
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
extra_data='' ;; symlink) stat_format='%Y' extra_data="$(readlink "${filename}")" ;; file) if [ -x "${filename}" ]; then extra_data='x' else extra_data='' fi stat_format='%Y,%s' filename_hash="$(sha1 "${filename}")" extra_data="${extra_data},${filename_hash}" filename_intree="${appfsdir}/sha1/${filename_hash}" if [ ! -e "${filename_intree}" ]; then cat "${filename}" > "${filename_intree}.tmp" mv "${filename_intree}.tmp" "${filename_intree}" |
Modified appfs.c from [fb14cea935] to [62dbc078fa].
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
...
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
|
} return(retval); } static int appfs_getfileinfo_cb(void *_pathinfo, int columns, char **values, char **names) { struct appfs_pathinfo *pathinfo = _pathinfo; const char *type, *time, *source, *size; type = values[0]; time = values[1]; source = values[2]; size = values[3]; pathinfo->time = strtoull(time, NULL, 10); if (strcmp(type, "file") == 0) { pathinfo->type = APPFS_PATHTYPE_FILE; pathinfo->typeinfo.file.executable = 0; pathinfo->typeinfo.file.size = strtoull(size, NULL, 10); return(0); } if (strcmp(type, "directory") == 0) { pathinfo->type = APPFS_PATHTYPE_DIRECTORY; pathinfo->typeinfo.dir.childcount = 0; ................................................................................ file = path; directory = ""; } else { *file = '\0'; file++; } sql = sqlite3_mprintf("SELECT type, time, source, size FROM files WHERE package_sha1 = %Q AND file_directory = %Q AND file_name = %Q;", package_hash, directory, file); if (sql == NULL) { APPFS_DEBUG("Call to sqlite3_mprintf failed."); free(path); return(-EIO); } |
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
|
>
|
|
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
...
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
|
} return(retval); } static int appfs_getfileinfo_cb(void *_pathinfo, int columns, char **values, char **names) { struct appfs_pathinfo *pathinfo = _pathinfo; const char *type, *time, *source, *size, *perms, *sha1; type = values[0]; time = values[1]; source = values[2]; size = values[3]; perms = values[4]; sha1 = values[5]; pathinfo->time = strtoull(time, NULL, 10); if (strcmp(type, "file") == 0) { pathinfo->type = APPFS_PATHTYPE_FILE; if (!size) { size = "0"; } if (!perms) { perms = ""; } pathinfo->typeinfo.file.size = strtoull(size, NULL, 10); if (strcmp(perms, "x") == 0) { pathinfo->typeinfo.file.executable = 1; } else { pathinfo->typeinfo.file.executable = 0; } return(0); } if (strcmp(type, "directory") == 0) { pathinfo->type = APPFS_PATHTYPE_DIRECTORY; pathinfo->typeinfo.dir.childcount = 0; ................................................................................ file = path; directory = ""; } else { *file = '\0'; file++; } sql = sqlite3_mprintf("SELECT type, time, source, size, perms, file_sha1 FROM files WHERE package_sha1 = %Q AND file_directory = %Q AND file_name = %Q;", package_hash, directory, file); if (sql == NULL) { APPFS_DEBUG("Call to sqlite3_mprintf failed."); free(path); return(-EIO); } |
Modified appfs.tcl from [604641f8e6] to [10ad08f811].
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
...
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
if {![info exists ::appfs::db]} { file mkdir $::appfs::cachedir sqlite3 ::appfs::db [file join $::appfs::cachedir cache.db] } _db eval {CREATE TABLE IF NOT EXISTS packages(hostname, sha1, package, version, os, cpuArch, isLatest, haveManifest);} _db eval {CREATE TABLE IF NOT EXISTS files(package_sha1, type, time, source, size, file_sha1, file_name, file_directory);} } proc download {hostname hash {method sha1}} { set url "http://$hostname/appfs/$method/$hash" set file [_cachefile $url $hash] if {![file exists $file]} { ................................................................................ set fileInfo(directory) [join [lrange $fileInfo(name) 0 end-1] "/"] set fileInfo(name) [lindex $fileInfo(name) end] set work [lrange $work 2 end-1] switch -- $fileInfo(type) { "file" { set fileInfo(size) [lindex $work 0] set fileInfo(sha1) [lindex $work 1] } "symlink" { set fileInfo(source) [lindex $work 0] } } _db eval {INSERT INTO files (package_sha1, type, time, source, size, file_sha1, file_name, file_directory) VALUES ($package_sha1, $fileInfo(type), $fileInfo(time), $fileInfo(source), $fileInfo(size), $fileInfo(sha1), $fileInfo(name), $fileInfo(directory) );} _db eval {UPDATE packages SET haveManifest = 1 WHERE sha1 = $package_sha1;} } return COMPLETE } } |
|
>
|
|
|
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
...
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
if {![info exists ::appfs::db]} { file mkdir $::appfs::cachedir sqlite3 ::appfs::db [file join $::appfs::cachedir cache.db] } _db eval {CREATE TABLE IF NOT EXISTS packages(hostname, sha1, package, version, os, cpuArch, isLatest, haveManifest);} _db eval {CREATE TABLE IF NOT EXISTS files(package_sha1, type, time, source, size, perms, file_sha1, file_name, file_directory);} } proc download {hostname hash {method sha1}} { set url "http://$hostname/appfs/$method/$hash" set file [_cachefile $url $hash] if {![file exists $file]} { ................................................................................ set fileInfo(directory) [join [lrange $fileInfo(name) 0 end-1] "/"] set fileInfo(name) [lindex $fileInfo(name) end] set work [lrange $work 2 end-1] switch -- $fileInfo(type) { "file" { set fileInfo(size) [lindex $work 0] set fileInfo(perms) [lindex $work 1] set fileInfo(sha1) [lindex $work 2] } "symlink" { set fileInfo(source) [lindex $work 0] } } _db eval {INSERT INTO files (package_sha1, type, time, source, size, perms, file_sha1, file_name, file_directory) VALUES ($package_sha1, $fileInfo(type), $fileInfo(time), $fileInfo(source), $fileInfo(size), $fileInfo(perms), $fileInfo(sha1), $fileInfo(name), $fileInfo(directory) );} _db eval {UPDATE packages SET haveManifest = 1 WHERE sha1 = $package_sha1;} } return COMPLETE } } |