Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ $(BUILDDIR)/%.o: %.c
$(CC) -c -o $@ -fPIC -I $(shell ocamlfind query ctypes) -I $(OCAMLDIR) -I $(OCAMLDIR)/../ctypes $<

$(BUILDDIR)/%.cmx: %.ml
ocamlfind opt -c -o $@ -I $(BUILDDIR)/generated -I $(BUILDDIR)/lib -package $(PACKAGES) $<
ocamlfind opt -c -o $@ -I $(BUILDDIR)/generated -I $(BUILDDIR)/lib -thread -package $(PACKAGES) $<

$(GENERATOR): $(GENERATOR_FILES)
ocamlfind opt -o $@ -I $(BUILDDIR)/lib -linkpkg -thread -package $(PACKAGES) $^
Expand Down
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

DIR=$1

sudo sh -c 'eval $(opam env --root=/opt/opam --set-root) && opam pin add vyos1x-config https://github.com/vyos/vyos1x-config.git#acfac8d809 -y'
sudo sh -c 'eval $(opam env --root=/opt/opam --set-root) && opam pin add vyconf https://github.com/vyos/vyconf.git#196fdd7fdf -y'

eval `opam config env`
make clean
make
3 changes: 3 additions & 0 deletions debian/libvyosconfig0.install
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
usr/lib/libvyosconfig.so.0
usr/share/vyos/vyconf
etc/vyos
usr/libexec/vyos/vyconf
14 changes: 14 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/usr/bin/make -f

DIR := debian/tmp
OCAML_DIR := /opt/opam/${OCAML_VERSION}
VYCONF := usr/libexec/vyos/vyconf
VYCONF_CONF := $(VYCONF)/config
VYCONF_DATA := usr/share/vyos/vyconf
VYCONF_DEF := etc/vyos

%:
dh $@ --with quilt
Expand All @@ -9,6 +14,15 @@ override_dh_auto_build:
./build.sh $(DIR)

override_dh_auto_install:
mkdir -p $(DIR)/$(VYCONF_CONF)
mkdir -p $(DIR)/$(VYCONF_DATA)
mkdir -p $(DIR)/$(VYCONF_DEF)
cp $(OCAML_DIR)/share/vyconf/vyconf.proto $(DIR)/$(VYCONF_DATA)
cp $(OCAML_DIR)/share/vyconf/vyconfd.conf $(DIR)/$(VYCONF_DEF)
cp $(OCAML_DIR)/bin/vyconfd $(DIR)/$(VYCONF)
cp $(OCAML_DIR)/bin/vy_set $(DIR)/$(VYCONF)
cp $(OCAML_DIR)/bin/vy_delete $(DIR)/$(VYCONF)
#
mkdir -p $(DIR)/usr/lib
cp _build/libvyosconfig.so $(DIR)/usr/lib/libvyosconfig.so.0
dh_makeshlibs
Expand Down
6 changes: 3 additions & 3 deletions lib/bindings.ml
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ let tree_union c_ptr_l c_ptr_r =
with
CD.Nonexistent_child -> error_message := "Nonexistent child"; Ctypes.null

let reference_tree_to_json from_dir to_file =
let reference_tree_to_json internal_cache from_dir to_file =
try
Generate.reference_tree_to_json from_dir to_file; 0
Generate.reference_tree_to_json ~internal_cache:internal_cache from_dir to_file; 0
with
| Generate.Load_error msg ->
let s = Printf.sprintf "Load_error \'%s\'" msg in
Expand Down Expand Up @@ -276,6 +276,6 @@ struct
let () = I.internal "diff_tree" (string @-> (ptr void) @-> (ptr void) @-> returning (ptr void)) diff_tree
let () = I.internal "show_diff" (bool @-> string @-> (ptr void) @-> (ptr void) @-> returning string) show_diff
let () = I.internal "tree_union" ((ptr void) @-> (ptr void) @-> returning (ptr void)) tree_union
let () = I.internal "reference_tree_to_json" (string @-> string @-> returning int) reference_tree_to_json
let () = I.internal "reference_tree_to_json" (string @-> string @-> string @-> returning int) reference_tree_to_json
let () = I.internal "mask_tree" ((ptr void) @-> (ptr void) @-> returning (ptr void)) mask_tree
end