Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 200 lines (141 sloc) 5.073 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 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 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 192 193 194 195 196 197 198 199
.TH 0STORE 1 "2010" "Thomas Leonard" ""
.SH NAME
0store \(em manage the implementation cache

.SH SYNOPSIS

.B 0store add
\fBDIGEST\fP \fBDIRECTORY\fP

.B 0store add
\fBDIGEST\fP \fBARCHIVE\fP [ \fBEXTRACT\fP ]

.B 0store audit
[ \fBDIRECTORY\fP ... ]

.B 0store copy
\fBDIRECTORY\fP [ \fBDIRECTORY\fP ]

.B 0store find
\fBDIGEST\fP

.B 0store list

.B 0store manifest
\fBDIRECTORY\fP [ \fBALGORITHM\fP ]

.B 0store optimise
[ \fBCACHE\fP ]

.B 0store verify
( \fBDIGEST\fP | \fBDIRECTORY\fP )

.B 0store manage

.SH DESCRIPTION
.PP
0store provides access to the low-level implementation cache. Normally, the
cache is updated automatically using 0launch(1).

.SH ADD
.PP
To add a directory to the store (makes a copy):

.B 0store add sha256=XXX directory

.PP
To add an archive to the store:

.B 0store add sha256=XXX archive.tgz

.PP
To add a subdirectory of an archive to the store:

.B 0store add sha256=XXX archive.tgz subdir

.PP
The actual digest is calculated and compared to the given one. If they don't
match, the operation is rejected.

.SH AUDIT
.PP
Verifies every implementation in each of the given cache directories, or in all of the
default cache directories if no arguments are given. This will detect any packages which
have been tampered with since they were unpacked. If 0store itself could have been
modified by an attacker, mount the suspect file-system on a known-good machine and
run that machine's 0store on the mounted cache directory.

.PP
See the "verify" command below for details of the verification performed on each package.

.SH COPY
.PP
To copy an implementation (a directory with a name in the form
"algorithm=value"), use the copy function. This is similar to performing
a normal recursive directory copy followed by a
.B 0store verify
to check that the name matches the contents. E.g.:

.B 0store copy ~someuser/.cache/0install.net/implementations/sha256=XXX /var/cache/0install.net/implementations/

.SH FIND
.PP
To find the path of a stored item:

.B 0store find sha256=XXX

.SH LIST

.PP
See the list of implementation caches currently configured:

.B 0store list

To add directories to this list, add them to your 'implementation\-dirs'
configuration file.

.SH MANAGE
.PP
To open a window showing the contents of the cache:

.B 0store manage

You can use this to delete versions of programs you no longer need. However, this
doesn't remove any launchers you added (trying to launch the program will prompt
you to download the missing files again). For that, try:

.B 0desktop --manage

.SH MANIFEST
.PP
To generate the manifest for a directory structure:

.B 0store manifest DIRECTORY [ALGORITHM]

.PP
The manifest lists every file and directory in the tree, along with the
digest of each file, thus uniquely identifying that particular set of files.
After the manifest, the last line gives the digest of the manifest itself.

.PP
This value is needed when creating feed files. However, the 0publish
command will automatically calculate the required digest for you and add it
to a feed file. See the packager's guide on the Zero Install web site for
details.
.PP
Supported algorithms are 'sha1' (supported by all versions), 'sha1new'
(requires injector 0.20 or later) and 'sha256' (requires injector 0.20 or later
AND the Python hashlib module).

.SH OPTIMISE
.PP
To hard-link duplicate files together to save space:

.B 0store optimise [CACHE]

.PP
This reads in all the manifest files in the cache directory (~/.cache/0install.net/implementations
by default) and looks for duplicates (files with the same permissions, modification time and digest).
When it finds a pair, it deletes one and replaces it (atomically) with a hard-link to the other.

.PP
Implementations using the old 'sha1' algorithm are not optimised.

.SH VERIFY
.PP
To check that an item is stored correctly:

.B 0store verify /path/to/sha256=XXX

This calculates the manifest of the directory and checks that its digest matches
the directory's name. It also checks that it matches the digest of the .manifest
file inside the directory. If the .manifest doesn't correspond to the current
tree, it displays a list of the differences (in unified diff format).

.SH COMMAND-LINE OPTIONS

.TP
\fB\-h\fP, \fB\-\-help\fP
Show the built-in help text.

.TP
\fB\-v\fP, \fB\-\-verbose\fP
More verbose output. Use twice for even more verbose output.

.TP
\fB\-V\fP, \fB\-\-version\fP
Display version information.

.SH FILES

.IP "~/.cache/0install.net/implementations"
Cached implementations, indexed by manifest digest.

.IP "~/.config/0install.net/injector/implementation\-dirs"
List of system cache directories, one per line.

.SH LICENSE
.PP
Copyright (C) 2010 Thomas Leonard.

.PP
You may redistribute copies of this program under the terms of the GNU Lesser General Public License.

.SH BUGS
.PP
Please report bugs to the developer mailing list:

http://0install.net/support.html

.SH AUTHOR
.PP
The Zero Install Injector was created by Thomas Leonard.

.SH SEE ALSO
0alias(1), 0launch(1), 0store\-secure\-add(1)
.PP
The Zero Install web-site:

.B http://0install.net
Something went wrong with that request. Please try again.