Check-in [a664b039b7]
Overview
Comment:Updated to support a "-lib" option to the "install" command of "appfs-cache"
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a664b039b70e17cf68cc7966309550ca9f07a34a
User & Date: rkeene on 2017-12-15 05:31:45
Other Links: manifest | tags
Context
2017-12-15
05:32
Some docker updates check-in: 9d8f6caf41 user: rkeene tags: trunk
05:31
Updated to support a "-lib" option to the "install" command of "appfs-cache" check-in: a664b039b7 user: rkeene tags: trunk
05:31
Set default negative ttl to the same as the positive ttl check-in: b075183fad user: rkeene tags: trunk
Changes

Modified appfs-cache from [28b85c645c] to [c1af76ad48].

91
92
93
94
95
96
97







98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114



115
116
117
118
119
120
121
122
123

124
125
126
127
128
129
130
	call_appfsd --tcl 'file delete -force -- {*}[glob -directory $::appfs::cachedir {[0-9a-f][0-9a-f]}]' || return 1
	call_appfsd --sqlite3 'DELETE FROM sites; DELETE FROM packages; DELETE FROM files; VACUUM;' || return 1
}

function install() {
	local site packages
	local package packagedir








	site="$1"
	shift

	packages=("$@")

	if [ -z "${site}" -o -z "${packages[*]}" ]; then
		echo "usage: appfs-cache install <site> <package>..." >&2

		return 1
	fi

	for package in "${packages[@]}"; do
		packagedir="/opt/appfs/${site}/${package}/platform/latest"

		## XXX:TODO: Allow installation to other locations
		ln -s "${packagedir}"/bin/* /bin/



	done

	return 0
}

case "$1" in
	install)
		shift
		install "$@" || exit 1

		;;
	invalidate)
		invalidate || exit 1
		;;
	remove-site)
		remove_site "$2" || exit 1
		;;







>
>
>
>
>
>
>
















|
>
>
>









>







91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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
	call_appfsd --tcl 'file delete -force -- {*}[glob -directory $::appfs::cachedir {[0-9a-f][0-9a-f]}]' || return 1
	call_appfsd --sqlite3 'DELETE FROM sites; DELETE FROM packages; DELETE FROM files; VACUUM;' || return 1
}

function install() {
	local site packages
	local package packagedir
	local includeLib

	includeLib='0'
	if [ "$1" = '-lib' ]; then
		shift
		includeLib='1'
	fi

	site="$1"
	shift

	packages=("$@")

	if [ -z "${site}" -o -z "${packages[*]}" ]; then
		echo "usage: appfs-cache install <site> <package>..." >&2

		return 1
	fi

	for package in "${packages[@]}"; do
		packagedir="/opt/appfs/${site}/${package}/platform/latest"

		## XXX:TODO: Allow installation to other locations
		ln -fs "${packagedir}"/bin/* /bin/
		if [ "${includeLib}" = '1' ]; then
			ln -fs "${packagedir}"/lib/* /lib/
		fi
	done

	return 0
}

case "$1" in
	install)
		shift
		install "$@" || exit 1
		exit 0
		;;
	invalidate)
		invalidate || exit 1
		;;
	remove-site)
		remove_site "$2" || exit 1
		;;