summaryrefslogtreecommitdiffstats
path: root/src/ops/bool.rs
blob: 23c662b4a685c1fc4186656437cdf0fb2a2cdf56 (plain)
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
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//

//! Bool Filter implementation, so we can insert this in filter construction
//!
//! Will be automatically included when including `filter::Filter`, so importing this module
//! shouldn't be necessary.
//!
use filter::Filter;

#[must_use = "filters are lazy and do nothing unless consumed"]
#[derive(Clone)]
pub struct Bool(bool);

impl Bool {

    pub fn new(b: bool) -> Bool {
        Bool(b)
    }

}

impl From<bool> for Bool {

    fn from(b: bool) -> Bool {
        Bool::new(b)
    }

}

impl_operators!(Bool, self e { self.0 }, );
n> token="$(<.coverity-token)" [ -z "${token}" ] && \ echo >&2 "Save the coverity token to .coverity-token" && \ exit 1 echo >&2 "Coverity token: ${token}" covbuild="$(which cov-build 2>/dev/null || command -v cov-build 2>/dev/null)" [ -z "${covbuild}" -a -f .coverity-build ] && covbuild="$(<.coverity-build)" [ -z "${covbuild}" ] && \ echo "Save command the full filename of cov-build in .coverity-build" && \ exit 1 [ ! -x "${covbuild}" ] && \ echo "The command ${covbuild} is not executable. Save command the full filename of cov-build in .coverity-build" && \ exit 1 version="$(cat config.h | grep "^#define PACKAGE_VERSION" | cut -d '"' -f 2)" echo >&2 "Working on netdata version: ${version}" echo >&2 "Cleaning up old builds..." make clean || exit 1 [ -d "cov-int" ] && \ rm -rf "cov-int" [ -f netdata-coverity-analysis.tgz ] && \ rm netdata-coverity-analysis.tgz "${covbuild}" --dir cov-int make -j${cpus} || exit 1 echo >&2 "Compressing data..." tar czvf netdata-coverity-analysis.tgz cov-int || exit 1 echo >&2 "Sending analysis..." curl --progress-bar --form token="${token}" \ --form email=costa@tsaousis.gr \ --form file=@netdata-coverity-analysis.tgz \ --form version="${version}" \ --form description="netdata, real-time performance monitoring, done right." \ https://scan.coverity.com/builds?project=firehol%2Fnetdata