From 3a28dfc8d544994ed695506d770fa26552f4b26e Mon Sep 17 00:00:00 2001
From: Konstantin Stepanov <me@kstep.me>
Date: Wed, 8 Jun 2016 16:07:56 +0300
Subject: [PATCH] dependencies update

---
 Cargo.lock         | 62 ++++++++++++++++++----------------------------
 Cargo.toml         |  4 +--
 pkg/PKGBUILD       |  4 +--
 src/bin/crontab.rs | 12 ++++-----
 4 files changed, 34 insertions(+), 48 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock
index 530f31b..04410c7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,25 +1,25 @@
 [root]
 name = "systemd-crontab-generator"
-version = "1.0.0"
+version = "1.0.1"
 dependencies = [
  "cronparse 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "docopt 0.6.80 (registry+https://github.com/rust-lang/crates.io-index)",
  "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "handlebars 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "kernlog 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "md5 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "pgs-files 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
  "tempfile 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
- "users 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "users 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "aho-corasick"
-version = "0.5.1"
+version = "0.5.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -35,7 +35,7 @@ name = "docopt"
 version = "0.6.80"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "regex 0.1.66 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.1.71 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
  "strsim 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -54,7 +54,7 @@ dependencies = [
  "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "num 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
  "quick-error 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.1.66 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.1.71 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -63,7 +63,7 @@ name = "kernel32-sys"
 version = "0.2.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -87,7 +87,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "libc"
-version = "0.2.10"
+version = "0.2.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -105,7 +105,7 @@ name = "memchr"
 version = "0.1.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -192,24 +192,24 @@ name = "rand"
 version = "0.3.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "regex"
-version = "0.1.66"
+version = "0.1.71"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "aho-corasick 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "aho-corasick 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex-syntax 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "thread_local 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex-syntax 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "thread_local 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "regex-syntax"
-version = "0.3.1"
+version = "0.3.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -228,9 +228,9 @@ version = "1.1.3"
 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)",
- "libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -239,16 +239,15 @@ version = "2.0.0"
 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)",
- "libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "thread_local"
-version = "0.2.3"
+version = "0.2.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -257,24 +256,16 @@ version = "0.1.35"
 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)",
- "libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "unreachable"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "users"
-version = "0.4.4"
+version = "0.5.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -282,14 +273,9 @@ name = "utf8-ranges"
 version = "0.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
-[[package]]
-name = "void"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
 [[package]]
 name = "winapi"
-version = "0.2.6"
+version = "0.2.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
diff --git a/Cargo.toml b/Cargo.toml
index 5104012..8ad24ad 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,7 +7,7 @@ license = "MIT"
 name = "systemd-crontab-generator"
 readme = "README.md"
 repository = "https://github.com/systemd-cron/systemd-cron-next"
-version = "1.0.1"
+version = "1.0.2"
 
 [build-dependencies]
 handlebars = "0.12.0"
@@ -25,7 +25,7 @@ pgs-files = "0.0.6"
 rustc-serialize = "0.3.16"
 tempfile = "1.1.3"
 time = "0.1.34"
-users = "0.4.4"
+users = "0.5.1"
 
 [features]
 default = ["sched-boot", "sched-hourly", "sched-daily", "sched-weekly", "sched-monthly", "randomized-delay"]
diff --git a/pkg/PKGBUILD b/pkg/PKGBUILD
index db5812f..79cffe6 100644
--- a/pkg/PKGBUILD
+++ b/pkg/PKGBUILD
@@ -1,7 +1,7 @@
 # Maintainer: Konstantin Stepanov <me@kstep.me>
 pkgname=systemd-cron-next
-pkgver=1.0.1
-_gitver=1.0.1
+pkgver=1.0.2
+_gitver=1.0.2
 pkgrel=1
 pkgdesc="systemd generator to generate timers/services from crontab and anacrontab files"
 url="https://github.com/systemd-cron/systemd-cron-next"
diff --git a/src/bin/crontab.rs b/src/bin/crontab.rs
index 06f0842..e47480c 100644
--- a/src/bin/crontab.rs
+++ b/src/bin/crontab.rs
@@ -117,7 +117,7 @@ fn list(cron_file: &Path, cron_user: &User, _args: &Args) -> i32 {
     if let Err(e) = File::open(cron_file).map(|mut file| copy(&mut file, &mut stdout())) {
         use std::io::ErrorKind::*;
         match e.kind() {
-            NotFound => println!("no crontab for {}", cron_user.name),
+            NotFound => println!("no crontab for {}", cron_user.name()),
             _ => println!("failed to read {}: {}", cron_file.display(), e),
         }
         return 1;
@@ -132,7 +132,7 @@ fn remove(cron_file: &Path, cron_user: &User, args: &Args) -> i32 {
         if let Err(e) = fs::remove_file(cron_file) {
             use std::io::ErrorKind::*;
             match e.kind() {
-                    NotFound => writeln!(stderr, "no crontab for {}", cron_user.name),
+                    NotFound => writeln!(stderr, "no crontab for {}", cron_user.name()),
                     _ => writeln!(stderr, "failed to remove {}: {}", cron_file.display(), e),
                 }
                 .unwrap();
@@ -194,8 +194,8 @@ fn edit(cron_file: &Path, cron_user: &User, _args: &Args) -> i32 {
 
     tmpfile.flush().unwrap();
     {
-        change_owner(tmpfile.path(), cron_user.uid, cron_user.primary_group).unwrap();
-        let _guard = users::switch_user_group(cron_user.uid, cron_user.primary_group);
+        change_owner(tmpfile.path(), cron_user.uid(), cron_user.primary_group_id()).unwrap();
+        let _guard = users::switch::switch_user_group(cron_user.uid(), cron_user.primary_group_id());
         match Command::new(editor).arg(tmpfile.path()).status() {
             Ok(status) if status.success() => (),
             _ => {
@@ -250,7 +250,7 @@ fn replace(cron_file: &Path, cron_user: &User, args: &Args) -> i32 {
         return 1;
     }
 
-    change_owner(cron_file, cron_user.uid, cron_user.primary_group).unwrap();
+    change_owner(cron_file, cron_user.uid(), cron_user.primary_group_id()).unwrap();
 
     0
 }
@@ -292,7 +292,7 @@ fn main() {
         _ => (),
     }
 
-    let cron_file = PathBuf::from(USERS_CRONTAB_DIR).join(cron_user.name.clone());
+    let cron_file = PathBuf::from(USERS_CRONTAB_DIR).join(cron_user.name());
 
     exit(match args {
         Args { flag_show: true, .. } => show(&*cron_file, &cron_user, &args),