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
|
#+title FSD import utility
=fsd= is a command line utility to download, import and export debian
packages for importing into the [[https://directory.fsf.org][Free Software Directory]]. It is a
Haskell rewrite of [[https://savannah.gnu.org/p/directory][directory]].
* Install
To install, run
#+begin_src sh
cabal install
#+end_src
This will install the binary to =~/.cabal/bin= - make sure it's in
your $PATH.
* Quickstart
To start, create and cd into a directory for the database and
downloaded files, then run
#+begin_src sh
fsd init
#+end_src
to initialise a database, and
#+begin_src sh
fsd get all && fsd import all
#+end_src
to download and import all the index files (sources, packages,
translations).
Next, download the changelog and copyright files:
#+begin_src sh
fsd get changelog && fsd get copyright
#+end_src
This may take hours, but the downloading is async, so you can start
importing them already, or if you want, you can wait until all wget
processes are finished first.
Import the changelog and copyright files:
#+begin_src sh
fsd import changelog && fsd import copyright
#+end_src
Check approximately what packages are exportable by running
#+begin_src sh
fsd list
#+end_src
And finally, it is time to export to wiki files:
#+begin_src sh
fsd export
#+end_src
it will write all files in =./wiki= directory.
* General usage
To get help, run the command with --help:
#+begin_src sh
fsd --help
#+end_src
and it should output:
#+begin_example
fsd - a tool to import from Debian and export to FSD entries.
Usage: fsd [-d|--database DATABASE] [-m|--dist-dir DISTDIR]
[-n|--nworkers NWORKERS] [-e|--export-dir EXPORTDIR] COMMAND
FSD import script
Available options:
-d,--database DATABASE Database store of imported package info.
(default: "./directory.db")
-m,--dist-dir DISTDIR Root directory to files downloaded from debian.
(default: "./distfiles")
-n,--nworkers NWORKERS Number of wget workers for downloading changelog and
copyright files. (default: 4)
-e,--export-dir EXPORTDIR
Directory to place the exported .wiki files.
(default: "./wiki")
-h,--help Show this help text
Available commands:
init Initilise database
get Download index and metadata files.
import Import package info from local index and metadata
files.
export Export packages to .wiki files.
list List imported packages
#+end_example
|