Added --cpu and --os arguments to 0launch
[zeroinstall/zeroinstall-mseaborn.git] / 0store.1
blobd9202760b54da15474c77e80338b6a4477bf505d
1 .TH 0STORE 1 "2007" "Thomas Leonard" ""
2 .SH NAME
3 0store \- manage the implementation cache
5 .SH SYNOPSIS
7 .B 0store add
8 \fBDIGEST\fP \fBDIRECTORY\fP
10 .B 0store add
11 \fBDIGEST\fP \fBARCHIVE\fP [ \fBEXTRACT\fP ]
13 .B 0store copy
14 \fBDIRECTORY\fP [ \fBDIRECTORY\fP ]
16 .B 0store find
17 \fBDIGEST\fP
19 .B 0store list
21 .B 0store manifest
22 \fBDIRECTORY\fP [ \fBALGORITHM\fP ]
24 .B 0store optimise
25 [ \fBCACHE\fP ]
27 .B 0store verify
28 ( \fBDIGEST\fP | \fBDIRECTORY\fP )
30 .SH DESCRIPTION
31 .PP
32 0store provides access to the low-level implementation cache. Normally, the
33 cache is updated automatically using 0launch(1).
35 .SH ADD
36 .PP
37 To add a directory to the store (makes a copy):
39 .B 0store add sha1=XXX directory
41 .PP
42 To add an archive to the store:
44 .B 0store add sha1=XXX archive.tgz
46 .PP
47 To add a subdirectory of an archive to the store:
49 .B 0store add sha1=XXX archive.tgz subdir
51 .PP
52 The actual digest is calculated and compared to the given one. If they don't
53 match, the operation is rejected.
55 .SH COPY
56 .PP
57 To copy an implementation (a directory with a name in the form
58 "algorithm=value"), use the copy function. This is similar to performing
59 a normal recursive directory copy followed by a
60 .B 0store verify
61 to check that the name matches the contents. E.g.:
63 .B 0store copy ~someuser/.cache/0install.net/implementations/sha256=XXX
64 /var/cache/0install.net/implementations/
66 .SH FIND
67 .PP
68 To find the path of a stored item:
70 .B 0store find sha1=XXX
72 .SH LIST
74 .PP
75 See the list of implementation caches currently configured:
77 .B 0store list
79 To add directories to this list, add them to your 'implementation-dirs'
80 configuration file.
82 .SH MANIFEST
83 .PP
84 To generate the manifest for a directory structure:
86 .B 0store manifest DIRECTORY [ALGORITHM]
88 .PP
89 The manifest lists every file and directory in the tree, along with the
90 digest of each file, thus uniquely identifying that particular set of files.
91 After the manifest, the last line gives the digest of the manifest itself.
93 .PP
94 This value is needed when creating interface files. However, the 0publish
95 command will automatically calculate the required digest for you and add it
96 to an interface file. See the packager's guide on the Zero Install web site for
97 details.
98 .PP
99 Supported algorithms are 'sha1' (supported by all versions), 'sha1new'
100 (requires injector 0.20 or later) and 'sha256' (requires injector 0.20 or later
101 AND the Python hashlib module).
103 .SH OPTIMISE
105 To hard-link duplicate files together to save space:
107 .B 0store optimise [CACHE]
110 This reads in all the manifest files in the cache directory (~/.cache/0install.net/implementations
111 by default) and looks for duplicates (files with the same permissions, modification time and digest).
112 When it finds a pair, it deletes one and replaces it (atomically) with a hard-link to the other.
115 Implementations using the old 'sha1' algorithm are not optimised.
117 .SH VERIFY
119 To check that an item is stored correctly:
121 .B 0store verify /path/to/sha1=XXX
123 This calculates the manifest of the directory and checks that its digest matches
124 the directory's name. It also checks that it matches the digest of the .manifest
125 file inside the directory. If the .manifest doesn't correspond to the current
126 tree, it displays a list of the differences (in unified diff format).
128 .SH COMMAND-LINE OPTIONS
131 \fB-h\fP, \fB--help\fP
132 Show the built-in help text.
135 \fB-v\fP, \fB--verbose\fP
136 More verbose output. Use twice for even more verbose output.
139 \fB-V\fP, \fB--version\fP
140 Display version information.
142 .SH FILES
144 .IP "~/.cache/0install.net/implementations"
145 Cached implementations, indexed by manifest digest.
147 .IP "~/.config/0install.net/injector/implementation-dirs"
148 List of system cache directories, one per line.
150 .SH LICENSE
152 Copyright (C) 2006 Thomas Leonard.
155 You may redistribute copies of this program under the terms of the GNU Lesser General Public License.
157 .SH BUGS
159 Please report bugs to the developer mailing list:
161 http://0install.net/support.html
163 .SH AUTHOR
165 The Zero Install Injector was created by Thomas Leonard.
167 .SH SEE ALSO
168 0alias(1), 0launch(1), 0store-secure-add(1)
170 The Zero Install web-site:
172 .B http://0install.net