Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ripcalc for openSUSE:Factory checked 
in at 2025-04-28 16:16:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ripcalc (Old)
 and      /work/SRC/openSUSE:Factory/.ripcalc.new.30101 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ripcalc"

Mon Apr 28 16:16:30 2025 rev:4 rq:1272977 version:0.2.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/ripcalc/ripcalc.changes  2025-04-14 
12:57:57.043161726 +0200
+++ /work/SRC/openSUSE:Factory/.ripcalc.new.30101/ripcalc.changes       
2025-04-28 16:16:46.926278458 +0200
@@ -1,0 +2,6 @@
+Sun Apr 27 05:42:32 UTC 2025 - Andreas Stieger <andreas.stie...@gmx.de>
+
+- Update to version 0.2.5:
+  * performance improvements
+
+-------------------------------------------------------------------

Old:
----
  ripcalc-0.2.4.obscpio
  ripcalc-0.2.4.tar.xz

New:
----
  ripcalc-0.2.5.obscpio
  ripcalc-0.2.5.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ripcalc.spec ++++++
--- /var/tmp/diff_new_pack.rssbDi/_old  2025-04-28 16:16:49.226375158 +0200
+++ /var/tmp/diff_new_pack.rssbDi/_new  2025-04-28 16:16:49.246375999 +0200
@@ -18,7 +18,7 @@
 
 
 Name:           ripcalc
-Version:        0.2.4
+Version:        0.2.5
 Release:        0
 Summary:        Tool for network addresses
 License:        GPL-3.0-or-later

++++++ _service ++++++
--- /var/tmp/diff_new_pack.rssbDi/_old  2025-04-28 16:16:49.694394834 +0200
+++ /var/tmp/diff_new_pack.rssbDi/_new  2025-04-28 16:16:49.718395843 +0200
@@ -5,7 +5,7 @@
     <param name="changesgenerate">enable</param>
     <param name="filename">ripcalc</param>
     <param name="versionformat">@PARENT_TAG@</param>
-    <param name="revision">v0.2.4</param>
+    <param name="revision">v0.2.5</param>
     <param name="versionrewrite-pattern">v(.*)</param>
     <param name="versionrewrite-replacement">\1</param>
   </service>

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.rssbDi/_old  2025-04-28 16:16:49.898403411 +0200
+++ /var/tmp/diff_new_pack.rssbDi/_new  2025-04-28 16:16:49.922404420 +0200
@@ -1,7 +1,7 @@
 <servicedata>
   <service name="tar_scm">
     <param name="url">https://gitlab.com/edneville/ripcalc.git</param>
-    <param 
name="changesrevision">efd8715574f13ebde9faa02df5ebe510b7f7c6e4</param>
+    <param 
name="changesrevision">82536467fd6334900ad3e4bb2d604e20b270b693</param>
   </service>
 </servicedata>
 (No newline at EOF)

++++++ ripcalc-0.2.4.obscpio -> ripcalc-0.2.5.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ripcalc-0.2.4/Cargo.lock new/ripcalc-0.2.5/Cargo.lock
--- old/ripcalc-0.2.4/Cargo.lock        2025-04-11 23:31:54.000000000 +0200
+++ new/ripcalc-0.2.5/Cargo.lock        2025-04-19 22:37:02.000000000 +0200
@@ -166,7 +166,7 @@
 
 [[package]]
 name = "ripcalc"
