Hello community,

here is the log from the commit of package linuxrc for openSUSE:Factory checked 
in at 2018-07-25 16:03:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/linuxrc (Old)
 and      /work/SRC/openSUSE:Factory/.linuxrc.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "linuxrc"

Wed Jul 25 16:03:43 2018 rev:262 rq:623124 version:6.0.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/linuxrc/linuxrc.changes  2018-07-04 
23:54:43.183919345 +0200
+++ /work/SRC/openSUSE:Factory/.linuxrc.new/linuxrc.changes     2018-07-25 
16:03:47.056807784 +0200
@@ -1,0 +2,10 @@
+Mon Jul 16 12:08:11 UTC 2018 - wfe...@opensuse.org
+
+- merge gh#openSUSE/linuxrc#177
+- add check_media() function (bsc#1000947, bsc#1036004)
+- run check_media() _before_ locating the repository
+- move mediacheck from expert settings to install menu
+- fix docker setup
+- 6.0.1
+
+--------------------------------------------------------------------

Old:
----
  linuxrc-6.0.0.tar.xz

New:
----
  linuxrc-6.0.1.tar.xz

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

Other differences:
------------------
++++++ linuxrc.spec ++++++
--- /var/tmp/diff_new_pack.JIMiYN/_old  2018-07-25 16:03:48.172810039 +0200
+++ /var/tmp/diff_new_pack.JIMiYN/_new  2018-07-25 16:03:48.176810047 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           linuxrc
-Version:        6.0.0
+Version:        6.0.1
 Release:        0
 Summary:        SUSE Installation Program
 License:        GPL-3.0+

++++++ linuxrc-6.0.0.tar.xz -> linuxrc-6.0.1.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-6.0.0/Dockerfile new/linuxrc-6.0.1/Dockerfile
--- old/linuxrc-6.0.0/Dockerfile        2018-07-02 10:28:42.000000000 +0200
+++ new/linuxrc-6.0.1/Dockerfile        2018-07-16 14:08:11.000000000 +0200
@@ -5,6 +5,7 @@
   libblkid-devel \
   libcurl-devel \
   readline-devel \
+  libmediacheck-devel \
   tmux
 
 COPY . /usr/src/app
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-6.0.0/VERSION new/linuxrc-6.0.1/VERSION
--- old/linuxrc-6.0.0/VERSION   2018-07-02 10:28:42.000000000 +0200
+++ new/linuxrc-6.0.1/VERSION   2018-07-16 14:08:11.000000000 +0200
@@ -1 +1 @@
-6.0.0
+6.0.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-6.0.0/auto2.c new/linuxrc-6.0.1/auto2.c
--- old/linuxrc-6.0.0/auto2.c   2018-07-02 10:28:42.000000000 +0200
+++ new/linuxrc-6.0.1/auto2.c   2018-07-16 14:08:11.000000000 +0200
@@ -90,6 +90,12 @@
     return 1;
   }
 
+  if(config.mediacheck) {
+    if(!config.win) util_disp_init();
+    ok = check_media(NULL);
+    if(!ok) return 0;
+  }
+
   if(config.win && !win_old) util_disp_done();
 
   ok = auto2_find_repo();
@@ -106,8 +112,6 @@
 
   device = config.url.install->used.device ?: config.url.install->device;
 
-  win_old = config.win;
-
   log_debug("find repo:\n");
   log_debug("  ok = %d\n", ok);
   log_debug("  is.network = %d\n", config.url.install->is.network);
@@ -115,19 +119,6 @@
   log_debug("  device = %s\n", device ?: "");
   log_debug("  ZyppRepoURL: %s\n", url_print(config.url.install, 4));
 
-  if(
-    ok &&
-    config.mediacheck &&
-    !config.url.install->is.network &&
-    config.url.install->is.mountable &&
-    device
-  ) {
-    if(!config.win) util_disp_init();
-    digest_media_verify(device);
-  }
-
-  if(config.win && !win_old) util_disp_done();
-
   LXRC_WAIT
 
   util_splash_bar(50, SPLASH_50);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-6.0.0/changelog new/linuxrc-6.0.1/changelog
