Wolfgang Bumiller
b369f720f5
buildsys: don't cache non-binary data
...
etc/ and www/ should be clean in the build/ dir
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:09:34 +00:00
Wolfgang Bumiller
844d13326b
etc: remove obsolete syslog.target dependency
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:02:56 +00:00
Wolfgang Bumiller
0ae7ac1545
make deb: use --no-pre-clean
...
We create a clean build/ directory anyway.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:01:57 +00:00
Wolfgang Bumiller
1a9cb80c44
make clean: cleanup source package files
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller
7406f6260a
debian: add debian/source/format file
...
We need 1.0: We have a native package with a revision, so
anything >1.0 doesn't work...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller
418f3a5f48
add missing build depends
...
lintian complains about a missing bash-completion dependency
which is implied required the bash completion debhelper...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller
7ba5fb4aef
buildsys: re-enable build caching for deb target
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller
18fad34433
make: add dsc target and use lintian
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller
304db5da3d
use libexecdir for service binaries
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller
bed78ccd63
use BUILD_MODE via the environment
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller
069f2d16bf
also apply cargo build flags to tests
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller
13b77d1060
buildsys: fixup package building
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller
a10bb8b941
ignore casync test by default
...
because there's no casync package we can build-depend on to
actually run the tests on normal systems...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller
e0a5d1ca2f
tests: chunk_store: cleanup .testdir
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller
a4f9188300
tests: import lazy_static as needed
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller
6285b251e7
don't hardcode /usr/share paths
...
Add a defines.mk file defining the standard default layout
for installation (PREFIX, DATAROOTDIR, LIBDIR etc.).
Add a $(JSDIR) variable and use env!("JSDIR") in place of
the hardcoded /usr/share/javascript/proxmox-backup path.
Have defines.mk include an *optional* local.mak to override
JSDIR to www/ during local development.
Add `make install` targets and remove debian/install.
Note that service files are now in $libdir/proxmox-backup/
as there's usually no point in starting them from the
command line, so /usr/sbin makes no sense.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller
9fa03fa2d3
www: build proxmox-backup-gui.js into the js/ subdir
...
The server expects an images/ subdir and a js/ subdir, so we
should also compile our files using the same structure.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller
8e4df103dd
remove useless command option from daemons
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller
7028d088b4
add missing build dependencies
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller
1bf446a33e
fix timer_delete call
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-01-30 12:04:20 +01:00
Wolfgang Bumiller
37b98249f4
upload: don't return NotReady
...
We need to kick (poll) the stream's next element, so simply
reiterate, the try_read!() will then return NotReady from
the next stream item for us.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-01-16 15:17:26 +01:00
Wolfgang Bumiller
1dcd52e5df
cleanup previous commit...
...
This kind of notation is weird...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-01-16 14:19:13 +01:00
Wolfgang Bumiller
6a50b77e72
listen on :: instead of 0.0.0.0
...
Since this supports both ipv6 & ipv4 unless v6only is
explicitly enabled.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-01-16 14:18:16 +01:00
Wolfgang Bumiller
1ed86a0bae
rest: rename utf-8-checked 'bytes' to 'utf8'
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-01-08 14:22:43 +01:00
Wolfgang Bumiller
9fec7ae593
rest: don't copy the body
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-01-08 14:21:54 +01:00
Wolfgang Bumiller
d9fbcc4631
tools/timer: fixup doc formatting
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-01-08 14:11:10 +01:00
Wolfgang Bumiller
40c45a4b98
Cargo.toml: [lib] has no authors/version
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-01-08 12:47:35 +01:00
Wolfgang Bumiller
4968bc3ac0
cli::command: wrap usage errors in a UsageError
...
So we can distinguish them and show usage output
conditionally.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2019-01-03 16:08:51 +01:00
Wolfgang Bumiller
7ebb173352
getopt: cleanup: add trailing commas
...
It is customary in rust to always use trailing commas. (also
suggested by rustfmt)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2018-12-28 14:27:38 +01:00
Wolfgang Bumiller
2767c5d39b
getopt: cleanup: don't condense 'if' statements too much
...
In a language which enforces curly braces this looks weird
and rustfmt doesn't like it.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2018-12-28 14:27:38 +01:00
Wolfgang Bumiller
7d95c10da0
getopt: whitespace cleanup
...
to make rustfmt happy
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2018-12-28 14:27:38 +01:00
Wolfgang Bumiller
03fb895197
getopt: condense nested match to reduce indentation
...
The `match value` statement is the only thing covering the
entire RawArgument::Option case. `rustfmt` suggests this
more condensed way of writing this case.
See the `git diff -w` of this patch:
|diff --git a/src/getopts.rs b/src/getopts.rs
|index 9755af2..4db4579 100644
|--- a/src/getopts.rs
|+++ b/src/getopts.rs
|@@ -72,8 +72,7 @@ pub fn parse_arguments<T: AsRef<str>>(
| RawArgument::Separator => {
| break;
| }
|- RawArgument::Option { name, value } => {
|- match value {
|+ RawArgument::Option { name, value } => match value {
| None => {
| let mut want_bool = false;
| let mut can_default = false;
|@@ -125,7 +124,6 @@ pub fn parse_arguments<T: AsRef<str>>(
| data.push((name, v));
| }
| }
|- }
| RawArgument::Argument { value } => {
| rest.push(value);
| }
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2018-12-28 14:16:58 +01:00
Wolfgang Bumiller
4d0ea9978b
getopt: let parse_arguments() take a slice of AsRef<str>
...
We don't need the content to be owned strings, and we don't
need the list to be a Vec, since we only care about being
able to iterate through and copy out portions of the strings
we need, so take an &[T] where T: AsRef<str>.
This avoids .iter().map(to_string).collect() before calling
parse_arguments().
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2018-12-28 14:05:05 +01:00
Wolfgang Bumiller
2482c095b1
getopt: remove skip logic
...
The 'skip' variable was set to indicate that the "rest of
the args" is to be copied into the 'rest' vec. We can do
this directly and avoid the 'if' case in the loop
altogether.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2018-12-28 13:59:44 +01:00
Wolfgang Bumiller
99da3a073d
getopt: indentation reduction
...
See the `git diff -w` output:
|diff --git a/src/getopts.rs b/src/getopts.rs
|index 6548a01..517cc37 100644
|--- a/src/getopts.rs
|+++ b/src/getopts.rs
|@@ -72,7 +72,10 @@ pub fn parse_arguments(
| while pos < args.len() {
| if skip {
| rest.push(args[pos].clone());
|- } else {
|+ pos += 1;
|+ continue;
|+ }
|+
| match parse_argument(&args[pos]) {
| RawArgument::Separator => {
| skip = true;
|@@ -135,7 +138,6 @@ pub fn parse_arguments(
| rest.push(value);
| }
| }
|- }
|
| pos += 1;
| }
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2018-12-28 13:54:20 +01:00
Wolfgang Bumiller
ad8a98f7e4
parse_arguments: work with utf8 bytes and reduce indentation
...
We are only caring about '=' and '-' which are single-byte
codepoints, so there's no reason not to work on a byte
slice.
Also, some indentation reduction:
Transform
if (a) {
...
return A;
}
return B;
into
if (!a)
return B;
return A;
and
if (a)
if (b)
foo()
into
if (a && b)
return;
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2018-12-28 13:47:29 +01:00
Wolfgang Bumiller
fba3437f1e
timer: setup_timeout_handler cannot fail
...
and if it does it panics anyway
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2018-12-27 10:36:28 +01:00
Wolfgang Bumiller
1628a4c731
use timers with a signal for file locking
...
* rename lock_file -> open_file_locked,
* add lock_file as a function working on already-opened
files
* change timeout types to std::time::Duration
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2018-12-19 11:23:00 +01:00
Wolfgang Bumiller
8cf6e764ad
add tools::timer module
...
This wraps POSIX timers via timer_create(2).
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2018-12-19 11:23:00 +01:00
Wolfgang Bumiller
2aea95210e
add rust standard .gitignore file
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com >
2018-12-19 11:06:51 +01:00