From bc604ae012c1b30d53c0666e3122c83f5fa9cb2d Mon Sep 17 00:00:00 2001 From: Scott Lamb Date: Fri, 25 Nov 2016 15:01:46 -0800 Subject: [PATCH 1/4] mention the brand new Rust branch in the README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 3694d29..cbbd3ff 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # Introduction +*Note*: Moonfire NVR is currently being rewritten from C++ into Rust. The text +below describes the C++ version. See also the "rust" branch. + Moonfire NVR is an open-source security camera network video recorder, started by Scott Lamb <>. It saves H.264-over-RTSP streams from IP cameras to disk into a hybrid format: video frames in a directory on From af7aa267098233837af2c3cb186673146f35b2d6 Mon Sep 17 00:00:00 2001 From: Dolf Starreveld Date: Wed, 30 Nov 2016 22:05:52 -0800 Subject: [PATCH 2/4] - Fix prep.sh script to exit on test failure - Add prep.sh capabilty to read custom configuration from file prep.config (ignored in .gitignore) to keep script pristine --- .gitignore | 1 + prep.sh | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 1263479..6d1cfcb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ Cargo.lock .settings *.swp target +prep.config diff --git a/prep.sh b/prep.sh index 537575f..cdcec02 100755 --- a/prep.sh +++ b/prep.sh @@ -39,8 +39,12 @@ # # Configuration variables. Should only need minimal, or zero, changes. -# Empty values will use defaults. +# Empty values will use defaults. For convenience, we attempt to read +# customizations from prep.config first # +if [ -r prep.config ]; then + . prep.config +fi # User and group # Default: or whatever is in $NVR_USER (default "moonfire-nvr") @@ -61,7 +65,7 @@ # Set to mountpoint of media directory, empty to stay in home directory # Default: empty -#SAMPLES_DIR= +#SAMPLES_DIR=/media/nvr/samples # Set to path for media directory relative to mountpoint # Default: "samples" @@ -71,7 +75,7 @@ # Binary location # Default: "/usr/local/bin/moonfire-nvr" # -#SERVICE_BIN= +SERVICE_BIN=/usr/local/bin/moonfire-nvr-rust # Service name # Default: "moonfire-nvr" @@ -155,7 +159,12 @@ if [ ! -x "${SERVICE_BIN}" ]; then exit 1 fi RUST_TEST_THREADS=1 cargo test - cargo build --release + if ! cargo build --release; then + echo "test failed. Try to run the following manually for more info" + echo "RUST_TEST_THREADS=1 cargo test --verbose" + echo + exit 1 + fi sudo install -m 755 target/release/moonfire-nvr ${SERVICE_BIN} if [ -x "${SERVICE_BIN}" ]; then echo "Binary installed..."; echo From 2b37c30dd390142ad80ffbedb24421805dc162c1 Mon Sep 17 00:00:00 2001 From: Dolf Starreveld Date: Wed, 30 Nov 2016 22:10:34 -0800 Subject: [PATCH 3/4] - Fixed a left behind customization in the prep.sh script --- prep.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prep.sh b/prep.sh index cdcec02..b226fe5 100755 --- a/prep.sh +++ b/prep.sh @@ -75,7 +75,7 @@ fi # Binary location # Default: "/usr/local/bin/moonfire-nvr" # -SERVICE_BIN=/usr/local/bin/moonfire-nvr-rust +#SERVICE_BIN= # Service name # Default: "moonfire-nvr" From c739bd799e47556b7472a14ca3e43ed5b8b441c2 Mon Sep 17 00:00:00 2001 From: Dolf Starreveld Date: Thu, 1 Dec 2016 01:33:49 -0800 Subject: [PATCH 4/4] Corrections as requested in pull request --- README.md | 3 --- prep.sh | 11 ++++++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f0ddcfd..bbd3a96 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ # Introduction -*Note*: Moonfire NVR is currently being rewritten from C++ into Rust. The text -below describes the C++ version. See also the "rust" branch. - Moonfire NVR is an open-source security camera network video recorder, started by Scott Lamb <>. It saves H.264-over-RTSP streams from IP cameras to disk into a hybrid format: video frames in a directory on diff --git a/prep.sh b/prep.sh index b226fe5..929b0cc 100755 --- a/prep.sh +++ b/prep.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x # # This file is part of Moonfire NVR, a security camera network video recorder. # Copyright (C) 2016 Scott Lamb @@ -158,13 +158,18 @@ if [ ! -x "${SERVICE_BIN}" ]; then echo exit 1 fi - RUST_TEST_THREADS=1 cargo test - if ! cargo build --release; then + if ! RUST_TEST_THREADS=1 cargo test; then echo "test failed. Try to run the following manually for more info" echo "RUST_TEST_THREADS=1 cargo test --verbose" echo exit 1 fi + if ! cargo build --release; then + echo "Build failed." + echo "RUST_TEST_THREADS=1 cargo build --release --verbose" + echo + exit 1 + fi sudo install -m 755 target/release/moonfire-nvr ${SERVICE_BIN} if [ -x "${SERVICE_BIN}" ]; then echo "Binary installed..."; echo