--- old/linuxrc-6.0.0/changelog 2018-07-02 10:28:42.000000000 +0200
+++ new/linuxrc-6.0.1/changelog 2018-07-16 14:08:11.000000000 +0200
@@ -1,3 +1,10 @@
+2018-07-16:    6.0.1
+       - merge gh#openSUSE/linuxrc#177
+       - add check_media() function (bsc#1000947, bsc#1036004)
+       - run check_media() _before_ locating the repository
+       - move mediacheck from expert settings to install menu
+       - fix docker setup
+
 2018-07-02:    6.0.0
        - merge gh#openSUSE/linuxrc#176
        - rewrite digest_media_verify() to use new mediacheck lib
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-6.0.0/checkmedia.c 
new/linuxrc-6.0.1/checkmedia.c
--- old/linuxrc-6.0.0/checkmedia.c      2018-07-02 10:28:42.000000000 +0200
+++ new/linuxrc-6.0.1/checkmedia.c      2018-07-16 14:08:11.000000000 +0200
@@ -1,3 +1,5 @@
+#define _GNU_SOURCE
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -5,35 +7,32 @@
 
 #include "global.h"
 #include "dialog.h"
+#include "window.h"
 #include "util.h"
 #include "keyboard.h"
 
 #include <mediacheck.h>
 
+static int check_media_device(char *device);
 static int progress(unsigned percent);
 
 window_t win;
 
-void digest_media_verify(char *device)
+/*
+ * Check single SUSE installation medium.
+ *
+ * device: device name of the device to check
+ *
+ * return 1 if ok, else 0
+ */
+int check_media_device(char *device)
 {
   int i, ok;
   mediacheck_t *media = NULL;
 
   log_info("digest_media_verify(%s)\n", device);
 
-  if(device) {
-    device = strdup(long_dev(device));
-    media = mediacheck_init(device, progress);
-  }
-  else {
-    update_device_list(0);
-    if(config.device) {
-      device = config.device;
-      media = mediacheck_init(device, progress);
-    }
-
-    dia_message("No CD-ROM or DVD found!!!", MSGTYPE_ERROR);
-  }
+  media = mediacheck_init(long_dev(device), progress);
 
   if(media) {
     for(i = 0; i < sizeof media->tags / sizeof *media->tags; i++) {
@@ -49,7 +48,7 @@
   ) {
     dia_message("This is not a SUSE medium.", MSGTYPE_ERROR);
     config.manual=1;
-    return;
+    return 1;
   }
 
   if(
@@ -58,7 +57,7 @@
   ) {
     dia_message("No digests to check.", MSGTYPE_ERROR);
     config.manual=1;
-    return;
+    return 1;
   }
 
   if(media->app_id) log_info("app: %s\n", media->app_id);
@@ -172,9 +171,134 @@
   }
 
   mediacheck_done(media);
+
+  return ok;
+}
+
+
+/*
+ * Check SUSE installation medium.
+ *
+ * device: device name of the device to check or NULL
+ *
+ * If device is NULL, a device selection dialog is shown to the user first.
+ *
+ * return 1 if ok, else 0
+ */
+int check_media(char *device)
+{
+  int item_cnt, item_width;
+  int list_len = 0, device_name_len = 0, ok = 1;
+  char **items, **values;
+  window_t dia_win;
+  slist_t *sl, *device_list = NULL;
+  hd_t *hd;
+
+  if(device) return check_media_device(device);
+
+  dia_info(&dia_win, "Searching for storage devices...", MSGTYPE_INFO);
+  update_device_list(0);
+  win_close(&dia_win);
+
+  for(hd = hd_list(config.hd_data, hw_block, 0, NULL); hd; hd = hd -> next) {
+    if(
+      !hd->unix_dev_name ||
+      hd_is_hw_class(hd, hw_partition)
+    ) continue;
+    slist_append_str(&device_list, strdup(short_dev(hd->unix_dev_name)));
+    list_len++;
+  }
+
+  /*
+   * just max values, actual lists might be shorter
+   *
+   * "+2" due to "other device" + final NULL
+   */
+  items = calloc(list_len + 2, sizeof *items);
+  values = calloc(list_len + 2, sizeof *values);
+
+  item_cnt = 0;
+
+  const char other_device[] = "- other device -";
+
+  item_width = sizeof other_device - 1;
+
+  for(sl = device_list; sl; sl = sl->next) {
+    mediacheck_t *media = mediacheck_init(long_dev(sl->key), NULL);
+    if(media && !media->err) {
+      log_info("checkmedia: %s = %s\n", sl->key, media->app_id);
+      /* max device name length */
+      int len = strlen(sl->key);
+      if(len > device_name_len) device_name_len = len;
+
+      values[item_cnt] = strdup(sl->key);
+      asprintf(items + item_cnt, "%*s: %s", device_name_len, sl->key, 
media->app_id);
+
+      len = strlen(items[item_cnt]);
+      if(len > item_width) item_width = len;
+
+      item_cnt++;
+    }
+    else {
+      log_info("checkmedia: %s is not a SUSE medium\n", sl->key);
+    }
+
+    mediacheck_done(media);
+  }
+
+  values[item_cnt] = NULL;
+  items[item_cnt++] = strdup(other_device);
+
+  if(item_width > 72) item_width = 72;
+
+  int selected_item = 1;
+
+  if(item_cnt > 1) {
+    selected_item = dia_list("Please choose the device to check.", item_width 
+ 2, NULL, items, selected_item, align_left);
+  }
+
+  if(selected_item > 0) {
+    str_copy(&device, values[selected_item - 1]);
+    if(!device) {
+      ok = !dia_input2("Enter the device to check.", &device, 30, 0);
+      if(ok) {
+        if(util_check_exist(long_dev(device)) == 'b') {
+          str_copy(&device, short_dev(device));
+        }
+        else {
+          dia_message("Invalid device name.", MSGTYPE_ERROR);
+          ok = 0;
+        }
+      }
+    }
+  }
+  else {
+    ok = 0;
+  }
+
+  int i;
+
+  for(i = 0; i < item_cnt; i++) { free(items[i]); free(values[i]); }
+  free(items);
+  free(values);
+
+  if(ok && device) {
+    ok = check_media_device(device);
+  }
+
+  str_copy(&device, NULL);
+
+  return ok;
 }
 
 
+/*
+ * Callback function to visualize media check progress.
+ *
+ * This just shows the percentage.
+ *
+ * Check for ESC to allow aborting the checking process.
+ */
 int progress(unsigned percent)
 {
   dia_status(&win, percent);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-6.0.0/checkmedia.h 
new/linuxrc-6.0.1/checkmedia.h
--- old/linuxrc-6.0.0/checkmedia.h      2018-07-02 10:28:42.000000000 +0200
+++ new/linuxrc-6.0.1/checkmedia.h      2018-07-16 14:08:11.000000000 +0200
@@ -1 +1 @@
-void digest_media_verify(char *device);
+int check_media(char *device);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-6.0.0/dialog.c new/linuxrc-6.0.1/dialog.c
--- old/linuxrc-6.0.0/dialog.c  2018-07-02 10:28:42.000000000 +0200
+++ new/linuxrc-6.0.1/dialog.c  2018-07-16 14:08:11.000000000 +0200
@@ -42,7 +42,6 @@
 
   { di_expert_info,      "System Information",           },
   { di_expert_modules,   "Kernel Modules (Hardware Drivers)",        },
-  { di_expert_verify,    "Verify Installation Medium",            },
   { di_expert_eject,     "Eject CD",            },
 
   { di_exit_reboot,      "Exit or Reboot",          },
@@ -64,6 +63,7 @@
   { di_inst_rescue,      "Rescue System",        },
   { di_inst_system,      "Boot Installed System",         },
   { di_inst_net_config,  "Network Setup",   },
+  { di_inst_check_media, "Verify Installation Medium",   },
 
   { di_source_cdrom,     "DVD / CD-ROM",                 },
   { di_source_net,       "Network",                 },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-6.0.0/dialog.h new/linuxrc-6.0.1/dialog.h
--- old/linuxrc-6.0.0/dialog.h  2018-07-02 10:28:42.000000000 +0200
+++ new/linuxrc-6.0.1/dialog.h  2018-07-16 14:08:11.000000000 +0200
@@ -22,7 +22,6 @@
 
   di_expert_info,
   di_expert_modules,
-  di_expert_verify,
   di_expert_eject,
 
   di_extras_info,
@@ -50,6 +49,7 @@
   di_inst_rescue,
   di_inst_system,
   di_inst_net_config,
+  di_inst_check_media,
 
   di_source_cdrom,
   di_source_net,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-6.0.0/install.c new/linuxrc-6.0.1/install.c
--- old/linuxrc-6.0.0/install.c 2018-07-02 10:28:42.000000000 +0200
+++ new/linuxrc-6.0.1/install.c 2018-07-16 14:08:11.000000000 +0200
@@ -45,6 +45,7 @@
 #include "settings.h"
 #include "auto2.h"
 #include "url.h"
+#include "checkmedia.h"
 
 #ifndef MNT_DETACH
 #define MNT_DETACH     (1 << 1)
@@ -103,6 +104,7 @@
     di_inst_rescue,
     di_inst_system,
     di_inst_net_config,
+    di_inst_check_media,
     di_none
   };
 
@@ -160,6 +162,11 @@
       err = 1;
       break;
 
+    case di_inst_check_media:
+      check_media(NULL);
+      err = 1;
+      break;
+
     default:
       break;
   }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-6.0.0/settings.c new/linuxrc-6.0.1/settings.c
--- old/linuxrc-6.0.0/settings.c        2018-07-02 10:28:42.000000000 +0200
+++ new/linuxrc-6.0.1/settings.c        2018-07-16 14:08:11.000000000 +0200
@@ -449,7 +449,6 @@
   dia_item_t items[] = {
     di_expert_info,
     di_expert_modules,
-    di_expert_verify,
     di_expert_eject,
     di_extras_info,
     di_extras_change,
@@ -474,7 +473,6 @@
 int set_expert_cb(dia_item_t di)
 {
   int i;
-  char *dev = NULL;
   file_t *f;
 
   di_set_expert_last = di;
@@ -488,11 +486,6 @@
       mod_menu();
       break;
 
-    case di_expert_verify:
-      util_choose_disk_device(&dev, 2, "Please choose the device to check.", 
"Enter the device to check.");
-      if(dev) digest_media_verify(dev);
-      break;
-
     case di_expert_eject:
       util_eject_cdrom(config.cdrom);
       break;


Reply via email to