Check-in [34f1255a38]
Overview
Comment:Updated allow future versions to deal with manifests that are not linked from the index file
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:34f1255a3811b563738cf78ade6bf500dcf6ddba
User & Date: rkeene on 2014-11-11 05:11:52
Other Links: manifest | tags
Context
2014-11-11
05:16
Updated to be more tolerant of future expansions to the manifest format check-in: 859f8f6c54 user: rkeene tags: trunk
05:11
Updated allow future versions to deal with manifests that are not linked from the index file check-in: 34f1255a38 user: rkeene tags: trunk
2014-11-10
20:09
Updated to include attribute caching since we now disable all FUSE attribute caching check-in: 89eabdaec1 user: rkeene tags: trunk
Changes

Modified appfs-mkfs from [994caae026] to [09f445e94a].

   107    107   					fi
   108    108   
   109    109   					manifestfile="${appfsdir}/sha1/${RANDOM}${RANDOM}${RANDOM}${RANDOM}${RANDOM}.tmp"
   110    110   
   111    111   					(
   112    112   						cd "${version}" || exit 1
   113    113   
          114  +						echo "#manifestmetadata,${package},${os},${cpuArch},${version}"
   114    115   						emit_manifest
   115    116   					) > "${manifestfile}"
   116    117   
   117    118   					manifestfile_hash="$(sha1 "${manifestfile}")"
   118    119   					mv "${manifestfile}" "${appfsdir}/sha1/${manifestfile_hash}"
   119    120   
   120    121   					# XXX:TODO: Determine if this is the latest version

Modified appfsd.tcl from [99393ab276] to [1afaa96f65].

   170    170   		# Create tables
   171    171   		db eval {CREATE TABLE IF NOT EXISTS sites(hostname PRIMARY KEY, lastUpdate, ttl);}
   172    172   		db eval {CREATE TABLE IF NOT EXISTS packages(hostname, sha1, package, version, os, cpuArch, isLatest, haveManifest);}
   173    173   		db eval {CREATE TABLE IF NOT EXISTS files(package_sha1, type, time, source, size, perms, file_sha1, file_name, file_directory);}
   174    174   
   175    175   		# Create indexes
   176    176   		db eval {CREATE INDEX IF NOT EXISTS sites_index ON sites (hostname);}
   177         -		db eval {CREATE INDEX IF NOT EXISTS packages_index ON packages (hostname, package, version, os, cpuArch);}
          177  +		db eval {CREATE INDEX IF NOT EXISTS packages_index ON packages (hostname, sha1, package, version, os, cpuArch);}
   178    178   		db eval {CREATE INDEX IF NOT EXISTS files_index ON files (package_sha1, file_name, file_directory);}
   179    179   	}
   180    180   
   181    181   	proc download {hostname hash {method sha1}} {
   182    182   		set url [::appfs::user::construct_url $hostname $hash $method]
   183    183   		set file [_cachefile $url $hash]
   184    184   
................................................................................
   303    303   
   304    304   		appfsd::get_path_info_cache_flush
   305    305   
   306    306   		return COMPLETE
   307    307   	}
   308    308   
   309    309   	proc getpkgmanifest {hostname package_sha1} {
   310         -		set haveManifests [db eval {SELECT haveManifest FROM packages WHERE sha1 = $package_sha1 LIMIT 1;}]
   311         -		set haveManifest [lindex $haveManifests 0]
          310  +		set haveManifest [db onecolumn {SELECT haveManifest FROM packages WHERE sha1 = $package_sha1 LIMIT 1;}]
   312    311   
   313    312   		if {$haveManifest} {
   314    313   			return COMPLETE
   315    314   		}
   316    315   
   317    316   		if {![_isHash $package_sha1]} {
   318    317   			return FAIL
................................................................................
   335    334   
   336    335   				unset -nocomplain fileInfo
   337    336   				set fileInfo(type) [lindex $work 0]
   338    337   				set fileInfo(time) [lindex $work 1]
   339    338   
   340    339   				set work [lrange $work 2 end]
   341    340   				switch -- $fileInfo(type) {
          341  +					"#manifestmetadata" {
          342  +						unset -nocomplain fileInfo
          343  +						continue
          344  +					}
   342    345   					"file" {
   343    346   						set fileInfo(size) [lindex $work 0]
   344    347   						set fileInfo(perms) [lindex $work 1]
   345    348   						set fileInfo(sha1) [lindex $work 2]
   346    349   
   347    350   						set work [lrange $work 3 end]
   348    351   					}