updated on Thu Jan 19 12:17:07 UTC 2012
[aur-mirror.git] / gibak / gist.patch
blobe0d308dba78d2b151c30529e324e5c8459db4399
1 diff --git a/OMakefile b/OMakefile
2 index 92de085..dc34346 100644
3 --- a/OMakefile
4 +++ b/OMakefile
5 @@ -25,8 +25,8 @@ OCAML_CLIBS += ometastore_stub
6 OCAML_OTHER_LIBS += unix str
8 OCamlProgram(ometastore, folddir util ometastore)
9 -OCamlProgram(find-git-repos, folddir util find-git-repos)
10 -OCamlProgram(find-git-files, folddir util find-git-files)
11 +OCamlProgram(find-git-repos, folddir util findrepos)
12 +OCamlProgram(find-git-files, folddir util find)
14 .DEFAULT: ometastore find-git-files find-git-repos
16 diff --git a/find-git-files.ml b/find-git-files.ml
17 deleted file mode 100644
18 index f2881aa..0000000
19 --- a/find-git-files.ml
20 +++ /dev/null
21 @@ -1,43 +0,0 @@
22 -(* Copyright (C) 2008 Mauricio Fernandez <mfp@acm.org> http//eigenclass.org
23 - * See README.txt and LICENSE for the redistribution and modification terms *)
25 -open Printf
26 -open Folddir
27 -open Util
28 -open Unix
30 -let debug = ref false
32 -module Find(F : Folddir.S) =
33 -struct
34 - let find ?(debug=false) ?(sorted=false) path =
35 - let aux l name stat =
36 - let dir = join path name in
37 - match stat.st_kind with
38 - | S_DIR -> begin
39 - try access (join dir ".git") [F_OK]; Prune (name :: l)
40 - with Unix_error _ -> Continue (name :: l)
41 - end
42 - | _ -> Continue (name :: l)
43 - in List.rev (F.fold_directory ~debug ~sorted aux [] path "")
44 -end
46 -module Gitignored = Find(Folddir.Make(Folddir.Gitignore))
48 -let main () =
49 - let usage = "Usage: find-git-files <options>" in
50 - let path = ref "." in
51 - let zerosep = ref false in
52 - let sorted = ref false in
53 - let specs = [
54 - "--path", Arg.Set_string path, "Set base path (default: .)";
55 - "-z", Arg.Set zerosep, "Use \\0 to separate filenames.";
56 - "-s", Arg.Set sorted, "Sort output.";
57 - "--debug", Arg.Set debug, "Debug mode"
58 - ]
59 - in
60 - Arg.parse specs ignore usage;
61 - let print = if !zerosep then printf "%s\000" else printf "%s\n" in
62 - List.iter print (Gitignored.find ~debug:!debug ~sorted:!sorted !path)
64 -let () = main ()
65 diff --git a/find-git-repos.ml b/find-git-repos.ml
66 deleted file mode 100644
67 index 6db674b..0000000
68 --- a/find-git-repos.ml
69 +++ /dev/null
70 @@ -1,47 +0,0 @@
71 -(* Copyright (C) 2008 Mauricio Fernandez <mfp@acm.org> http//eigenclass.org
72 - * See README.txt and LICENSE for the redistribution and modification terms *)
74 -open Printf
75 -open Folddir
76 -open Util
77 -open Unix
79 -let debug = ref false
81 -module Findrepos(F : Folddir.S) =
82 -struct
83 - let find_repositories ?(debug=false) path =
84 - let aux l name stat =
85 - let dir = join path name in
86 - match stat.st_kind with
87 - | S_DIR -> begin
88 - try access (join dir ".git") [F_OK]; Prune (name :: l)
89 - with Unix_error _ -> Continue l
90 - end
91 - | _ -> Continue l
92 - in List.sort compare (F.fold_directory ~debug aux [] path "")
93 -end
95 -module All = Findrepos(Folddir.Make(Folddir.Ignore_none))
96 -module Gitignored = Findrepos(Folddir.Make(Folddir.Gitignore))
98 -let main () =
99 - let usage = "Usage: find-git-repos <options>" in
100 - let path = ref "." in
101 - let find_repos = ref All.find_repositories in
102 - let zerosep = ref false in
103 - let sorted = ref false in
104 - let specs = [
105 - "--path", Arg.Set_string path, "Set base path (default: .)";
106 - "-i", Arg.Unit (fun () -> find_repos := Gitignored.find_repositories),
107 - "Mimic git semantics (honor .gitignore, don't scan git submodules)";
108 - "-z", Arg.Set zerosep, "Use \\0 to separate filenames.";
109 - "-s", Arg.Set sorted, "Sort output.";
110 - "--debug", Arg.Set debug, "Debug mode"
112 - in Arg.parse specs ignore usage;
113 - let print = if !zerosep then printf "%s\000" else printf "%s\n" in
114 - let l = !find_repos ~debug:!debug !path in
115 - List.iter print (if !sorted then List.sort compare l else l)
117 -let () = main ()
118 diff --git a/find.ml b/find.ml
119 new file mode 100644
120 index 0000000..f2881aa
121 --- /dev/null
122 +++ b/find.ml
123 @@ -0,0 +1,43 @@
124 +(* Copyright (C) 2008 Mauricio Fernandez <mfp@acm.org> http//eigenclass.org
125 + * See README.txt and LICENSE for the redistribution and modification terms *)
127 +open Printf
128 +open Folddir
129 +open Util
130 +open Unix
132 +let debug = ref false
134 +module Find(F : Folddir.S) =
135 +struct
136 + let find ?(debug=false) ?(sorted=false) path =
137 + let aux l name stat =
138 + let dir = join path name in
139 + match stat.st_kind with
140 + | S_DIR -> begin
141 + try access (join dir ".git") [F_OK]; Prune (name :: l)
142 + with Unix_error _ -> Continue (name :: l)
143 + end
144 + | _ -> Continue (name :: l)
145 + in List.rev (F.fold_directory ~debug ~sorted aux [] path "")
146 +end
148 +module Gitignored = Find(Folddir.Make(Folddir.Gitignore))
150 +let main () =
151 + let usage = "Usage: find-git-files <options>" in
152 + let path = ref "." in
153 + let zerosep = ref false in
154 + let sorted = ref false in
155 + let specs = [
156 + "--path", Arg.Set_string path, "Set base path (default: .)";
157 + "-z", Arg.Set zerosep, "Use \\0 to separate filenames.";
158 + "-s", Arg.Set sorted, "Sort output.";
159 + "--debug", Arg.Set debug, "Debug mode"
161 + in
162 + Arg.parse specs ignore usage;
163 + let print = if !zerosep then printf "%s\000" else printf "%s\n" in
164 + List.iter print (Gitignored.find ~debug:!debug ~sorted:!sorted !path)
166 +let () = main ()
167 diff --git a/findrepos.ml b/findrepos.ml
168 new file mode 100644
169 index 0000000..6db674b
170 --- /dev/null
171 +++ b/findrepos.ml
172 @@ -0,0 +1,47 @@
173 +(* Copyright (C) 2008 Mauricio Fernandez <mfp@acm.org> http//eigenclass.org
174 + * See README.txt and LICENSE for the redistribution and modification terms *)
176 +open Printf
177 +open Folddir
178 +open Util
179 +open Unix
181 +let debug = ref false
183 +module Findrepos(F : Folddir.S) =
184 +struct
185 + let find_repositories ?(debug=false) path =
186 + let aux l name stat =
187 + let dir = join path name in
188 + match stat.st_kind with
189 + | S_DIR -> begin
190 + try access (join dir ".git") [F_OK]; Prune (name :: l)
191 + with Unix_error _ -> Continue l
192 + end
193 + | _ -> Continue l
194 + in List.sort compare (F.fold_directory ~debug aux [] path "")
195 +end
197 +module All = Findrepos(Folddir.Make(Folddir.Ignore_none))
198 +module Gitignored = Findrepos(Folddir.Make(Folddir.Gitignore))
200 +let main () =
201 + let usage = "Usage: find-git-repos <options>" in
202 + let path = ref "." in
203 + let find_repos = ref All.find_repositories in
204 + let zerosep = ref false in
205 + let sorted = ref false in
206 + let specs = [
207 + "--path", Arg.Set_string path, "Set base path (default: .)";
208 + "-i", Arg.Unit (fun () -> find_repos := Gitignored.find_repositories),
209 + "Mimic git semantics (honor .gitignore, don't scan git submodules)";
210 + "-z", Arg.Set zerosep, "Use \\0 to separate filenames.";
211 + "-s", Arg.Set sorted, "Sort output.";
212 + "--debug", Arg.Set debug, "Debug mode"
214 + in Arg.parse specs ignore usage;
215 + let print = if !zerosep then printf "%s\000" else printf "%s\n" in
216 + let l = !find_repos ~debug:!debug !path in
217 + List.iter print (if !sorted then List.sort compare l else l)
219 +let () = main ()
221 1.6.2