From f66be7ac86af1732756faaedc6dccf80d857d33d7a69866f6068b73a1459b4dc Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Tue, 30 May 2017 13:46:21 +0000 Subject: [PATCH 1/2] - Update to version 5.1.17 remove 0001-add_simple_handling_of_os-release.patch remove 0002-use_os-release_to_detect_the_distro.patch remove 0003-tests_use__etc_os-release_in_test-harder.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/supermin?expand=0&rev=35 --- 0001-add_simple_handling_of_os-release.patch | 214 ------------------ ...-use_os-release_to_detect_the_distro.patch | 112 --------- ...s_use__etc_os-release_in_test-harder.patch | 76 ------- supermin-5.1.13.tar.xz | 3 - supermin-5.1.17.tar.xz | 3 + supermin.changes | 8 + supermin.spec | 17 +- 7 files changed, 15 insertions(+), 418 deletions(-) delete mode 100644 0001-add_simple_handling_of_os-release.patch delete mode 100644 0002-use_os-release_to_detect_the_distro.patch delete mode 100644 0003-tests_use__etc_os-release_in_test-harder.patch delete mode 100644 supermin-5.1.13.tar.xz create mode 100644 supermin-5.1.17.tar.xz diff --git a/0001-add_simple_handling_of_os-release.patch b/0001-add_simple_handling_of_os-release.patch deleted file mode 100644 index e297dd2..0000000 --- a/0001-add_simple_handling_of_os-release.patch +++ /dev/null @@ -1,214 +0,0 @@ -From libguestfs-bounces@redhat.com Wed Aug 31 13:20:03 2016 -Return-Path: -Delivered-To: unknown -Received: from gwmail.emea.novell.com (143.186.119.90:993) by laptop.vms - with IMAP4-SSL; 31 Aug 2016 13:20:03 -0000 -Received: from prv-mx.provo.novell.com (novprvlin0681.provo.novell.com - [130.57.1.19]) by prv-mh.provo.novell.com with ESMTP (NOT encrypted); Wed, - 31 Aug 2016 07:09:26 -0600 -Received: from mx6-phx2.redhat.com (209.132.183.39) by - prv-mx.provo.novell.com (130.57.1.10) GWAVA SMTP; Wed, 31 Aug 2016 07:10:12 - -0600 -X-Spam_ID: - str=0001.0A010202.57C6D706.0196:SCFSTAT2484459,ss=1,re=-4.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 -X-GWAVADAT: - gvWn3QsGV50RMxxr9c16c207872a47573356cfe20b727ec6b327e3bac2a6eaa5ec59d5e9d6aa834217boib3.17boib3.v6 -Received: from lists01.pubmisc.prod.ext.phx2.redhat.com - (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by - mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7VD5h2P022390; Wed, 31 - Aug 2016 09:05:44 -0400 -Received: from int-mx09.intmail.prod.int.phx2.redhat.com - (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) - by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP - id u7VD5gWQ007141 for ; - Wed, 31 Aug 2016 09:05:42 -0400 -Received: from thyrus.usersys.redhat.com (dhcp131-138.brq.redhat.com - [10.34.131.138]) - by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP - id u7VD5eAY004091 - (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 - verify=NO) - for ; Wed, 31 Aug 2016 09:05:42 -0400 -From: Pino Toscano -To: libguestfs@redhat.com -Date: Wed, 31 Aug 2016 15:05:35 +0200 -Message-Id: <1472648736-5613-2-git-send-email-ptoscano@redhat.com> -In-Reply-To: <1472648736-5613-1-git-send-email-ptoscano@redhat.com> -References: <1472648736-5613-1-git-send-email-ptoscano@redhat.com> -X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 -X-loop: libguestfs@redhat.com -Subject: [Libguestfs] [PATCH 1/2] Add simple handling of /etc/os-release -X-BeenThere: libguestfs@redhat.com -X-Mailman-Version: 2.1.12 -Precedence: junk -List-Id: Discussion and development of libguestfs -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -MIME-Version: 1.0 -Content-Type: text/plain; charset="us-ascii" -Content-Transfer-Encoding: 7bit -Sender: libguestfs-bounces@redhat.com -Errors-To: libguestfs-bounces@redhat.com -X-getmail-retrieved-from-mailbox: INBOX -X-Evolution-Source: 1323246076.1957.25@linux-smhm.site - -Introduce a simple module to read and cache fields of /etc/os-release -that might be needed, and there is only ID for now. ---- - src/Makefile.am | 3 +++ - src/os_release.ml | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ - src/os_release.mli | 26 ++++++++++++++++++ - 3 files changed, 107 insertions(+) - create mode 100644 src/os_release.ml - create mode 100644 src/os_release.mli - -diff --git a/src/Makefile.am b/src/Makefile.am -index 11adf31..767117f 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -47,6 +47,8 @@ SOURCES = \ - utils.ml \ - utils.mli \ - types.ml \ -+ os_release.ml \ -+ os_release.mli \ - package_handler.ml \ - package_handler.mli \ - rpm.ml \ -@@ -71,6 +73,7 @@ SOURCES_ML = \ - config.ml \ - utils.ml \ - types.ml \ -+ os_release.ml \ - package_handler.ml \ - rpm.ml \ - dpkg.ml \ -diff --git a/src/os_release.ml b/src/os_release.ml -new file mode 100644 -index 0000000..b2de259 ---- /dev/null -+++ b/src/os_release.ml -@@ -0,0 +1,78 @@ -+(* supermin 5 -+ * Copyright (C) 2016 Red Hat Inc. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ *) -+ -+open Utils -+ -+let split sep str = -+ let len = String.length sep in -+ let seplen = String.length str in -+ let i = find str sep in -+ if i = -1 then str, "" -+ else ( -+ String.sub str 0 i, String.sub str (i + len) (seplen - i - len) -+ ) -+ -+type os_release = { -+ id : string; -+} -+ -+let data = ref None -+let parsed = ref false -+ -+let rec get_data () = -+ if !parsed = false then ( -+ data := parse (); -+ parsed := true; -+ ); -+ -+ !data -+ -+and parse () = -+ let file = "/etc/os-release" in -+ if Sys.file_exists file then ( -+ let chan = open_in file in -+ let lines = input_all_lines chan in -+ close_in chan; -+ let lines = List.filter ((<>) "") lines in -+ let lines = List.filter (fun s -> s.[0] <> '#') lines in -+ -+ let id = ref "" in -+ -+ List.iter ( -+ fun line -> -+ let field, value = split "=" line in -+ let value = -+ let len = String.length value in -+ if len > 1 && -+ ((value.[0] = '"' && value.[len-1] = '"') || -+ (value.[0] = '\'' && value.[len-1] = '\'')) then -+ String.sub value 1 (len - 2) -+ else value in -+ match field with -+ | "ID" -> id := value -+ | _ -> () -+ ) lines; -+ -+ Some { id = !id; } -+ ) else -+ None -+ -+let get_id () = -+ match get_data () with -+ | None -> "" -+ | Some d -> d.id -diff --git a/src/os_release.mli b/src/os_release.mli -new file mode 100644 -index 0000000..2ae349b ---- /dev/null -+++ b/src/os_release.mli -@@ -0,0 +1,26 @@ -+(* supermin 5 -+ * Copyright (C) 2016 Red Hat Inc. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ *) -+ -+(** Handling of /etc/os-release. *) -+ -+val get_id : unit -> string -+(** Get the value of the "ID" field from the /etc/os-release file -+ on the current system. -+ -+ An empty string is returned if the file does not exist or cannot -+ be read. *) --- -2.7.4 - -_______________________________________________ -Libguestfs mailing list -Libguestfs@redhat.com -https://www.redhat.com/mailman/listinfo/libguestfs - diff --git a/0002-use_os-release_to_detect_the_distro.patch b/0002-use_os-release_to_detect_the_distro.patch deleted file mode 100644 index cb0d3d1..0000000 --- a/0002-use_os-release_to_detect_the_distro.patch +++ /dev/null @@ -1,112 +0,0 @@ -From libguestfs-bounces@redhat.com Wed Aug 31 13:10:02 2016 -From: Pino Toscano -To: libguestfs@redhat.com -Date: Wed, 31 Aug 2016 15:05:36 +0200 -Message-Id: <1472648736-5613-3-git-send-email-ptoscano@redhat.com> -In-Reply-To: <1472648736-5613-1-git-send-email-ptoscano@redhat.com> -References: <1472648736-5613-1-git-send-email-ptoscano@redhat.com> -X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 -X-loop: libguestfs@redhat.com -Subject: [Libguestfs] [PATCH 2/2] Use os-release to detect the distro -X-BeenThere: libguestfs@redhat.com -X-Mailman-Version: 2.1.12 -Precedence: junk -List-Id: Discussion and development of libguestfs -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -MIME-Version: 1.0 -Content-Type: text/plain; charset="us-ascii" -Content-Transfer-Encoding: 7bit -Sender: libguestfs-bounces@redhat.com -Errors-To: libguestfs-bounces@redhat.com -X-getmail-retrieved-from-mailbox: INBOX -X-Evolution-Source: 1323246076.1957.25@linux-smhm.site - -Check the ID field in /etc/os-release on the current system, before -checking for the other old-style release-/version-like files in /etc. -Some distributions (openSUSE Thumbleweed) are starting to remove them, -breaking the supermin detection. ---- - src/dpkg.ml | 3 ++- - src/pacman.ml | 5 +++-- - src/rpm.ml | 15 +++++++++------ - 3 files changed, 14 insertions(+), 9 deletions(-) - -diff --git a/src/dpkg.ml b/src/dpkg.ml -index 70acfa2..1e785de 100644 ---- a/src/dpkg.ml -+++ b/src/dpkg.ml -@@ -28,7 +28,8 @@ let dpkg_detect () = - Config.dpkg_query <> "no" && - Config.dpkg_divert <> "no" && - Config.apt_get <> "no" && -- try (stat "/etc/debian_version").st_kind = S_REG with Unix_error _ -> false -+ (List.mem (Os_release.get_id ()) [ "debian"; "ubuntu" ] || -+ try (stat "/etc/debian_version").st_kind = S_REG with Unix_error _ -> false) - - let dpkg_primary_arch = ref "" - let settings = ref no_settings -diff --git a/src/pacman.ml b/src/pacman.ml -index 3340fa6..c35668a 100644 ---- a/src/pacman.ml -+++ b/src/pacman.ml -@@ -24,8 +24,9 @@ open Package_handler - - let pacman_detect () = - Config.pacman <> "no" && Config.fakeroot <> "no" && -- (stat "/etc/arch-release").st_kind = S_REG && -- Config.pacman_g2 = "no" (* not Frugalware with pacman-g2 *) -+ (Os_release.get_id () = "arch" || -+ ((stat "/etc/arch-release").st_kind = S_REG && -+ Config.pacman_g2 = "no")) (* not Frugalware with pacman-g2 *) - - let settings = ref no_settings - -diff --git a/src/rpm.ml b/src/rpm.ml -index a5dc67a..e409e37 100644 ---- a/src/rpm.ml -+++ b/src/rpm.ml -@@ -31,21 +31,24 @@ let stringset_of_list pkgs = - let fedora_detect () = - Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () && - (Config.yumdownloader <> "no" || Config.dnf <> "no") && -- try -- (stat "/etc/redhat-release").st_kind = S_REG || -- (stat "/etc/fedora-release").st_kind = S_REG -- with Unix_error _ -> false -+ (List.mem (Os_release.get_id ()) [ "fedora"; "rhel"; "centos" ] || -+ try -+ (stat "/etc/redhat-release").st_kind = S_REG || -+ (stat "/etc/fedora-release").st_kind = S_REG -+ with Unix_error _ -> false) - - let opensuse_detect () = - Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () && - Config.zypper <> "no" && -- try (stat "/etc/SuSE-release").st_kind = S_REG with Unix_error _ -> false -+ (List.mem (Os_release.get_id ()) [ "opensuse"; "sled"; "sles" ] || -+ try (stat "/etc/SuSE-release").st_kind = S_REG with Unix_error _ -> false) - - let mageia_detect () = - Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () && - Config.urpmi <> "no" && - Config.fakeroot <> "no" && -- try (stat "/etc/mageia-release").st_kind = S_REG with Unix_error _ -> false -+ (Os_release.get_id () = "mageia" || -+ try (stat "/etc/mageia-release").st_kind = S_REG with Unix_error _ -> false) - - let ibm_powerkvm_detect () = - Config.rpm <> "no" && Config.rpm2cpio <> "no" && rpm_is_available () && --- -2.7.4 - -_______________________________________________ -Libguestfs mailing list -Libguestfs@redhat.com -https://www.redhat.com/mailman/listinfo/libguestfs - diff --git a/0003-tests_use__etc_os-release_in_test-harder.patch b/0003-tests_use__etc_os-release_in_test-harder.patch deleted file mode 100644 index 6ccab46..0000000 --- a/0003-tests_use__etc_os-release_in_test-harder.patch +++ /dev/null @@ -1,76 +0,0 @@ -From: Pino Toscano -To: libguestfs@redhat.com -Date: Wed, 31 Aug 2016 15:53:03 +0200 -Message-Id: <1472651583-30112-1-git-send-email-ptoscano@redhat.com> -In-Reply-To: <1472648736-5613-1-git-send-email-ptoscano@redhat.com> -References: <1472648736-5613-1-git-send-email-ptoscano@redhat.com> -X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 -X-loop: libguestfs@redhat.com -Subject: [Libguestfs] [PATCH] tests: use /etc/os-release in test-harder -X-BeenThere: libguestfs@redhat.com -X-Mailman-Version: 2.1.12 -Precedence: junk -List-Id: Discussion and development of libguestfs -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -MIME-Version: 1.0 -Content-Type: text/plain; charset="us-ascii" -Content-Transfer-Encoding: 7bit -Sender: libguestfs-bounces@redhat.com -Errors-To: libguestfs-bounces@redhat.com -X-getmail-retrieved-from-mailbox: INBOX -X-Evolution-Source: 1323246076.1957.25@linux-smhm.site - -Check the ID in /etc/os-release before checking the other release files, -so it's possible to handle distros without them. - -Also, make sure it is skipped if the value read from os-release is not -handled when getting the list of packages. ---- - tests/test-harder.sh | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/tests/test-harder.sh b/tests/test-harder.sh -index ea5dfc8..7e1b8df 100755 ---- a/tests/test-harder.sh -+++ b/tests/test-harder.sh -@@ -25,7 +25,14 @@ set -e - # NOTE: This test will only work if the $pkgs listed below - # for your distro are installed on the host. SEE LIST BELOW. - --if [ -f /etc/arch-release ]; then -+if [ -f /etc/os-release ]; then -+ distro=$(. /etc/os-release && echo $ID) -+ case "$distro" in -+ fedora|rhel|centos) distro=redhat ;; -+ opensuse|sled|sles) distro=suse ;; -+ ubuntu) distro=debian ;; -+ esac -+elif [ -f /etc/arch-release ]; then - distro=arch - elif [ -f /etc/debian_version ]; then - distro=debian -@@ -63,6 +70,10 @@ case $distro in - ibm-powerkvm) - pkgs="augeas hivex tar" - ;; -+ *) -+ echo "Unhandled distro '$distro'" -+ exit 77 -+ ;; - esac - - test "$USE_NETWORK" = 1 || USE_INSTALLED=--use-installed --- -2.7.4 - -_______________________________________________ -Libguestfs mailing list -Libguestfs@redhat.com -https://www.redhat.com/mailman/listinfo/libguestfs - diff --git a/supermin-5.1.13.tar.xz b/supermin-5.1.13.tar.xz deleted file mode 100644 index 64ece6c..0000000 --- a/supermin-5.1.13.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e2d36a6c117528786fdc6cd8f11af3138400a967711f2b4847b1f8581799a8a2 -size 340736 diff --git a/supermin-5.1.17.tar.xz b/supermin-5.1.17.tar.xz new file mode 100644 index 0000000..556f407 --- /dev/null +++ b/supermin-5.1.17.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9999260569757ad52555bbecaaeb8383c1ef6adbe93ac7b58e2c43ea42309218 +size 345208 diff --git a/supermin.changes b/supermin.changes index 6d894d3..60e55e6 100644 --- a/supermin.changes +++ b/supermin.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue May 30 13:45:27 UTC 2017 - olaf@aepfle.de + +- Update to version 5.1.17 + remove 0001-add_simple_handling_of_os-release.patch + remove 0002-use_os-release_to_detect_the_distro.patch + remove 0003-tests_use__etc_os-release_in_test-harder.patch + ------------------------------------------------------------------- Thu Sep 8 15:01:41 UTC 2016 - cbosdonnat@suse.com diff --git a/supermin.spec b/supermin.spec index 0110d75..4c2a47c 100644 --- a/supermin.spec +++ b/supermin.spec @@ -1,7 +1,7 @@ # # spec file for package supermin # -# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: supermin -Version: 5.1.13 +Version: 5.1.17 Release: 0 %{ocaml_preserve_bytecode} Url: http://libguestfs.org/ @@ -30,9 +30,6 @@ Requires: xmlstarlet Requires: zypper BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: supermin-%{version}.tar.xz -Patch0: 0001-add_simple_handling_of_os-release.patch -Patch1: 0002-use_os-release_to_detect_the_distro.patch -Patch2: 0003-tests_use__etc_os-release_in_test-harder.patch %if "%{?_ignore_exclusive_arch}" == "" ExclusiveArch: x86_64 ppc64 ppc64le s390x aarch64 %endif @@ -40,14 +37,14 @@ ExclusiveArch: x86_64 ppc64 ppc64le s390x aarch64 BuildRequires: autoconf BuildRequires: automake BuildRequires: e2fsprogs -%if %suse_version >= 1210 BuildRequires: glibc-devel-static -%endif +BuildRequires: gzip BuildRequires: ncurses-devel BuildRequires: ocaml BuildRequires: ocaml-findlib BuildRequires: ocaml-rpm-macros >= 4.02.1 BuildRequires: pkg-config +BuildRequires: xz BuildRequires: xz-devel BuildRequires: zlib-devel BuildRequires: pkgconfig(com_err) @@ -62,9 +59,6 @@ you need to boot one of them. %prep %setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 %build export ZYPPER=zypper @@ -80,9 +74,6 @@ make \ make install DESTDIR=$RPM_BUILD_ROOT find $RPM_BUILD_ROOT -ls -%clean -rm -rf $RPM_BUILD_ROOT - %files %defattr (-,root,root) %doc README From 8a4bc07a6306eeb0410d48ca49277801629499996e50cc1117dc067e3d6d47ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Date: Thu, 13 Jul 2017 14:32:20 +0000 Subject: [PATCH 2/2] Accepting request 510111 from home:cbosdonnat:branches:Virtualization - Update to version 5.1.18 OBS-URL: https://build.opensuse.org/request/show/510111 OBS-URL: https://build.opensuse.org/package/show/Virtualization/supermin?expand=0&rev=36 --- supermin-5.1.17.tar.xz | 3 --- supermin-5.1.18.tar.xz | 3 +++ supermin.changes | 5 +++++ supermin.spec | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) delete mode 100644 supermin-5.1.17.tar.xz create mode 100644 supermin-5.1.18.tar.xz diff --git a/supermin-5.1.17.tar.xz b/supermin-5.1.17.tar.xz deleted file mode 100644 index 556f407..0000000 --- a/supermin-5.1.17.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9999260569757ad52555bbecaaeb8383c1ef6adbe93ac7b58e2c43ea42309218 -size 345208 diff --git a/supermin-5.1.18.tar.xz b/supermin-5.1.18.tar.xz new file mode 100644 index 0000000..d84350f --- /dev/null +++ b/supermin-5.1.18.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:792c9c6d51ff4740f94ebdc4ad0a0c20726e32dcdbdbcf81fbb15c75eaf6df9a +size 363536 diff --git a/supermin.changes b/supermin.changes index 60e55e6..f0fa8e7 100644 --- a/supermin.changes +++ b/supermin.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jul 13 14:17:07 UTC 2017 - cbosdonnat@suse.com + +- Update to version 5.1.18 + ------------------------------------------------------------------- Tue May 30 13:45:27 UTC 2017 - olaf@aepfle.de diff --git a/supermin.spec b/supermin.spec index 4c2a47c..f7b3a12 100644 --- a/supermin.spec +++ b/supermin.spec @@ -17,7 +17,7 @@ Name: supermin -Version: 5.1.17 +Version: 5.1.18 Release: 0 %{ocaml_preserve_bytecode} Url: http://libguestfs.org/