-version = "0.2.4"
+version = "0.2.5"
 dependencies = [
  "csv",
  "dns-lookup",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ripcalc-0.2.4/Cargo.toml new/ripcalc-0.2.5/Cargo.toml
--- old/ripcalc-0.2.4/Cargo.toml        2025-04-11 23:31:54.000000000 +0200
+++ new/ripcalc-0.2.5/Cargo.toml        2025-04-19 22:37:02.000000000 +0200
@@ -1,7 +1,7 @@
 [package]
 name = "ripcalc"
 description = "ripcalc, format and lookup IP addresses"
-version = "0.2.4"
+version = "0.2.5"
 authors = ["ed neville <e...@s5h.net>"]
 edition = "2018"
 license = "GPL-3.0-or-later"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ripcalc-0.2.4/Makefile new/ripcalc-0.2.5/Makefile
--- old/ripcalc-0.2.4/Makefile  2025-04-11 23:31:54.000000000 +0200
+++ new/ripcalc-0.2.5/Makefile  2025-04-19 22:37:02.000000000 +0200
@@ -64,6 +64,9 @@
        printf -- '-736731135\n' | $(RELEASE) --base -10 --format '%a\n' | grep 
-Fx 212.22.96.1
        printf -- '-13259686110696736936355904651228348417\n' | $(RELEASE) 
--base -10 --format '%a\n' | grep -Fx f606:4700:3035:0:ffff:ffff:ffff:ffff
        printf -- '42540766411282592856903984951653826560\n' | $(RELEASE) 
--base 10 --format '%a\n' | grep -Fx 2001:db8::
+       $(RELEASE) -e 10.0.0.0 10.10.0.0 --group 24 --format '%a/%c %C ' | grep 
-Fx '10.0.0.0/24 1 10.10.0.0/24 1 ' >/dev/null
+       $(RELEASE) -e 10.0.0.0 10.10.0.0 10.10.0.1 --group 24 --format '%a/%c 
%C ' | grep -Fx '10.0.0.0/24 1 10.10.0.0/24 2 ' >/dev/null
+       printf '10.0.0.0 10.10.0.0 10.10.0.1\n' | $(RELEASE) -e --group 24 
--format '%a/%c %C ' | sort -n | paste -sd' ' | grep -Fx '10.0.0.0/32 1 
10.10.0.0/31 2 ' >/dev/null
 
 install: all
        command -v please && please install -m 0755 -s $(RELEASE) 
/usr/local/bin || sudo install -m 0755 -s $(RELEASE) /usr/local/bin 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ripcalc-0.2.4/changelog.md 
new/ripcalc-0.2.5/changelog.md
--- old/ripcalc-0.2.4/changelog.md      2025-04-11 23:31:54.000000000 +0200
+++ new/ripcalc-0.2.5/changelog.md      2025-04-19 22:37:02.000000000 +0200
@@ -1,3 +1,7 @@
+0.2.5
+
+ * move repeating group encapsulation process to fns
+
 0.2.4
 
  * improve --group encapsulation counting
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ripcalc-0.2.4/ripcalc.1 new/ripcalc-0.2.5/ripcalc.1
--- old/ripcalc-0.2.4/ripcalc.1 2025-04-11 23:31:54.000000000 +0200
+++ new/ripcalc-0.2.5/ripcalc.1 2025-04-19 22:37:02.000000000 +0200
@@ -15,7 +15,7 @@
 . ftr VB CB
 . ftr VBI CBI
 .\}
-.TH "ripcalc" "1" "11 April 2025" "ripcalc 0.2.4" "User Manual"
+.TH "ripcalc" "1" "17 April 2025" "ripcalc 0.2.5" "User Manual"
 .hy
 .SH NAME
 .PP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ripcalc-0.2.4/ripcalc.md new/ripcalc-0.2.5/ripcalc.md
--- old/ripcalc-0.2.4/ripcalc.md        2025-04-11 23:31:54.000000000 +0200
+++ new/ripcalc-0.2.5/ripcalc.md        2025-04-19 22:37:02.000000000 +0200
@@ -2,9 +2,9 @@
 title: ripcalc
 section: 1
 header: User Manual
-footer: ripcalc 0.2.4
+footer: ripcalc 0.2.5
 author: Ed Neville (ed-ripc...@s5h.net)
