Browse Source

Add initial statusmerge.

master
Thomas Kerber 1 year ago
commit
8ba531d1b2
Signed by: Thomas Kerber <tk@drwx.org> GPG Key ID: 8489B911F9ED617B
6 changed files with 593 additions and 0 deletions
  1. 2
    0
      .gitignore
  2. 176
    0
      Cargo.lock
  3. 358
    0
      Cargo.nix
  4. 8
    0
      Cargo.toml
  5. 4
    0
      default.nix
  6. 45
    0
      src/main.rs

+ 2
- 0
.gitignore View File

@@ -0,0 +1,2 @@
/target
**/*.rs.bk

+ 176
- 0
Cargo.lock View File

@@ -0,0 +1,176 @@
[[package]]
name = "bitflags"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "cfg-if"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "fuchsia-zircon"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "fuchsia-zircon-sys"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "iovec"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "kernel32-sys"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "lazycell"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "libc"
version = "0.2.42"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "log"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "mio"
version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "miow"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "net2"
version = "0.2.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "slab"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "statusmerge"
version = "0.1.0"
dependencies = [
"mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
"strfmt 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "strfmt"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "winapi"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "winapi"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "winapi-build"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "ws2_32-sys"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

[metadata]
"checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789"
"checksum cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efe5c877e17a9c717a0bf3613b2709f723202c4e4675cc8f12926ded29bcb17e"
"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08"
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
"checksum lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a6f08839bc70ef4a3fe1d566d5350f519c5912ea86be0df1740a7d247c7fc0ef"
"checksum libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)" = "b685088df2b950fccadf07a7187c8ef846a959c142338a48f9dc0b94517eb5f1"
"checksum log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "61bd98ae7f7b754bc53dca7d44b604f733c6bba044ea6f41bc8d89272d8161d2"
"checksum mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)" = "4fcfcb32d63961fb6f367bfd5d21e4600b92cd310f71f9dca25acae196eb1560"
"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88"
"checksum slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdeff4cd9ecff59ec7e3744cbca73dfe5ac35c2aedb2cfba8a1c715a18912e9d"
"checksum strfmt 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b278b244ef7aa5852b277f52dd0c6cac3a109919e1f6d699adde63251227a30f"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
"checksum winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "773ef9dcc5f24b7d850d0ff101e542ff24c3b090a9768e03ff889fdef41f00fd"
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"

+ 358
- 0
Cargo.nix View File

@@ -0,0 +1,358 @@
# Generated by carnix 0.7.2: carnix nix --src ./.
{ lib, buildPlatform, buildRustCrate, fetchgit }:
let kernel = buildPlatform.parsed.kernel.name;
abi = buildPlatform.parsed.abi.name;
include = includedFiles: src: builtins.filterSource (path: type:
lib.lists.any (f:
let p = toString (src + ("/" + f)); in
(path == p) || (type == "directory" && lib.strings.hasPrefix path p)
) includedFiles
) src;
updateFeatures = f: up: functions: builtins.deepSeq f (lib.lists.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions);
mapFeatures = features: map (fun: fun { features = features; });
mkFeatures = feat: lib.lists.foldl (features: featureName:
if feat.${featureName} or false then
[ featureName ] ++ features
else
features
) [] (builtins.attrNames feat);
in
rec {
statusmerge = f: statusmerge_0_1_0 { features = statusmerge_0_1_0_features { statusmerge_0_1_0 = f; }; };
__all = [ (statusmerge {}) ];
bitflags_1_0_3_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "bitflags";
version = "1.0.3";
authors = [ "The Rust Project Developers" ];
sha256 = "162p4w4h1ad76awq6b5yivmls3d50m9cl27d8g588lsps6g8s5rw";
inherit dependencies buildDependencies features;
};
cfg_if_0_1_4_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "cfg-if";
version = "0.1.4";
authors = [ "Alex Crichton <alex@alexcrichton.com>" ];
sha256 = "0n5baxk53dvqjymzwynq55wb805b24390qx1n16zi8fjzq90j7k4";
inherit dependencies buildDependencies features;
};
fuchsia_zircon_0_3_3_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "fuchsia-zircon";
version = "0.3.3";
authors = [ "Raph Levien <raph@google.com>" ];
sha256 = "0jrf4shb1699r4la8z358vri8318w4mdi6qzfqy30p2ymjlca4gk";
inherit dependencies buildDependencies features;
};
fuchsia_zircon_sys_0_3_3_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "fuchsia-zircon-sys";
version = "0.3.3";
authors = [ "Raph Levien <raph@google.com>" ];
sha256 = "08jp1zxrm9jbrr6l26bjal4dbm8bxfy57ickdgibsqxr1n9j3hf5";
inherit dependencies buildDependencies features;
};
iovec_0_1_2_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "iovec";
version = "0.1.2";
authors = [ "Carl Lerche <me@carllerche.com>" ];
sha256 = "0vjymmb7wj4v4kza5jjn48fcdb85j3k37y7msjl3ifz0p9yiyp2r";
inherit dependencies buildDependencies features;
};
kernel32_sys_0_2_2_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "kernel32-sys";
version = "0.2.2";
authors = [ "Peter Atashian <retep998@gmail.com>" ];
sha256 = "1lrw1hbinyvr6cp28g60z97w32w8vsk6pahk64pmrv2fmby8srfj";
libName = "kernel32";
build = "build.rs";
inherit dependencies buildDependencies features;
};
lazycell_0_6_0_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "lazycell";
version = "0.6.0";
authors = [ "Alex Crichton <alex@alexcrichton.com>" "Nikita Pekin <contact@nikitapek.in>" ];
sha256 = "1ax148clinbvp6alxcih8s5i2bg3mc5mi69n3hvzvzbwlm6k532r";
inherit dependencies buildDependencies features;
};
libc_0_2_42_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "libc";
version = "0.2.42";
authors = [ "The Rust Project Developers" ];
sha256 = "064v49hz1zpl081w8c4vwikrkhaxp06y4i9l7x7wx6bjpwp19pjx";
inherit dependencies buildDependencies features;
};
log_0_4_3_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "log";
version = "0.4.3";
authors = [ "The Rust Project Developers" ];
sha256 = "1gdmwrbm7s18zcdz4lcdhz975m4gwhi854c7j1rvj1gsr8aca250";
inherit dependencies buildDependencies features;
};
mio_0_6_15_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "mio";
version = "0.6.15";
authors = [ "Carl Lerche <me@carllerche.com>" ];
sha256 = "0a93wxsmkh8x38wxivhn6qdj08pj9f0j3y46p4wv3xclbq8i4aaa";
inherit dependencies buildDependencies features;
};
miow_0_2_1_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "miow";
version = "0.2.1";
authors = [ "Alex Crichton <alex@alexcrichton.com>" ];
sha256 = "14f8zkc6ix7mkyis1vsqnim8m29b6l55abkba3p2yz7j1ibcvrl0";
inherit dependencies buildDependencies features;
};
net2_0_2_33_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "net2";
version = "0.2.33";
authors = [ "Alex Crichton <alex@alexcrichton.com>" ];
sha256 = "1qnmajafgybj5wyxz9iffa8x5wgbwd2znfklmhqj7vl6lw1m65mq";
inherit dependencies buildDependencies features;
};
slab_0_4_0_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "slab";
version = "0.4.0";
authors = [ "Carl Lerche <me@carllerche.com>" ];
sha256 = "1qy2vkgwqgj5z4ygdkh040n9yh1vz80v5flxb1xrvw3i4wxs7yx0";
inherit dependencies buildDependencies features;
};
statusmerge_0_1_0_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "statusmerge";
version = "0.1.0";
authors = [ "Thomas Kerber <tk@drwx.org>" ];
src = ./.;
inherit dependencies buildDependencies features;
};
strfmt_0_1_6_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "strfmt";
version = "0.1.6";
authors = [ "Garrett Berg <vitiral@gmail.com>" ];
sha256 = "0qvin5hgl4xrc6fygc8f1acs13bmmjmj88hzgk1p8jwhb4a5hmwq";
inherit dependencies buildDependencies features;
};
winapi_0_2_8_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "winapi";
version = "0.2.8";
authors = [ "Peter Atashian <retep998@gmail.com>" ];
sha256 = "0a45b58ywf12vb7gvj6h3j264nydynmzyqz8d8rqxsj6icqv82as";
inherit dependencies buildDependencies features;
};
winapi_0_3_5_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "winapi";
version = "0.3.5";
authors = [ "Peter Atashian <retep998@gmail.com>" ];
sha256 = "0cfdsxa5yf832r5i2z7dhdvnryyvhfp3nb32gpcaq502zgjdm3w6";
build = "build.rs";
inherit dependencies buildDependencies features;
};
winapi_build_0_1_1_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "winapi-build";
version = "0.1.1";
authors = [ "Peter Atashian <retep998@gmail.com>" ];
sha256 = "1lxlpi87rkhxcwp2ykf1ldw3p108hwm24nywf3jfrvmff4rjhqga";
libName = "build";
inherit dependencies buildDependencies features;
};
winapi_i686_pc_windows_gnu_0_4_0_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "winapi-i686-pc-windows-gnu";
version = "0.4.0";
authors = [ "Peter Atashian <retep998@gmail.com>" ];
sha256 = "05ihkij18r4gamjpxj4gra24514can762imjzlmak5wlzidplzrp";
build = "build.rs";
inherit dependencies buildDependencies features;
};
winapi_x86_64_pc_windows_gnu_0_4_0_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "winapi-x86_64-pc-windows-gnu";
version = "0.4.0";
authors = [ "Peter Atashian <retep998@gmail.com>" ];
sha256 = "0n1ylmlsb8yg1v583i4xy0qmqg42275flvbc51hdqjjfjcl9vlbj";
build = "build.rs";
inherit dependencies buildDependencies features;
};
ws2_32_sys_0_2_1_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "ws2_32-sys";
version = "0.2.1";
authors = [ "Peter Atashian <retep998@gmail.com>" ];
sha256 = "1zpy9d9wk11sj17fczfngcj28w4xxjs3b4n036yzpy38dxp4f7kc";
libName = "ws2_32";
build = "build.rs";
inherit dependencies buildDependencies features;
};
bitflags_1_0_3 = { features?(bitflags_1_0_3_features {}) }: bitflags_1_0_3_ {
features = mkFeatures (features.bitflags_1_0_3 or {});
};
bitflags_1_0_3_features = f: updateFeatures f (rec {
bitflags_1_0_3.default = (f.bitflags_1_0_3.default or true);
}) [];
cfg_if_0_1_4 = { features?(cfg_if_0_1_4_features {}) }: cfg_if_0_1_4_ {};
cfg_if_0_1_4_features = f: updateFeatures f (rec {
cfg_if_0_1_4.default = (f.cfg_if_0_1_4.default or true);
}) [];
fuchsia_zircon_0_3_3 = { features?(fuchsia_zircon_0_3_3_features {}) }: fuchsia_zircon_0_3_3_ {
dependencies = mapFeatures features ([ bitflags_1_0_3 fuchsia_zircon_sys_0_3_3 ]);
};
fuchsia_zircon_0_3_3_features = f: updateFeatures f (rec {
bitflags_1_0_3.default = true;
fuchsia_zircon_0_3_3.default = (f.fuchsia_zircon_0_3_3.default or true);
fuchsia_zircon_sys_0_3_3.default = true;
}) [ bitflags_1_0_3_features fuchsia_zircon_sys_0_3_3_features ];
fuchsia_zircon_sys_0_3_3 = { features?(fuchsia_zircon_sys_0_3_3_features {}) }: fuchsia_zircon_sys_0_3_3_ {};
fuchsia_zircon_sys_0_3_3_features = f: updateFeatures f (rec {
fuchsia_zircon_sys_0_3_3.default = (f.fuchsia_zircon_sys_0_3_3.default or true);
}) [];
iovec_0_1_2 = { features?(iovec_0_1_2_features {}) }: iovec_0_1_2_ {
dependencies = (if (kernel == "linux" || kernel == "darwin") then mapFeatures features ([ libc_0_2_42 ]) else [])
++ (if kernel == "windows" then mapFeatures features ([ winapi_0_2_8 ]) else []);
};
iovec_0_1_2_features = f: updateFeatures f (rec {
iovec_0_1_2.default = (f.iovec_0_1_2.default or true);
libc_0_2_42.default = true;
winapi_0_2_8.default = true;
}) [ libc_0_2_42_features winapi_0_2_8_features ];
kernel32_sys_0_2_2 = { features?(kernel32_sys_0_2_2_features {}) }: kernel32_sys_0_2_2_ {
dependencies = mapFeatures features ([ winapi_0_2_8 ]);
buildDependencies = mapFeatures features ([ winapi_build_0_1_1 ]);
};
kernel32_sys_0_2_2_features = f: updateFeatures f (rec {
kernel32_sys_0_2_2.default = (f.kernel32_sys_0_2_2.default or true);
winapi_0_2_8.default = true;
winapi_build_0_1_1.default = true;
}) [ winapi_0_2_8_features winapi_build_0_1_1_features ];
lazycell_0_6_0 = { features?(lazycell_0_6_0_features {}) }: lazycell_0_6_0_ {
dependencies = mapFeatures features ([]);
features = mkFeatures (features.lazycell_0_6_0 or {});
};
lazycell_0_6_0_features = f: updateFeatures f (rec {
lazycell_0_6_0.clippy =
(f.lazycell_0_6_0.clippy or false) ||
(f.lazycell_0_6_0.nightly-testing or false) ||
(lazycell_0_6_0.nightly-testing or false);
lazycell_0_6_0.default = (f.lazycell_0_6_0.default or true);
lazycell_0_6_0.nightly =
(f.lazycell_0_6_0.nightly or false) ||
(f.lazycell_0_6_0.nightly-testing or false) ||
(lazycell_0_6_0.nightly-testing or false);
}) [];
libc_0_2_42 = { features?(libc_0_2_42_features {}) }: libc_0_2_42_ {
features = mkFeatures (features.libc_0_2_42 or {});
};
libc_0_2_42_features = f: updateFeatures f (rec {
libc_0_2_42.default = (f.libc_0_2_42.default or true);
libc_0_2_42.use_std =
(f.libc_0_2_42.use_std or false) ||
(f.libc_0_2_42.default or false) ||
(libc_0_2_42.default or false);
}) [];
log_0_4_3 = { features?(log_0_4_3_features {}) }: log_0_4_3_ {
dependencies = mapFeatures features ([ cfg_if_0_1_4 ]);
features = mkFeatures (features.log_0_4_3 or {});
};
log_0_4_3_features = f: updateFeatures f (rec {
cfg_if_0_1_4.default = true;
log_0_4_3.default = (f.log_0_4_3.default or true);
}) [ cfg_if_0_1_4_features ];
mio_0_6_15 = { features?(mio_0_6_15_features {}) }: mio_0_6_15_ {
dependencies = mapFeatures features ([ iovec_0_1_2 lazycell_0_6_0 log_0_4_3 net2_0_2_33 slab_0_4_0 ])
++ (if kernel == "fuchsia" then mapFeatures features ([ fuchsia_zircon_0_3_3 fuchsia_zircon_sys_0_3_3 ]) else [])
++ (if (kernel == "linux" || kernel == "darwin") then mapFeatures features ([ libc_0_2_42 ]) else [])
++ (if kernel == "windows" then mapFeatures features ([ kernel32_sys_0_2_2 miow_0_2_1 winapi_0_2_8 ]) else []);
features = mkFeatures (features.mio_0_6_15 or {});
};
mio_0_6_15_features = f: updateFeatures f (rec {
fuchsia_zircon_0_3_3.default = true;
fuchsia_zircon_sys_0_3_3.default = true;
iovec_0_1_2.default = true;
kernel32_sys_0_2_2.default = true;
lazycell_0_6_0.default = true;
libc_0_2_42.default = true;
log_0_4_3.default = true;
mio_0_6_15.default = (f.mio_0_6_15.default or true);
mio_0_6_15.with-deprecated =
(f.mio_0_6_15.with-deprecated or false) ||
(f.mio_0_6_15.default or false) ||
(mio_0_6_15.default or false);
miow_0_2_1.default = true;
net2_0_2_33.default = true;
slab_0_4_0.default = true;
winapi_0_2_8.default = true;
}) [ iovec_0_1_2_features lazycell_0_6_0_features log_0_4_3_features net2_0_2_33_features slab_0_4_0_features fuchsia_zircon_0_3_3_features fuchsia_zircon_sys_0_3_3_features libc_0_2_42_features kernel32_sys_0_2_2_features miow_0_2_1_features winapi_0_2_8_features ];
miow_0_2_1 = { features?(miow_0_2_1_features {}) }: miow_0_2_1_ {
dependencies = mapFeatures features ([ kernel32_sys_0_2_2 net2_0_2_33 winapi_0_2_8 ws2_32_sys_0_2_1 ]);
};
miow_0_2_1_features = f: updateFeatures f (rec {
kernel32_sys_0_2_2.default = true;
miow_0_2_1.default = (f.miow_0_2_1.default or true);
net2_0_2_33.default = (f.net2_0_2_33.default or false);
winapi_0_2_8.default = true;
ws2_32_sys_0_2_1.default = true;
}) [ kernel32_sys_0_2_2_features net2_0_2_33_features winapi_0_2_8_features ws2_32_sys_0_2_1_features ];
net2_0_2_33 = { features?(net2_0_2_33_features {}) }: net2_0_2_33_ {
dependencies = mapFeatures features ([ cfg_if_0_1_4 ])
++ (if kernel == "redox" || (kernel == "linux" || kernel == "darwin") then mapFeatures features ([ libc_0_2_42 ]) else [])
++ (if kernel == "windows" then mapFeatures features ([ winapi_0_3_5 ]) else []);
features = mkFeatures (features.net2_0_2_33 or {});
};
net2_0_2_33_features = f: updateFeatures f (rec {
cfg_if_0_1_4.default = true;
libc_0_2_42.default = true;
net2_0_2_33.default = (f.net2_0_2_33.default or true);
net2_0_2_33.duration =
(f.net2_0_2_33.duration or false) ||
(f.net2_0_2_33.default or false) ||
(net2_0_2_33.default or false);
winapi_0_3_5.default = true;
winapi_0_3_5.handleapi = true;
winapi_0_3_5.winsock2 = true;
winapi_0_3_5.ws2def = true;
winapi_0_3_5.ws2ipdef = true;
winapi_0_3_5.ws2tcpip = true;
}) [ cfg_if_0_1_4_features libc_0_2_42_features winapi_0_3_5_features ];
slab_0_4_0 = { features?(slab_0_4_0_features {}) }: slab_0_4_0_ {};
slab_0_4_0_features = f: updateFeatures f (rec {
slab_0_4_0.default = (f.slab_0_4_0.default or true);
}) [];
statusmerge_0_1_0 = { features?(statusmerge_0_1_0_features {}) }: statusmerge_0_1_0_ {
dependencies = mapFeatures features ([ mio_0_6_15 strfmt_0_1_6 ]);
};
statusmerge_0_1_0_features = f: updateFeatures f (rec {
mio_0_6_15.default = true;
statusmerge_0_1_0.default = (f.statusmerge_0_1_0.default or true);
strfmt_0_1_6.default = true;
}) [ mio_0_6_15_features strfmt_0_1_6_features ];
strfmt_0_1_6 = { features?(strfmt_0_1_6_features {}) }: strfmt_0_1_6_ {};
strfmt_0_1_6_features = f: updateFeatures f (rec {
strfmt_0_1_6.default = (f.strfmt_0_1_6.default or true);
}) [];
winapi_0_2_8 = { features?(winapi_0_2_8_features {}) }: winapi_0_2_8_ {};
winapi_0_2_8_features = f: updateFeatures f (rec {
winapi_0_2_8.default = (f.winapi_0_2_8.default or true);
}) [];
winapi_0_3_5 = { features?(winapi_0_3_5_features {}) }: winapi_0_3_5_ {
dependencies = (if kernel == "i686-pc-windows-gnu" then mapFeatures features ([ winapi_i686_pc_windows_gnu_0_4_0 ]) else [])
++ (if kernel == "x86_64-pc-windows-gnu" then mapFeatures features ([ winapi_x86_64_pc_windows_gnu_0_4_0 ]) else []);
features = mkFeatures (features.winapi_0_3_5 or {});
};
winapi_0_3_5_features = f: updateFeatures f (rec {
winapi_0_3_5.default = (f.winapi_0_3_5.default or true);
winapi_i686_pc_windows_gnu_0_4_0.default = true;
winapi_x86_64_pc_windows_gnu_0_4_0.default = true;
}) [ winapi_i686_pc_windows_gnu_0_4_0_features winapi_x86_64_pc_windows_gnu_0_4_0_features ];
winapi_build_0_1_1 = { features?(winapi_build_0_1_1_features {}) }: winapi_build_0_1_1_ {};
winapi_build_0_1_1_features = f: updateFeatures f (rec {
winapi_build_0_1_1.default = (f.winapi_build_0_1_1.default or true);
}) [];
winapi_i686_pc_windows_gnu_0_4_0 = { features?(winapi_i686_pc_windows_gnu_0_4_0_features {}) }: winapi_i686_pc_windows_gnu_0_4_0_ {};
winapi_i686_pc_windows_gnu_0_4_0_features = f: updateFeatures f (rec {
winapi_i686_pc_windows_gnu_0_4_0.default = (f.winapi_i686_pc_windows_gnu_0_4_0.default or true);
}) [];
winapi_x86_64_pc_windows_gnu_0_4_0 = { features?(winapi_x86_64_pc_windows_gnu_0_4_0_features {}) }: winapi_x86_64_pc_windows_gnu_0_4_0_ {};
winapi_x86_64_pc_windows_gnu_0_4_0_features = f: updateFeatures f (rec {
winapi_x86_64_pc_windows_gnu_0_4_0.default = (f.winapi_x86_64_pc_windows_gnu_0_4_0.default or true);
}) [];
ws2_32_sys_0_2_1 = { features?(ws2_32_sys_0_2_1_features {}) }: ws2_32_sys_0_2_1_ {
dependencies = mapFeatures features ([ winapi_0_2_8 ]);
buildDependencies = mapFeatures features ([ winapi_build_0_1_1 ]);
};
ws2_32_sys_0_2_1_features = f: updateFeatures f (rec {
winapi_0_2_8.default = true;
winapi_build_0_1_1.default = true;
ws2_32_sys_0_2_1.default = (f.ws2_32_sys_0_2_1.default or true);
}) [ winapi_0_2_8_features winapi_build_0_1_1_features ];
}

+ 8
- 0
Cargo.toml View File

@@ -0,0 +1,8 @@
[package]
name = "statusmerge"
version = "0.1.0"
authors = ["Thomas Kerber <tk@drwx.org>"]

[dependencies]
mio = "*"
strfmt = "*"

+ 4
- 0
default.nix View File

@@ -0,0 +1,4 @@
{ pkgs ? import <nixpkgs> { }}:
with pkgs;

((callPackage ./Cargo.nix { }).statusmerge { })

+ 45
- 0
src/main.rs View File

@@ -0,0 +1,45 @@
extern crate mio;
extern crate strfmt;

use std::os::unix::io::AsRawFd;
use std::collections::HashMap;
use std::env::args;
use std::io::Read;
use std::fs::File;

use mio::{Poll, Events, Token, Ready, PollOpt};
use mio::unix::EventedFd;
use strfmt::strfmt;

fn main() {
let mut args = args().skip(1);
let fmt = args.next().expect("format string expected");
let mut files: Vec<_> = args.map(|arg| {
File::open(&arg).expect(&format!("Failed to open {}", &arg))
}).collect();
let poll = Poll::new().unwrap();
for (i, file) in files.iter().enumerate() {
let fd = file.as_raw_fd();
let handle = EventedFd(&fd);
let token = Token(i);
poll.register(&handle, token, Ready::readable(), PollOpt::edge()).unwrap();
};

let mut events = Events::with_capacity(8);
let mut data = [0u8; 4096];
let mut curr: HashMap<String, _> = files.iter().enumerate()
.map(|(i, _)| (format!("{}", i), String::new())).collect();

loop {
poll.poll(&mut events, None).unwrap();
for event in &events {
let n = files[event.token().0].read(&mut data[..]).unwrap();
if n > 0 {
curr.insert(
format!("{}", event.token().0),
String::from_utf8_lossy(&data[..n - 1]).into_owned());
}
};
println!("{}", strfmt(&fmt, &curr).unwrap());
}
}

Loading…
Cancel
Save