Overview
Comment: | Updated to populate SQLite database with all package data |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
48a551bede7cc48fce7871f033ad1dd8 |
User & Date: | rkeene on 2014-09-08 02:33:28 |
Other Links: | manifest | tags |
Context
2014-09-08
| ||
02:38 | Separated manifest fetching from index fetching check-in: b5d1616f0f user: rkeene tags: trunk | |
02:33 | Updated to populate SQLite database with all package data check-in: 48a551bede user: rkeene tags: trunk | |
01:24 | More work on basics check-in: a189f64907 user: rkeene tags: trunk | |
Changes
Modified README.md from [5b04e66b64] to [15ef741d8b].
︙ | |||
23 24 25 26 27 28 29 | 23 24 25 26 27 28 29 30 31 | - - + + | type == file; extraData = size,sha1 /opt/appfs/hostname/{sha1,package/os-cpuArch/version}/file Fetches: http://hostname/appfs/sha1/<sha1> Database -------- |
Modified appfs.c from [1eae70cf2b] to [4b3327c544].
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 9 10 11 | + | #define FUSE_USE_VERSION 26 #include <string.h> #include <stdarg.h> #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <fuse.h> #include <tcl.h> #define APPFS_DEBUG(x...) { fprintf(stderr, "%i:%s: ", __LINE__, __func__); fprintf(stderr, x); fprintf(stderr, "\n"); } |
︙ | |||
110 111 112 113 114 115 116 117 | 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 | - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - | return("arm"); case APPFS_CPU_UNKNOWN: return("unknown"); } return("unknown"); } |
︙ | |||
215 216 217 218 219 220 221 | 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 | - + + + + + + + + + | return(1); } tcl_ret = Tcl_Eval(interp, "" #include "appfs.tcl.h" ""); if (tcl_ret != TCL_OK) { |
Modified appfs.tcl from [07f0ced01b] to [58a43bb4f1].
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - | #! /usr/bin/env tclsh package require http 2.7 package require sqlite3 namespace eval ::appfs { |
︙ | |||
40 41 42 43 44 45 46 47 48 49 50 51 52 53 | 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 | + + + + + + + + + + + + + + + + + + + + + | } else { file delete -force -- $tmpfile } } return $file } proc _db {args} { return [uplevel 1 [list ::appfs::db {*}$args]] } proc init {} { if {[info exists ::appfs::init_called]} { return } set ::appfs::init_called 1 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);} _db eval {CREATE TABLE IF NOT EXISTS files(package_sha1, type, time, source, size, file_sha1, file_name, file_directory);} } proc getindex {hostname} { if {[string match "*\[/~\]*" $hostname]} { return -code error "Invalid hostname" } set url "http://$hostname/appfs/index" |
︙ | |||
96 97 98 99 100 101 102 | 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 | - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | } if {![regexp {^[0-9a-f]*$} $pkgInfo(hash)]} { continue } set packages($pkgInfo(package)) [array get pkgInfo] |