summaryrefslogtreecommitdiff
path: root/README
blob: 10d5d2bab4245c41b1d5beb303c9017bd84d6f9f (plain)
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
200
README for Lorry
================

Lorry is a tool to take upstream source code (in various formats,
though preferably in version control) and converts it into a git
repository.

If you want to try this, use `--pull-only` and/or `--gitorious-base-url`
so that you do not accidentally overwrite important stuff for Baserock.
(If you don't have direct commit access to Baserock on Gitorious.org,
then you're not dangerous.)

See the manual page for instructions on using.

`baserock.lorry` is the file used by Lars to keep Baserock updated.


Implementation
--------------

Lorry relies on git-svn, git-cvsimport, and bzr fast-export for the
conversions. You need to have them installed.

Lorry file specification
------------------------

Lorry files are json dicts where the repository names are the keys and the
values are dicts with the data required to mirror it.

So a simple lorry that mirrors a git project looks like

	{
	    "git": {
	        "type": "git",
	        "url": "git://github.com/gitster/git.git"
	    }
	}

Multiple repositories can be specified in the same .lorry file, in which case
all of them will be processed by lorry. The following shows two repositories.

	{
	    "git": {
	        "type": "git",
	        "url": "git://github.com/gitster/git.git"
	    },
	    "curl": {
	        "type": "git",
	        "url": "git://github.com/bagder/curl.git"
	    }
	}

Lorry can import other version control systems into git.

### Mercurial
Mercurial is very similar to git, just change the type field to "hg"
	{
	    "sudo": {
	        "type": "hg",
	        "url": "http://www.sudo.ws/repos/sudo"
	    }
	}

### Bazaar
Repositories and branches in Bazaar mean different things to Git.
The practical difference for Lorry is that it is not possible to have
a url for a repository, urls map directly to branches.

	{
	    "libpipeline": {
	        "type": "bzr",
	        "branches": {
	            "trunk": "http://bzr.savannah.gnu.org/r/libpipeline/trunk"
	        }
	    }
	}

For convenience if the project only needs one branch mirrored, the url
is assumed to be the master branch.

	{
	    "libpipeline": {
	        "type": "bzr",
	        "url": "http://bzr.savannah.gnu.org/r/libpipeline/trunk"
	    }
	}

### Subversion
Subversion can be used similarly to git if only one branch is needed
	{
	    "mpc": {
	        "type": "svn",
	        "url": "svn://scm.gforge.inria.fr/svn/mpc/trunk",
	    }
	}
To support all the branches and tags a layout needs to be specified as svn is
very flexible with the possible layouts, however the most common is to have the
working branch in a directory called trunk, and the branches and tags in 
respectively named subdirectories.
Because this is so common "standard" can be used as the layout
	{
	    "mpc": {
	        "type": "svn",
	        "url": "svn://scm.gforge.inria.fr/svn/mpc",
	        "layout": "standard"
	    }
	}
This is equivalent to
	{
	    "mpc": {
	        "type": "svn",
	        "url": "svn://scm.gforge.inria.fr/svn/mpc",
	        "layout": {
	            "trunk": "trunk",
	            "branches": "branches/*",
	            "tags": "tags/*"
	        }
	    }
	}
Trunk is the path to the directory where the main branch is located.
Branches and Tags are glob expressions to allow finer control over which paths
are used.
Texlive keeps a lot of resources in their svn repository, we are only concerned
with the source code, so this layout should select the correct subdirectory for
each branch.
	{
	    "texlive": {
		"type": "svn",
		"url": "svn://tug.org/texlive/",
		"layout": {
		    "trunk": "trunk/Build/source",
		    "branches": "branches/*/Build/source",
		    "tags": "tags/*/Build/source"
		}
	    }
	}
Brace expansions can be used to specify subsets of paths.
Netpbm for example, keeps all its branches in the root directory
	{
	    "netpbm": {
		"type": "svn",
		"url": "https://netpbm.svn.sourceforge.net/svnroot/netpbm",
		"layout": {
		    "trunk": "trunk",
		    "branches": "{advanced,stable,super_stable}",
		    "tags": "release_number/*"
		}
	    }
	}

### CVS
The url for CVS repositories is the CVSROOT string. The module is required as
cvs repositories usually have multiple modules, the module is usually the same
as the project name.

	{
	    "openssl": {
		"type": "cvs",
		"url": "anonymous@cvs.openssl.org:/openssl-cvs",
		"module": "openssl"
	    }
	}

### Tarball
Some projects are old enough to pre-date version control, so the source is only
available in tarballs.
Tarball support is fairly limited, the compression format is currently specified
as the long form option without the --, so --gzip becomes gzip.
Strip removes that many components from the paths. This is necessary as tarballs
often have the folder name as the first component.

{
    "bc": {
        "type": "tarball",
        "compression": "gzip",
        "strip": 1,
        "url": "http://ftp.gnu.org/gnu/bc/bc-1.06.tar.gz"
    }
}

NOTE: tarball imports may not give the same sha.

Legal stuff
-----------

Copyright (C) 2011  Codethink Limited
 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.