Package: mdevctl
Version: 1.1.0-2
Severity: serious

Note: I did my testing with version 1.2.0-1 from unstable, but i'm pretty sure 
the
issues apply equally to the version in testing.

mdevctl FTVFS with the new 1.x upload of rust-uuid. There are three issues.

1. The Debian build- dependency is unsatisfiable, librust-uuid+rand-dev is no 
longer
   provided by the new version of rust-uuid, because upstream no longer has a 
"rand"
   feature.
2. The cargo dependency is unsatisfiable, because the style of dependency used 
has
   an implicit upper version limit per semver.
3. hyphenated has been renamed to "hyphenated" in uuid 1.x

The attatched debdiff fixes the abover issues and also fixes incomplete cleanup
by the clean target. I have tested that the package builds with the patch but
I have not tested it beyond that.

I may or may not NMU this later.
diff -Nru mdevctl-1.2.0/debian/changelog mdevctl-1.2.0/debian/changelog
--- mdevctl-1.2.0/debian/changelog      2022-08-09 11:24:25.000000000 +0000
+++ mdevctl-1.2.0/debian/changelog      2022-08-14 23:04:02.000000000 +0000
@@ -1,3 +1,11 @@
+mdevctl (1.2.0-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add patch for rust-uuid 1.x and update dependencies accordingly
+  * Fix clean target.
+
+ -- Peter Micheal Green <plugw...@debian.org>  Sun, 14 Aug 2022 23:04:02 +0000
+
 mdevctl (1.2.0-1) unstable; urgency=medium
 
   [ Athos Ribeiro ]
diff -Nru mdevctl-1.2.0/debian/control mdevctl-1.2.0/debian/control
--- mdevctl-1.2.0/debian/control        2022-08-09 11:24:25.000000000 +0000
+++ mdevctl-1.2.0/debian/control        2022-08-14 23:04:02.000000000 +0000
@@ -14,7 +14,7 @@
                librust-clap-complete-dev (>= 3.0.6),
                librust-clap+strsim-dev,
                librust-tempfile-dev (>= 3.1.0) <!nocheck>,
-               librust-uuid+rand-dev (>= 0.8.1),
+               librust-uuid-1+v4-dev,
                pkg-config,
                python3-docutils,
                systemd,
diff -Nru mdevctl-1.2.0/debian/patches/lower-versions-for-unstable.patch 
mdevctl-1.2.0/debian/patches/lower-versions-for-unstable.patch
--- mdevctl-1.2.0/debian/patches/lower-versions-for-unstable.patch      
2022-08-09 11:24:25.000000000 +0000
+++ mdevctl-1.2.0/debian/patches/lower-versions-for-unstable.patch      
2022-08-14 23:04:02.000000000 +0000
@@ -5,8 +5,10 @@
 X-Not-Forwarded-Reason: Currently frozen, but likely available after the 
release
 Author: Christian Ehrhardt <christian.ehrha...@canonical.com>
 Last-Update: 2021-07-14
---- a/Cargo.toml
-+++ b/Cargo.toml
+Index: mdevctl-1.2.0/Cargo.toml
+===================================================================
+--- mdevctl-1.2.0.orig/Cargo.toml
++++ mdevctl-1.2.0/Cargo.toml
 @@ -13,14 +13,14 @@ homepage = "https://github.com/mdevctl/m
  
  [dependencies]
@@ -17,13 +19,11 @@
 +env_logger = "0.9.0"
  log = "0.4"
  serde_json = {version = "1.0", features = ["preserve_order"]}
--uuid = {version = "0.8.2", features = ["v4"]}
-+uuid = {version = "0.8.1", features = ["v4"]}
+ uuid = {version = "0.8.2", features = ["v4"]}
  tempfile = "3"
  
  [build-dependencies]
 -clap = { version = "3.1.18", features = ["derive"]}
 +clap = { version = "3.1.7", features = ["derive"]}
  clap_complete = "3.0.6"
--uuid = "0.8.2"
-+uuid = "0.8.1"
+ uuid = "0.8.2"
diff -Nru mdevctl-1.2.0/debian/patches/series 
mdevctl-1.2.0/debian/patches/series
--- mdevctl-1.2.0/debian/patches/series 2022-08-09 11:24:25.000000000 +0000
+++ mdevctl-1.2.0/debian/patches/series 2022-08-14 23:04:02.000000000 +0000
@@ -1,2 +1,3 @@
 lower-versions-for-unstable.patch
 main-binary-already-installed.patch
+uuid-1.0.patch
diff -Nru mdevctl-1.2.0/debian/patches/uuid-1.0.patch 
mdevctl-1.2.0/debian/patches/uuid-1.0.patch
--- mdevctl-1.2.0/debian/patches/uuid-1.0.patch 1970-01-01 00:00:00.000000000 
+0000
+++ mdevctl-1.2.0/debian/patches/uuid-1.0.patch 2022-08-14 23:04:02.000000000 
+0000
@@ -0,0 +1,233 @@
+Index: mdevctl-1.2.0/src/main.rs
+===================================================================
+--- mdevctl-1.2.0.orig/src/main.rs
++++ mdevctl-1.2.0/src/main.rs
+@@ -81,7 +81,7 @@ fn define_command_helper(
+             return Err(anyhow!(
+                 "Cowardly refusing to overwrite existing config for {}/{}",
+                 parent,
+-                uuid.to_hyphenated().to_string()
++                uuid.hyphenated().to_string()
+             ));
+         }
+ 
+@@ -115,7 +115,7 @@ fn define_command_helper(
+         if dev.is_defined() {
+             return Err(anyhow!(
+                 "Device {} on {} already defined",
+-                dev.uuid.to_hyphenated().to_string(),
++                dev.uuid.hyphenated().to_string(),
+                 dev.parent()?
+             ));
+         }
+@@ -149,7 +149,7 @@ fn define_command(
+     }
+     Callout::invoke(&mut dev, Action::Define, |dev| dev.define()).map(|_| {
+         if uuid.is_none() {
+-            println!("{}", dev.uuid.to_hyphenated());
++            println!("{}", dev.uuid.hyphenated());
+         }
+     })
+ }
+@@ -247,7 +247,7 @@ fn start_command_helper(
+                     Ordering::Greater => {
+                         return Err(anyhow!(
+                             "Multiple definitions found for device {}. Please 
specify a parent.",
+-                            uuid.unwrap().to_hyphenated().to_string()
++                            uuid.unwrap().hyphenated().to_string()
+                         ));
+                     }
+                     Ordering::Equal => {
+@@ -260,7 +260,7 @@ fn start_command_helper(
+                             if mdev_type.is_some() && mdev_type != 
d.mdev_type {
+                                 return Err(anyhow!(
+                                     "Device {} already exists on parent {} 
with type {}",
+-                                    d.uuid.to_hyphenated().to_string(),
++                                    d.uuid.hyphenated().to_string(),
+                                     d.parent().unwrap(),
+                                     d.mdev_type.as_ref().unwrap()
+                                 ));
+@@ -305,7 +305,7 @@ fn start_command(
+ 
+     Callout::invoke(&mut dev, Action::Start, |dev| dev.start()).map(|_| {
+         if uuid.is_none() {
+-            println!("{}", dev.uuid.to_hyphenated());
++            println!("{}", dev.uuid.hyphenated());
+         }
+     })
+ }
+@@ -330,24 +330,24 @@ fn get_defined_device<'a>(
+         return match parent {
+             None => Err(anyhow!(
+                 "Mediated device {} is not defined",
+-                uuid.to_hyphenated().to_string()
++                uuid.hyphenated().to_string()
+             )),
+             Some(p) => Err(anyhow!(
+                 "Mediated device {}/{} is not defined",
+                 p,
+-                uuid.to_hyphenated().to_string()
++                uuid.hyphenated().to_string()
+             )),
+         };
+     } else if devs.len() > 1 {
+         return match parent {
+             None => Err(anyhow!(
+                 "Multiple definitions found for {}, specify a parent",
+-                uuid.to_hyphenated().to_string()
++                uuid.hyphenated().to_string()
+             )),
+             Some(p) => Err(anyhow!(
+                 "Multiple definitions found for {}/{}",
+                 p,
+-                uuid.to_hyphenated().to_string()
++                uuid.hyphenated().to_string()
+             )),
+         };
+     } else {
+@@ -356,7 +356,7 @@ fn get_defined_device<'a>(
+             return Err(anyhow!(
+                 "Multiple definitions found for {}/{}",
+                 parent,
+-                uuid.to_hyphenated().to_string()
++                uuid.hyphenated().to_string()
+             ));
+         }
+         return Ok(children.get(0).unwrap().clone());
+Index: mdevctl-1.2.0/Cargo.toml
+===================================================================
+--- mdevctl-1.2.0.orig/Cargo.toml
++++ mdevctl-1.2.0/Cargo.toml
+@@ -17,10 +17,10 @@ clap = { version = "3.1.7", features = [
+ env_logger = "0.9.0"
+ log = "0.4"
+ serde_json = {version = "1.0", features = ["preserve_order"]}
+-uuid = {version = "0.8.2", features = ["v4"]}
++uuid = {version = "1.0.0", features = ["v4"]}
+ tempfile = "3"
+ 
+ [build-dependencies]
+ clap = { version = "3.1.7", features = ["derive"]}
+ clap_complete = "3.0.6"
+-uuid = "0.8.2"
++uuid = "1.0.0"
+Index: mdevctl-1.2.0/src/callouts.rs
+===================================================================
+--- mdevctl-1.2.0.orig/src/callouts.rs
++++ mdevctl-1.2.0/src/callouts.rs
+@@ -139,7 +139,7 @@ impl Callout {
+                     if &st == "[{}]" {
+                         debug!(
+                             "Attribute field for {} is empty",
+-                            dev.uuid.to_hyphenated().to_string()
++                            dev.uuid.hyphenated().to_string()
+                         );
+                         st = "[]".to_string();
+                     }
+Index: mdevctl-1.2.0/src/mdev.rs
+===================================================================
+--- mdevctl-1.2.0.orig/src/mdev.rs
++++ mdevctl-1.2.0/src/mdev.rs
+@@ -43,7 +43,7 @@ impl<'a> MDev<'a> {
+ 
+     pub fn path(&self) -> PathBuf {
+         let mut p = self.env.mdev_base();
+-        p.push(self.uuid.to_hyphenated().to_string());
++        p.push(self.uuid.hyphenated().to_string());
+         p
+     }
+ 
+@@ -52,7 +52,7 @@ impl<'a> MDev<'a> {
+         self.parent.as_ref().ok_or_else(|| {
+             anyhow!(
+                 "Device {} is missing a parent",
+-                self.uuid.to_hyphenated().to_string()
++                self.uuid.hyphenated().to_string()
+             )
+         })
+     }
+@@ -62,7 +62,7 @@ impl<'a> MDev<'a> {
+         self.mdev_type.as_ref().ok_or_else(|| {
+             anyhow!(
+                 "Device {} is missing a mdev_type",
+-                self.uuid.to_hyphenated().to_string()
++                self.uuid.hyphenated().to_string()
+             )
+         })
+     }
+@@ -71,7 +71,7 @@ impl<'a> MDev<'a> {
+         self.parent.as_ref().map(|x| {
+             let mut path = self.env.persist_base();
+             path.push(x);
+-            path.push(self.uuid.to_hyphenated().to_string());
++            path.push(self.uuid.hyphenated().to_string());
+             path
+         })
+     }
+@@ -215,7 +215,7 @@ impl<'a> MDev<'a> {
+             }
+         }
+ 
+-        let mut output = self.uuid.to_hyphenated().to_string();
++        let mut output = self.uuid.hyphenated().to_string();
+         output.push(' ');
+         output.push_str(self.parent()?);
+         output.push(' ');
+@@ -265,7 +265,7 @@ impl<'a> MDev<'a> {
+             .collect();
+         partial.insert("attrs".to_string(), jsonattrs.into());
+ 
+-        let full = serde_json::json!({ self.uuid.to_hyphenated().to_string(): 
partial });
++        let full = serde_json::json!({ self.uuid.hyphenated().to_string(): 
partial });
+ 
+         match include_uuid {
+             true => Ok(full),
+@@ -360,7 +360,7 @@ impl<'a> MDev<'a> {
+         path.pop();
+         path.push("create");
+         debug!("Creating mediated device: {:?} -> {:?}", self.uuid, path);
+-        match fs::write(path, self.uuid.to_hyphenated().to_string()) {
++        match fs::write(path, self.uuid.hyphenated().to_string()) {
+             Ok(_) => {
+                 self.active = true;
+                 Ok(())
+@@ -368,7 +368,7 @@ impl<'a> MDev<'a> {
+             Err(e) => Err(e).with_context(|| {
+                 format!(
+                     "Failed to create mdev {}, type {} on {}",
+-                    self.uuid.to_hyphenated(),
++                    self.uuid.hyphenated(),
+                     mdev_type,
+                     parent
+                 )
+@@ -409,7 +409,7 @@ impl<'a> MDev<'a> {
+         let p = self.persist_path().ok_or_else(|| {
+             anyhow!(
+                 "Failed to undefine {}",
+-                self.uuid.to_hyphenated().to_string()
++                self.uuid.hyphenated().to_string()
+             )
+         })?;
+ 
+Index: mdevctl-1.2.0/src/tests.rs
+===================================================================
+--- mdevctl-1.2.0.orig/src/tests.rs
++++ mdevctl-1.2.0/src/tests.rs
+@@ -210,7 +210,7 @@ fn test_load_json_helper(uuid: &str, par
+         let jsonstr = serde_json::to_string_pretty(&jsonval).unwrap();
+ 
+         test.compare_to_file(&format!("{}.out", uuid), &jsonstr);
+-        assert_eq!(uuid, dev.uuid.to_hyphenated().to_string());
++        assert_eq!(uuid, dev.uuid.hyphenated().to_string());
+         assert_eq!(Some(parent.to_string()), dev.parent);
+     }
+ }
+@@ -846,7 +846,7 @@ fn test_start_helper<F>(
+             assert_eq!(uuid.unwrap(), dev.uuid);
+         }
+         let contents = fs::read_to_string(create_path).expect("Unable to read 
'create' file");
+-        assert_eq!(dev.uuid.to_hyphenated().to_string(), contents);
++        assert_eq!(dev.uuid.hyphenated().to_string(), contents);
+     }
+ }
+ 
diff -Nru mdevctl-1.2.0/debian/rules mdevctl-1.2.0/debian/rules
--- mdevctl-1.2.0/debian/rules  2022-08-09 11:24:25.000000000 +0000
+++ mdevctl-1.2.0/debian/rules  2022-08-14 23:04:02.000000000 +0000
@@ -33,3 +33,7 @@
        dh_auto_test $@
 endif
 endif
+
+execute_after_dh_auto_clean:
+       rm -f mdevctl.spec Makefile
+

Reply via email to