-date: 11 April 2025
+date: 17 April 2025
 ---
 
 # NAME
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ripcalc-0.2.4/src/main.rs 
new/ripcalc-0.2.5/src/main.rs
--- old/ripcalc-0.2.4/src/main.rs       2025-04-11 23:31:54.000000000 +0200
+++ new/ripcalc-0.2.5/src/main.rs       2025-04-19 22:37:02.000000000 +0200
@@ -229,6 +229,85 @@
     }
 }
 
+fn process_encapsulated_input(
+    matches: &getopts::Matches,
+    inside: Option<bool>,
+    ip_args: &[Ip],
+    i: &Ip,
+    network_size: u32,
+    used: &mut HashMap<Ip, bool>,
+    config: &RefCell<Config>,
+) {
+    if !inside_filter(inside, ip_args, i) {
+        return;
+    }
+
+    used.insert(i.clone(), true);
+    if matches.opt_present("group") {
+        let net_mask = network(&Ip {
+            address: i.address.clone(),
+            cidr: network_size,
+        });
+        let nu = &mut config.borrow_mut().net_used;
+
+        if nu.get(&net_mask).is_none() {
+            nu.insert(net_mask.clone(), HashMap::new());
+        }
+
+        let nm = nu.get_mut(&net_mask).unwrap();
+        nm.insert(i.clone(), true);
+    }
+}
+
+fn process_group_encapsulation(
+    matches: &getopts::Matches,
+    used: HashMap<Ip, bool>,
+    rows: &Option<HashMap<Ip, NetRow>>,
+    config: &RefCell<Config>,
+) {
+    if matches.opt_present("group") {
+        let network_size: u32 = 
matches.opt_str("group").unwrap().trim().parse().unwrap();
+        match smallest_group_network_limited(&used, network_size) {
+            Some(mut x) => {
+                x.sort_by(|a, b| a.partial_cmp(b).unwrap());
+                for y in x {
+                    {
+                        let net_mask = network(&Ip {
+                            address: y.address.clone(),
+                            cidr: network_size,
+                        });
+
+                        let cfg = &mut config.borrow_mut();
+                        if !cfg.net_used.contains_key(&net_mask) {
+                            cfg.net_used.insert(net_mask.clone(), 
HashMap::new());
+                        }
+
+                        let nm = cfg.net_used.get(&net_mask).unwrap();
+
+                        cfg.used = Some(nm.clone());
+                    }
+
+                    print_details(&y, matches, rows, None, config);
+                }
+            }
+            None => {
+                eprintln!("Could not find an encapsulating network, sorry");
+                std::process::exit(1);
+            }
+        }
+    } else {
+        match smallest_group_network(&used) {
+            Some(x) => {
+                print_details(&x, matches, rows, None, config);
+            }
+            None => {
+                eprintln!("Could not find an encapsulating network, sorry");
+                std::process::exit(1);
+            }
+        }
+    }
+}
+
 #[allow(clippy::too_many_arguments)]
 fn process_input_file(
     path: &str,
@@ -278,69 +357,21 @@
 
         for a in find_ips(&mut reader, input_base, reverse, config) {
             for i in a {
-                if !inside_filter(inside, ip_args, &i) {
-                    continue;
-                }
-
-                used.insert(i.clone(), true);
-                if matches.opt_present("group") {
-                    let net_mask = network(&Ip {
-                        address: i.address.clone(),
-                        cidr: network_size,
-                    });
-                    let nu = &mut config.borrow_mut().net_used;
-
-                    if nu.get(&net_mask).is_none() {
-                        nu.insert(net_mask.clone(), HashMap::new());
-                    }
-
-                    let nm = nu.get_mut(&net_mask).unwrap();
-                    nm.insert(i.clone(), true);
-                }
+                process_encapsulated_input(
+                    matches,
+                    inside,
+                    ip_args,
+                    &i,
+                    network_size,
+                    &mut used,
+                    config,
+                );
             }
         }
 
         config.borrow_mut().used = Some(used.clone());
-        if matches.opt_present("group") {
-            match smallest_group_network_limited(&used, network_size) {
-                Some(mut x) => {
-                    x.sort_by(|a, b| a.partial_cmp(b).unwrap());
-                    for y in x {
-                        {
-                            let net_mask = network(&Ip {
-                                address: y.address.clone(),
-                                cidr: network_size,
-                            });
-
-                            let cfg = &mut config.borrow_mut();
-                            if !cfg.net_used.contains_key(&net_mask) {
-                                cfg.net_used.insert(net_mask.clone(), 
HashMap::new());
-                            }
-
-                            let nm = cfg.net_used.get(&net_mask).unwrap();
 
-                            cfg.used = Some(nm.clone());
-                        }
-
-                        print_details(&y, matches, rows, None, config);
-                    }
-                }
-                None => {
-                    eprintln!("Could not find an encapsulating network, 
sorry");
-                    std::process::exit(1);
-                }
-            }
-        } else {
-            match smallest_group_network(&used) {
-                Some(x) => {
-                    print_details(&x, matches, rows, None, config);
-                }
-                None => {
-                    eprintln!("Could not find an encapsulating network, 
sorry");
-                    std::process::exit(1);
-                }
-            }
-        }
+        process_group_encapsulation(matches, used, rows, config);
 
         std::process::exit(0);
     }
@@ -628,6 +659,20 @@
         }
 
         if matches.opt_present("encapsulating") {
+            let mut network_size: u32 = 0;
+
+            if matches.opt_present("group") {
+                network_size = 
matches.opt_str("group").unwrap().trim().parse().unwrap();
+            }
+            process_encapsulated_input(
+                &matches,
+                inside,
+                &ip_args,
+                arg,
+                network_size,
+                &mut used,
+                &config,
+            );
             used.insert(arg.clone(), true);
             continue;
         }
@@ -637,32 +682,7 @@
     config.borrow_mut().used = Some(used.clone());
 
     if matches.opt_present("encapsulating") {
-        if matches.opt_present("group") {
-            let network_size: u32 = 
matches.opt_str("group").unwrap().trim().parse().unwrap();
-
-            match smallest_group_network_limited(&used, network_size) {
-                Some(x) => {
-                    for y in x {
-                        print_details(&y, &matches, &rows, None, &config);
-                    }
-                }
-                None => {
-                    eprintln!("Could not find an encapsulating network, 
sorry");
-                    std::process::exit(1);
-                }
-            }
-        } else {
-            match smallest_group_network(&used) {
-                Some(x) => {
-                    print_details(&x, &matches, &rows, None, &config);
-                }
-                None => {
-                    eprintln!("Could not find an encapsulating network, 
sorry");
-                    std::process::exit(1);
-                }
-            }
-        }
-
+        process_group_encapsulation(&matches, used, &rows, &config);
         std::process::exit(0);
     }
 

++++++ ripcalc-0.2.4.tar.xz -> ripcalc-0.2.5.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ripcalc-0.2.4/Cargo.lock new/ripcalc-0.2.5/Cargo.lock
--- old/ripcalc-0.2.4/Cargo.lock        2025-04-11 23:31:54.000000000 +0200
+++ new/ripcalc-0.2.5/Cargo.lock        2025-04-19 22:37:02.000000000 +0200
@@ -166,7 +166,7 @@
 
 [[package]]
 name = "ripcalc"
-version = "0.2.4"
+version = "0.2.5"
 dependencies = [
  "csv",
  "dns-lookup",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ripcalc-0.2.4/Cargo.toml new/ripcalc-0.2.5/Cargo.toml
--- old/ripcalc-0.2.4/Cargo.toml        2025-04-11 23:31:54.000000000 +0200
+++ new/ripcalc-0.2.5/Cargo.toml        2025-04-19 22:37:02.000000000 +0200
@@ -1,7 +1,7 @@
 [package]
 name = "ripcalc"
 description = "ripcalc, format and lookup IP addresses"
-version = "0.2.4"
+version = "0.2.5"
 authors = ["ed neville <e...@s5h.net>"]
 edition = "2018"
 license = "GPL-3.0-or-later"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ripcalc-0.2.4/Makefile new/ripcalc-0.2.5/Makefile
--- old/ripcalc-0.2.4/Makefile  2025-04-11 23:31:54.000000000 +0200
+++ new/ripcalc-0.2.5/Makefile  2025-04-19 22:37:02.000000000 +0200
@@ -64,6 +64,9 @@
        printf -- '-736731135\n' | $(RELEASE) --base -10 --format '%a\n' | grep 
-Fx 212.22.96.1
        printf -- '-13259686110696736936355904651228348417\n' | $(RELEASE) 
--base -10 --format '%a\n' | grep -Fx f606:4700:3035:0:ffff:ffff:ffff:ffff
        printf -- '42540766411282592856903984951653826560\n' | $(RELEASE) 
--base 10 --format '%a\n' | grep -Fx 2001:db8::
+       $(RELEASE) -e 10.0.0.0 10.10.0.0 --group 24 --format '%a/%c %C ' | grep 
-Fx '10.0.0.0/24 1 10.10.0.0/24 1 ' >/dev/null
+       $(RELEASE) -e 10.0.0.0 10.10.0.0 10.10.0.1 --group 24 --format '%a/%c 
%C ' | grep -Fx '10.0.0.0/24 1 10.10.0.0/24 2 ' >/dev/null
+       printf '10.0.0.0 10.10.0.0 10.10.0.1\n' | $(RELEASE) -e --group 24 
--format '%a/%c %C ' | sort -n | paste -sd' ' | grep -Fx '10.0.0.0/32 1 
10.10.0.0/31 2 ' >/dev/null
 
 install: all
        command -v please && please install -m 0755 -s $(RELEASE) 
/usr/local/bin || sudo install -m 0755 -s $(RELEASE) /usr/local/bin 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ripcalc-0.2.4/changelog.md 
new/ripcalc-0.2.5/changelog.md
--- old/ripcalc-0.2.4/changelog.md      2025-04-11 23:31:54.000000000 +0200
+++ new/ripcalc-0.2.5/changelog.md      2025-04-19 22:37:02.000000000 +0200
@@ -1,3 +1,7 @@
+0.2.5
+
+ * move repeating group encapsulation process to fns
+
 0.2.4
 
  * improve --group encapsulation counting
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ripcalc-0.2.4/ripcalc.1 new/ripcalc-0.2.5/ripcalc.1
--- old/ripcalc-0.2.4/ripcalc.1 2025-04-11 23:31:54.000000000 +0200
+++ new/ripcalc-0.2.5/ripcalc.1 2025-04-19 22:37:02.000000000 +0200
@@ -15,7 +15,7 @@
 . ftr VB CB
 . ftr VBI CBI
 .\}
-.TH "ripcalc" "1" "11 April 2025" "ripcalc 0.2.4" "User Manual"
+.TH "ripcalc" "1" "17 April 2025" "ripcalc 0.2.5" "User Manual"
 .hy
 .SH NAME
 .PP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ripcalc-0.2.4/ripcalc.md new/ripcalc-0.2.5/ripcalc.md
--- old/ripcalc-0.2.4/ripcalc.md        2025-04-11 23:31:54.000000000 +0200
+++ new/ripcalc-0.2.5/ripcalc.md        2025-04-19 22:37:02.000000000 +0200
@@ -2,9 +2,9 @@
 title: ripcalc
 section: 1
 header: User Manual
-footer: ripcalc 0.2.4
+footer: ripcalc 0.2.5
 author: Ed Neville (ed-ripc...@s5h.net)
-date: 11 April 2025
+date: 17 April 2025
 ---
 
 # NAME
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ripcalc-0.2.4/src/main.rs 
new/ripcalc-0.2.5/src/main.rs
--- old/ripcalc-0.2.4/src/main.rs       2025-04-11 23:31:54.000000000 +0200
+++ new/ripcalc-0.2.5/src/main.rs       2025-04-19 22:37:02.000000000 +0200
@@ -229,6 +229,85 @@
     }
 }
 
+fn process_encapsulated_input(
+    matches: &getopts::Matches,
+    inside: Option<bool>,
+    ip_args: &[Ip],
+    i: &Ip,
+    network_size: u32,
+    used: &mut HashMap<Ip, bool>,
+    config: &RefCell<Config>,
+) {
+    if !inside_filter(inside, ip_args, i) {
+        return;
+    }
+
+    used.insert(i.clone(), true);
+    if matches.opt_present("group") {
+        let net_mask = network(&Ip {
+            address: i.address.clone(),
+            cidr: network_size,
+        });
+        let nu = &mut config.borrow_mut().net_used;
+
+        if nu.get(&net_mask).is_none() {
+            nu.insert(net_mask.clone(), HashMap::new());
+        }
+
+        let nm = nu.get_mut(&net_mask).unwrap();
+        nm.insert(i.clone(), true);
+    }
+}
+
+fn process_group_encapsulation(
+    matches: &getopts::Matches,
+    used: HashMap<Ip, bool>,
+    rows: &Option<HashMap<Ip, NetRow>>,
+    config: &RefCell<Config>,
+) {
+    if matches.opt_present("group") {
+        let network_size: u32 = 
matches.opt_str("group").unwrap().trim().parse().unwrap();
+        match smallest_group_network_limited(&used, network_size) {
+            Some(mut x) => {
+                x.sort_by(|a, b| a.partial_cmp(b).unwrap());
+                for y in x {
+                    {
+                        let net_mask = network(&Ip {
+                            address: y.address.clone(),
+                            cidr: network_size,
+                        });
+
+                        let cfg = &mut config.borrow_mut();
+                        if !cfg.net_used.contains_key(&net_mask) {
+                            cfg.net_used.insert(net_mask.clone(), 
HashMap::new());
+                        }
+
+                        let nm = cfg.net_used.get(&net_mask).unwrap();
+
+                        cfg.used = Some(nm.clone());
+                    }
+
+                    print_details(&y, matches, rows, None, config);
+                }
+            }
+            None => {
+                eprintln!("Could not find an encapsulating network, sorry");
+                std::process::exit(1);
+            }
+        }
+    } else {
+        match smallest_group_network(&used) {
+            Some(x) => {
+                print_details(&x, matches, rows, None, config);
+            }
+            None => {
+                eprintln!("Could not find an encapsulating network, sorry");
+                std::process::exit(1);
+            }
+        }
+    }
+}
+
 #[allow(clippy::too_many_arguments)]
 fn process_input_file(
     path: &str,
@@ -278,69 +357,21 @@
 
         for a in find_ips(&mut reader, input_base, reverse, config) {
             for i in a {
-                if !inside_filter(inside, ip_args, &i) {
-                    continue;
-                }
-
-                used.insert(i.clone(), true);
-                if matches.opt_present("group") {
-                    let net_mask = network(&Ip {
-                        address: i.address.clone(),
-                        cidr: network_size,
-                    });
-                    let nu = &mut config.borrow_mut().net_used;
-
-                    if nu.get(&net_mask).is_none() {
-                        nu.insert(net_mask.clone(), HashMap::new());
-                    }
-
-                    let nm = nu.get_mut(&net_mask).unwrap();
-                    nm.insert(i.clone(), true);
-                }
+                process_encapsulated_input(
+                    matches,
+                    inside,
+                    ip_args,
+                    &i,
+                    network_size,
+                    &mut used,
+                    config,
+                );
             }
         }
 
         config.borrow_mut().used = Some(used.clone());
-        if matches.opt_present("group") {
-            match smallest_group_network_limited(&used, network_size) {
-                Some(mut x) => {
-                    x.sort_by(|a, b| a.partial_cmp(b).unwrap());
-                    for y in x {
-                        {
-                            let net_mask = network(&Ip {
-                                address: y.address.clone(),
-                                cidr: network_size,
-                            });
-
-                            let cfg = &mut config.borrow_mut();
-                            if !cfg.net_used.contains_key(&net_mask) {
-                                cfg.net_used.insert(net_mask.clone(), 
HashMap::new());
-                            }
-
-                            let nm = cfg.net_used.get(&net_mask).unwrap();
 
-                            cfg.used = Some(nm.clone());
-                        }
-
-                        print_details(&y, matches, rows, None, config);
-                    }
-                }
-                None => {
-                    eprintln!("Could not find an encapsulating network, 
sorry");
-                    std::process::exit(1);
-                }
-            }
-        } else {
-            match smallest_group_network(&used) {
-                Some(x) => {
-                    print_details(&x, matches, rows, None, config);
-                }
-                None => {
-                    eprintln!("Could not find an encapsulating network, 
sorry");
-                    std::process::exit(1);
-                }
-            }
-        }
+        process_group_encapsulation(matches, used, rows, config);
 
         std::process::exit(0);
     }
@@ -628,6 +659,20 @@
         }
 
         if matches.opt_present("encapsulating") {
+            let mut network_size: u32 = 0;
+
+            if matches.opt_present("group") {
+                network_size = 
matches.opt_str("group").unwrap().trim().parse().unwrap();
+            }
+            process_encapsulated_input(
+                &matches,
+                inside,
+                &ip_args,
+                arg,
+                network_size,
+                &mut used,
+                &config,
+            );
             used.insert(arg.clone(), true);
             continue;
         }
@@ -637,32 +682,7 @@
     config.borrow_mut().used = Some(used.clone());
 
     if matches.opt_present("encapsulating") {
-        if matches.opt_present("group") {
-            let network_size: u32 = 
matches.opt_str("group").unwrap().trim().parse().unwrap();
-
-            match smallest_group_network_limited(&used, network_size) {
-                Some(x) => {
-                    for y in x {
-                        print_details(&y, &matches, &rows, None, &config);
-                    }
-                }
-                None => {
-                    eprintln!("Could not find an encapsulating network, 
sorry");
-                    std::process::exit(1);
-                }
-            }
-        } else {
-            match smallest_group_network(&used) {
-                Some(x) => {
-                    print_details(&x, &matches, &rows, None, &config);
-                }
-                None => {
-                    eprintln!("Could not find an encapsulating network, 
sorry");
-                    std::process::exit(1);
-                }
-            }
-        }
-
+        process_group_encapsulation(&matches, used, &rows, &config);
         std::process::exit(0);
     }
 

++++++ ripcalc.obsinfo ++++++
--- /var/tmp/diff_new_pack.rssbDi/_old  2025-04-28 16:16:51.354464626 +0200
+++ /var/tmp/diff_new_pack.rssbDi/_new  2025-04-28 16:16:51.386465972 +0200
@@ -1,5 +1,5 @@
 name: ripcalc
-version: 0.2.4
-mtime: 1744407114
-commit: efd8715574f13ebde9faa02df5ebe510b7f7c6e4
+version: 0.2.5
+mtime: 1745095022
+commit: 82536467fd6334900ad3e4bb2d604e20b270b693
 

++++++ vendor.tar.zst ++++++
/work/SRC/openSUSE:Factory/ripcalc/vendor.tar.zst 
/work/SRC/openSUSE:Factory/.ripcalc.new.30101/vendor.tar.zst differ: char 7, 
line 1

Reply via email to