forked from pool/supermin
- Update to version 4.1.3
OBS-URL: https://build.opensuse.org/package/show/Virtualization/supermin?expand=0&rev=16
This commit is contained in:
parent
a9c7ea2c60
commit
9cc941db47
@ -1,28 +0,0 @@
|
||||
From 9f60bbb8e486c410d76e1864a11d3990c2119787 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 5 Feb 2013 16:46:22 +0000
|
||||
Subject: Actually update gnulib.
|
||||
|
||||
This fixes commit 4df7ff0786d872c9bb8a0a1b5410429ca1f8440b.
|
||||
---
|
||||
lib/.gitignore | 3 +++
|
||||
m4/.gitignore | 2 +-
|
||||
m4/gnulib-cache.m4 | 4 ++--
|
||||
3 files changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4
|
||||
index e70274d..ff80694 100644
|
||||
--- a/m4/gnulib-cache.m4
|
||||
+++ b/m4/gnulib-cache.m4
|
||||
@@ -1,4 +1,4 @@
|
||||
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
|
||||
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -52,4 +52,4 @@ gl_LIB([libgnu])
|
||||
gl_MAKEFILE_NAME([])
|
||||
gl_MACRO_PREFIX([gl])
|
||||
gl_PO_DOMAIN([])
|
||||
-gl_WITNESS_C_DOMAIN([])
|
||||
+gl_WITNESS_C_MACRO([])
|
@ -1,61 +0,0 @@
|
||||
From 81a3470088aff911c4e5e729bf1f1b61480baab8 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Fri, 5 Apr 2013 17:14:52 +0100
|
||||
Subject: helper: Add missing options to --help and man page (RHBZ#948880).
|
||||
|
||||
---
|
||||
helper/main.c | 4 ++--
|
||||
helper/supermin-helper.pod | 16 ++++++++++++++++
|
||||
2 files changed, 18 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/helper/main.c b/helper/main.c
|
||||
index 25a4d91..6948e93 100644
|
||||
--- a/helper/main.c
|
||||
+++ b/helper/main.c
|
||||
@@ -83,10 +83,10 @@ usage (FILE *f, const char *progname)
|
||||
" Specify output format (default: cpio).\n"
|
||||
" --copy-kernel\n"
|
||||
" Copy the kernel instead of symlinking to it.\n"
|
||||
- " -u user\n"
|
||||
+ " -u user | --user user\n"
|
||||
" The user name or uid the appliance will run as. Use of this\n"
|
||||
" option requires root privileges.\n"
|
||||
- " -g group\n"
|
||||
+ " -g group | --group group\n"
|
||||
" The group name or gid the appliance will run as. Use of\n"
|
||||
" this option requires root privileges.\n"
|
||||
" -k file | --kmods file\n"
|
||||
diff --git a/helper/supermin-helper.pod b/helper/supermin-helper.pod
|
||||
index 10c5223..86d7a97 100644
|
||||
--- a/helper/supermin-helper.pod
|
||||
+++ b/helper/supermin-helper.pod
|
||||
@@ -38,6 +38,10 @@ the checksum output C<-f checksum>.
|
||||
|
||||
=over 4
|
||||
|
||||
+=item B<--help>
|
||||
+
|
||||
+Display brief command line usage, and exit.
|
||||
+
|
||||
=item B<-f fmt>
|
||||
|
||||
=item B<--format fmt>
|
||||
@@ -122,6 +126,18 @@ effective uid/gid to the real uid/gid when invoked. As
|
||||
supermin-helper uses bash in parts, this will result in the creation
|
||||
of an appliance with a mixture of ownerships.
|
||||
|
||||
+=item B<-v>
|
||||
+
|
||||
+=item B<--verbose>
|
||||
+
|
||||
+Enable verbose messages (give multiple times for more verbosity).
|
||||
+
|
||||
+=item B<-V>
|
||||
+
|
||||
+=item B<--version>
|
||||
+
|
||||
+Display version number and exit.
|
||||
+
|
||||
=back
|
||||
|
||||
=head1 SPEED
|
@ -1,50 +0,0 @@
|
||||
From 1ecd918f88065b55bcb411b54311d813ce54c2ad Mon Sep 17 00:00:00 2001
|
||||
From: Olaf Hering <olaf@aepfle.de>
|
||||
Date: Tue, 9 Apr 2013 19:27:01 +0200
|
||||
Subject: add run_shell helper
|
||||
|
||||
The new run_shell helper is a copy of run_python,
|
||||
and will be used by upcoming changes.
|
||||
|
||||
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
||||
---
|
||||
src/supermin_utils.ml | 9 +++++++++
|
||||
src/supermin_utils.mli | 5 +++++
|
||||
2 files changed, 14 insertions(+)
|
||||
|
||||
diff --git a/src/supermin_utils.ml b/src/supermin_utils.ml
|
||||
index f98e09a..cb8a27e 100644
|
||||
--- a/src/supermin_utils.ml
|
||||
+++ b/src/supermin_utils.ml
|
||||
@@ -70,6 +70,15 @@ let run_command cmd =
|
||||
exit 1
|
||||
)
|
||||
|
||||
+let run_shell code args =
|
||||
+ let cmd = sprintf "sh -c %s arg0 %s"
|
||||
+ (Filename.quote code)
|
||||
+ (String.concat " " (List.map Filename.quote args)) in
|
||||
+ if Sys.command cmd <> 0 then (
|
||||
+ eprintf "supermin: external shell program failed, see earlier error messages\n";
|
||||
+ exit 1
|
||||
+ )
|
||||
+
|
||||
let run_python code args =
|
||||
let cmd = sprintf "python -c %s %s"
|
||||
(Filename.quote code)
|
||||
diff --git a/src/supermin_utils.mli b/src/supermin_utils.mli
|
||||
index 54df1e8..c4a52c6 100644
|
||||
--- a/src/supermin_utils.mli
|
||||
+++ b/src/supermin_utils.mli
|
||||
@@ -41,6 +41,11 @@ val run_command : string -> unit
|
||||
when constructing the command to properly quote any arguments
|
||||
(using {!Filename.quote}). *)
|
||||
|
||||
+val run_shell : string -> string list -> unit
|
||||
+ (** [run_shell code args] runs shell [code] with arguments [args].
|
||||
+ This does not return anything, but exits with an error message
|
||||
+ if the shell code returns an error. *)
|
||||
+
|
||||
val run_python : string -> string list -> unit
|
||||
(** [run_python code args] runs Python [code] with arguments [args].
|
||||
This does not return anything, but exits with an error message
|
@ -1,247 +0,0 @@
|
||||
From 392eca634d68a01045475799a76b988e4589006c Mon Sep 17 00:00:00 2001
|
||||
From: Olaf Hering <olaf@aepfle.de>
|
||||
Date: Tue, 9 Apr 2013 19:27:02 +0200
|
||||
Subject: add support for zypp
|
||||
|
||||
This adds support for zypper which is used as package management in
|
||||
SuSE Linux. It started out as copy of yum support.
|
||||
|
||||
TODO:
|
||||
add regex support
|
||||
|
||||
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
||||
---
|
||||
configure.ac | 1 +
|
||||
src/.depend | 2 +
|
||||
src/Makefile.am | 1 +
|
||||
src/config.ml.in | 1 +
|
||||
src/supermin_zypp_rpm.ml | 174 +++++++++++++++++++++++++++++++++++++++++++++++
|
||||
5 files changed, 179 insertions(+)
|
||||
create mode 100644 src/supermin_zypp_rpm.ml
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index a22fcf3..f975f3f 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -64,6 +64,7 @@ fi
|
||||
AM_CONDITIONAL(HAVE_PERLDOC,[test "$perldoc" != "no"])
|
||||
|
||||
dnl For yum-rpm handler.
|
||||
+AC_CHECK_PROG(ZYPPER,[zypper],[zypper],[no])
|
||||
AC_CHECK_PROG(YUM,[yum],[yum],[no])
|
||||
AC_CHECK_PROG(RPM,[rpm],[rpm],[no])
|
||||
AC_CHECK_PROG(YUMDOWNLOADER,[yumdownloader],[yumdownloader],[no])
|
||||
diff --git a/src/.depend b/src/.depend
|
||||
index 624191e..36a642f 100644
|
||||
--- a/src/.depend
|
||||
+++ b/src/.depend
|
||||
@@ -17,3 +17,5 @@ supermin_utils.cmo: supermin_cmdline.cmi supermin_utils.cmi
|
||||
supermin_utils.cmx: supermin_cmdline.cmx supermin_utils.cmi
|
||||
supermin_yum_rpm.cmo: supermin_utils.cmi supermin_package_handlers.cmi supermin_cmdline.cmi config.cmo
|
||||
supermin_yum_rpm.cmx: supermin_utils.cmx supermin_package_handlers.cmx supermin_cmdline.cmx config.cmx
|
||||
+supermin_zypp_rpm.cmo: supermin_utils.cmi supermin_package_handlers.cmi supermin_cmdline.cmi config.cmo
|
||||
+supermin_zypp_rpm.cmx: supermin_utils.cmx supermin_package_handlers.cmx supermin_cmdline.cmx config.cmx
|
||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||
index 6ff3d56..3b6ca9b 100644
|
||||
--- a/src/Makefile.am
|
||||
+++ b/src/Makefile.am
|
||||
@@ -26,6 +26,7 @@ SOURCES = \
|
||||
supermin_utils.ml \
|
||||
supermin_package_handlers.mli \
|
||||
supermin_package_handlers.ml \
|
||||
+ supermin_zypp_rpm.ml \
|
||||
supermin_yum_rpm.ml \
|
||||
supermin_debian.ml \
|
||||
supermin_pacman.ml \
|
||||
diff --git a/src/config.ml.in b/src/config.ml.in
|
||||
index c281486..c3e7672 100644
|
||||
--- a/src/config.ml.in
|
||||
+++ b/src/config.ml.in
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
let package_name = "@PACKAGE_NAME@"
|
||||
let package_version = "@PACKAGE_VERSION@"
|
||||
+let zypper = "@ZYPPER@"
|
||||
let yum = "@YUM@"
|
||||
let rpm = "@RPM@"
|
||||
let yumdownloader = "@YUMDOWNLOADER@"
|
||||
diff --git a/src/supermin_zypp_rpm.ml b/src/supermin_zypp_rpm.ml
|
||||
new file mode 100644
|
||||
index 0000000..51f01eb
|
||||
--- /dev/null
|
||||
+++ b/src/supermin_zypp_rpm.ml
|
||||
@@ -0,0 +1,174 @@
|
||||
+(* supermin 4
|
||||
+ * Copyright (C) 2009-2010 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
|
||||
+ *)
|
||||
+
|
||||
+(* Zypper and RPM support. *)
|
||||
+
|
||||
+open Unix
|
||||
+open Printf
|
||||
+
|
||||
+open Supermin_package_handlers
|
||||
+open Supermin_utils
|
||||
+open Supermin_cmdline
|
||||
+
|
||||
+
|
||||
+(* Create a temporary directory for use by all the functions in this file. *)
|
||||
+let tmpdir = tmpdir ()
|
||||
+
|
||||
+let zypp_rpm_detect () =
|
||||
+ (file_exists "/etc/SuSE-release") &&
|
||||
+ Config.zypper <> "no" && Config.rpm <> "no"
|
||||
+
|
||||
+let zypp_rpm_init () =
|
||||
+ if use_installed && Unix.getuid() > 0 then
|
||||
+ failwith "zypp_rpm driver doesn't support --use-installed when called as non-root user"
|
||||
+
|
||||
+let zypp_rpm_resolve_dependencies_and_download names =
|
||||
+ (* Liberate this data from shell. *)
|
||||
+ let tmp_pkg_cache_dir = tmpdir // "pkg_cache_dir" in
|
||||
+ let tmp_root = tmpdir // "root" in
|
||||
+ let sh = sprintf "
|
||||
+set -ex
|
||||
+unset LANG ${!LC_*}
|
||||
+tmpdir=%S
|
||||
+cache_dir=\"${tmpdir}/cache-dir\"
|
||||
+pkg_cache_dir=%S
|
||||
+time zypper \
|
||||
+ %s \
|
||||
+ %s \
|
||||
+ %s \
|
||||
+ --cache-dir \"${cache_dir}\" \
|
||||
+ --pkg-cache-dir \"${pkg_cache_dir}\" \
|
||||
+ --gpg-auto-import-keys \
|
||||
+ --non-interactive \
|
||||
+ install \
|
||||
+ --auto-agree-with-licenses \
|
||||
+ --download-only \
|
||||
+ $@
|
||||
+"
|
||||
+ tmpdir
|
||||
+ tmp_pkg_cache_dir
|
||||
+ (if verbose then "--verbose --verbose" else "--quiet")
|
||||
+ (match packager_config with None -> ""
|
||||
+ | Some filename -> sprintf "--config %s" filename)
|
||||
+ (if Unix.getuid() > 0 then sprintf "--root %S --reposd-dir /etc/zypp/repos.d" tmp_root else "")
|
||||
+ in
|
||||
+ run_shell sh names;
|
||||
+
|
||||
+ (* http://rosettacode.org/wiki/Walk_a_directory/Recursively *)
|
||||
+ let walk_directory_tree dir pattern =
|
||||
+ let select str = Str.string_match (Str.regexp pattern) str 0 in
|
||||
+ let rec walk acc = function
|
||||
+ | [] -> (acc)
|
||||
+ | dir::tail ->
|
||||
+ let contents = Array.to_list (Sys.readdir dir) in
|
||||
+ let contents = List.rev_map (Filename.concat dir) contents in
|
||||
+ let dirs, files =
|
||||
+ List.fold_left (fun (dirs,files) f ->
|
||||
+ match (stat f).st_kind with
|
||||
+ | S_REG -> (dirs, f::files) (* Regular file *)
|
||||
+ | S_DIR -> (f::dirs, files) (* Directory *)
|
||||
+ | _ -> (dirs, files)
|
||||
+ ) ([],[]) contents
|
||||
+ in
|
||||
+ let matched = List.filter (select) files in
|
||||
+ walk (matched @ acc) (dirs @ tail)
|
||||
+ in
|
||||
+ walk [] [dir]
|
||||
+ in
|
||||
+
|
||||
+ let pkgs = walk_directory_tree tmp_pkg_cache_dir ".*\\.rpm" in
|
||||
+
|
||||
+ (* Return list of package filenames. *)
|
||||
+ pkgs
|
||||
+
|
||||
+let rec zypp_rpm_list_files pkg =
|
||||
+ (* Run rpm -qlp with some extra magic. *)
|
||||
+ let cmd =
|
||||
+ sprintf "rpm -q --qf '[%%{FILENAMES} %%{FILEFLAGS:fflags} %%{FILEMODES} %%{FILESIZES}\\n]' -p %S"
|
||||
+ pkg in
|
||||
+ let lines = run_command_get_lines cmd in
|
||||
+
|
||||
+ let files =
|
||||
+ filter_map (
|
||||
+ fun line ->
|
||||
+ match string_split " " line with
|
||||
+ | [filename; flags; mode; size] ->
|
||||
+ let test_flag = String.contains flags in
|
||||
+ let mode = int_of_string mode in
|
||||
+ let size = int_of_string size in
|
||||
+ if test_flag 'd' then None (* ignore documentation *)
|
||||
+ else
|
||||
+ Some (filename, {
|
||||
+ ft_dir = mode land 0o40000 <> 0;
|
||||
+ ft_ghost = test_flag 'g'; ft_config = test_flag 'c';
|
||||
+ ft_mode = mode; ft_size = size;
|
||||
+ })
|
||||
+ | _ ->
|
||||
+ eprintf "supermin: bad output from rpm command: '%s'" line;
|
||||
+ exit 1
|
||||
+ ) lines in
|
||||
+
|
||||
+ (* I've never understood why the base packages like 'filesystem' don't
|
||||
+ * contain any /dev nodes at all. This leaves every program that
|
||||
+ * bootstraps RPMs to create a varying set of device nodes themselves.
|
||||
+ * This collection was copied from mock/backend.py.
|
||||
+ *)
|
||||
+ let files =
|
||||
+ let b = Filename.basename pkg in
|
||||
+ if string_prefix "filesystem-" b then (
|
||||
+ let dirs = [ "/proc"; "/sys"; "/dev"; "/dev/pts"; "/dev/shm";
|
||||
+ "/dev/mapper" ] in
|
||||
+ let dirs =
|
||||
+ List.map (fun name ->
|
||||
+ name, { ft_dir = true; ft_ghost = false;
|
||||
+ ft_config = false; ft_mode = 0o40755;
|
||||
+ ft_size = 0 }) dirs in
|
||||
+ let devs = [ "/dev/null"; "/dev/full"; "/dev/zero"; "/dev/random";
|
||||
+ "/dev/urandom"; "/dev/tty"; "/dev/console";
|
||||
+ "/dev/ptmx"; "/dev/stdin"; "/dev/stdout"; "/dev/stderr" ] in
|
||||
+ (* No need to set the mode because these will go into hostfiles. *)
|
||||
+ let devs =
|
||||
+ List.map (fun name ->
|
||||
+ name, { ft_dir = false; ft_ghost = false;
|
||||
+ ft_config = false; ft_mode = 0o644;
|
||||
+ ft_size = 0 }) devs in
|
||||
+ dirs @ devs @ files
|
||||
+ ) else files in
|
||||
+
|
||||
+ files
|
||||
+
|
||||
+let zypp_rpm_get_file_from_package pkg file =
|
||||
+ debug "extracting %s from %s ..." file (Filename.basename pkg);
|
||||
+
|
||||
+ let outfile = tmpdir // file in
|
||||
+ let cmd =
|
||||
+ sprintf "umask 0000; rpm2cpio %s | (cd %s && cpio --quiet -id .%s)"
|
||||
+ (Filename.quote pkg) (Filename.quote tmpdir) (Filename.quote file) in
|
||||
+ run_command cmd;
|
||||
+ outfile
|
||||
+
|
||||
+let () =
|
||||
+ let ph = {
|
||||
+ ph_detect = zypp_rpm_detect;
|
||||
+ ph_init = zypp_rpm_init;
|
||||
+ ph_resolve_dependencies_and_download =
|
||||
+ zypp_rpm_resolve_dependencies_and_download;
|
||||
+ ph_list_files = zypp_rpm_list_files;
|
||||
+ ph_get_file_from_package = zypp_rpm_get_file_from_package;
|
||||
+ } in
|
||||
+ register_package_handler "zypp-rpm" ph
|
@ -1,42 +0,0 @@
|
||||
From 235933bb68a378cb48c5c740b97e5075975edf9a Mon Sep 17 00:00:00 2001
|
||||
From: Olaf Hering <olaf@aepfle.de>
|
||||
Date: Thu, 11 Apr 2013 16:36:40 +0200
|
||||
Subject: always work with empty --root in zypp driver
|
||||
|
||||
The current mode of operation in the zypp driver is to download all
|
||||
packages into a temporary pkg-cache-dir. Installed packages in the root
|
||||
filesystem are ignored, otherwise zypper would download only a subset of
|
||||
packages, and it would not provide a list of all required dependencies.
|
||||
|
||||
Remove the getuid check to force an empty root directory and use the
|
||||
configured system repositories.
|
||||
|
||||
This works for root and non-root users.
|
||||
|
||||
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
||||
---
|
||||
src/supermin_zypp_rpm.ml | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/supermin_zypp_rpm.ml b/src/supermin_zypp_rpm.ml
|
||||
index 51f01eb..2089837 100644
|
||||
--- a/src/supermin_zypp_rpm.ml
|
||||
+++ b/src/supermin_zypp_rpm.ml
|
||||
@@ -50,7 +50,7 @@ pkg_cache_dir=%S
|
||||
time zypper \
|
||||
%s \
|
||||
%s \
|
||||
- %s \
|
||||
+ --root %S --reposd-dir /etc/zypp/repos.d \
|
||||
--cache-dir \"${cache_dir}\" \
|
||||
--pkg-cache-dir \"${pkg_cache_dir}\" \
|
||||
--gpg-auto-import-keys \
|
||||
@@ -65,7 +65,7 @@ time zypper \
|
||||
(if verbose then "--verbose --verbose" else "--quiet")
|
||||
(match packager_config with None -> ""
|
||||
| Some filename -> sprintf "--config %s" filename)
|
||||
- (if Unix.getuid() > 0 then sprintf "--root %S --reposd-dir /etc/zypp/repos.d" tmp_root else "")
|
||||
+ tmp_root
|
||||
in
|
||||
run_shell sh names;
|
||||
|
@ -1,155 +0,0 @@
|
||||
From 9750c2e6050d73276699090180dc2e43d87c9663 Mon Sep 17 00:00:00 2001
|
||||
From: Olaf Hering <olaf@aepfle.de>
|
||||
Date: Thu, 11 Apr 2013 19:07:11 +0200
|
||||
Subject: handle --use-installed in zypp driver
|
||||
|
||||
An attempt to use installed files in zypp driver.
|
||||
Add also a comment about the theory of operation.
|
||||
Enable set -x in shell only in verbose mode.
|
||||
This adds a dependency to xmlstarlet, which is required to parse zypper output.
|
||||
|
||||
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
||||
---
|
||||
src/supermin_zypp_rpm.ml | 93 +++++++++++++++++++++++++++++++++++++++++-------
|
||||
1 file changed, 80 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/src/supermin_zypp_rpm.ml b/src/supermin_zypp_rpm.ml
|
||||
index 2089837..0f3b63a 100644
|
||||
--- a/src/supermin_zypp_rpm.ml
|
||||
+++ b/src/supermin_zypp_rpm.ml
|
||||
@@ -18,6 +18,31 @@
|
||||
|
||||
(* Zypper and RPM support. *)
|
||||
|
||||
+(*
|
||||
+ * Theory of operation:
|
||||
+ * called as root:
|
||||
+ * - without --use-installed:
|
||||
+ * ->ph_resolve_dependencies_and_download() returns a list of filenames
|
||||
+ * Need to download all packages into an empty --root directory so that
|
||||
+ * zypper places all dependencies into --pkg-cache-dir
|
||||
+ * - with --use-installed:
|
||||
+ * ->ph_resolve_dependencies_and_download() returns a list of package names
|
||||
+ * Need to work with an empty --root directory so that zypper can list
|
||||
+ * all dependencies of "names". This mode assumes that all required packages
|
||||
+ * are installed and the system is consistent. Downloading just the missing
|
||||
+ * packages is not implemented.
|
||||
+ * called as non-root:
|
||||
+ * (Due to the usage of --root zypper does not require root permissions.)
|
||||
+ * - without --use-installed:
|
||||
+ * Same as above.
|
||||
+ * - with --use-installed:
|
||||
+ * Same as above.
|
||||
+ *
|
||||
+ * The usage of --packager-config is tricky: If --root is used zypper assumes
|
||||
+ * that every config file is below <rootdir>. So the config has to be parsed
|
||||
+ * and relevant files/dirs should be copied into <rootdir> so that zypper can
|
||||
+ * use the specified config.
|
||||
+ *)
|
||||
open Unix
|
||||
open Printf
|
||||
|
||||
@@ -34,15 +59,15 @@ let zypp_rpm_detect () =
|
||||
Config.zypper <> "no" && Config.rpm <> "no"
|
||||
|
||||
let zypp_rpm_init () =
|
||||
- if use_installed && Unix.getuid() > 0 then
|
||||
- failwith "zypp_rpm driver doesn't support --use-installed when called as non-root user"
|
||||
+ if use_installed then
|
||||
+ eprintf "supermin: zypp_rpm driver assumes all packages are already installed when called with option --use-installed.\n%!"
|
||||
|
||||
-let zypp_rpm_resolve_dependencies_and_download names =
|
||||
+let zypp_rpm_resolve_dependencies_and_download_no_installed names =
|
||||
(* Liberate this data from shell. *)
|
||||
let tmp_pkg_cache_dir = tmpdir // "pkg_cache_dir" in
|
||||
let tmp_root = tmpdir // "root" in
|
||||
let sh = sprintf "
|
||||
-set -ex
|
||||
+%s
|
||||
unset LANG ${!LC_*}
|
||||
tmpdir=%S
|
||||
cache_dir=\"${tmpdir}/cache-dir\"
|
||||
@@ -60,6 +85,7 @@ time zypper \
|
||||
--download-only \
|
||||
$@
|
||||
"
|
||||
+ (if verbose then "set -x" else "")
|
||||
tmpdir
|
||||
tmp_pkg_cache_dir
|
||||
(if verbose then "--verbose --verbose" else "--quiet")
|
||||
@@ -96,10 +122,47 @@ time zypper \
|
||||
(* Return list of package filenames. *)
|
||||
pkgs
|
||||
|
||||
+let zypp_rpm_resolve_dependencies_and_download_use_installed names =
|
||||
+ let cmd = sprintf "
|
||||
+%s
|
||||
+unset LANG ${!LC_*}
|
||||
+zypper \
|
||||
+ %s \
|
||||
+ %s \
|
||||
+ --root %S --reposd-dir /dev/shm/supermin/zypp/repos.d \
|
||||
+ --cache-dir %S \
|
||||
+ --gpg-auto-import-keys \
|
||||
+ --non-interactive \
|
||||
+ --xml \
|
||||
+ install \
|
||||
+ --auto-agree-with-licenses \
|
||||
+ --dry-run \
|
||||
+ %s | \
|
||||
+ xml sel -t \
|
||||
+ -m \"stream/install-summary/to-install/solvable[%@type='package']\" \
|
||||
+ -c \"string(%@name)\" -n
|
||||
+"
|
||||
+ (if verbose then "set -x" else "")
|
||||
+ (if verbose then "--verbose --verbose" else "--quiet")
|
||||
+ (match packager_config with None -> ""
|
||||
+ | Some filename -> sprintf "--config %s" filename)
|
||||
+ tmpdir tmpdir (String.concat " " (List.map Filename.quote names)) in
|
||||
+ let pkg_names = run_command_get_lines cmd in
|
||||
+
|
||||
+ (* Return list of package names, remove empty lines. *)
|
||||
+ List.filter (fun s -> s <> "") pkg_names
|
||||
+
|
||||
+let zypp_rpm_resolve_dependencies_and_download names =
|
||||
+ if use_installed then
|
||||
+ zypp_rpm_resolve_dependencies_and_download_use_installed names
|
||||
+ else
|
||||
+ zypp_rpm_resolve_dependencies_and_download_no_installed names
|
||||
+
|
||||
let rec zypp_rpm_list_files pkg =
|
||||
(* Run rpm -qlp with some extra magic. *)
|
||||
let cmd =
|
||||
- sprintf "rpm -q --qf '[%%{FILENAMES} %%{FILEFLAGS:fflags} %%{FILEMODES} %%{FILESIZES}\\n]' -p %S"
|
||||
+ sprintf "rpm -q --qf '[%%{FILENAMES} %%{FILEFLAGS:fflags} %%{FILEMODES} %%{FILESIZES}\\n]' %s %S"
|
||||
+ (if use_installed then "" else "-p")
|
||||
pkg in
|
||||
let lines = run_command_get_lines cmd in
|
||||
|
||||
@@ -153,14 +216,18 @@ let rec zypp_rpm_list_files pkg =
|
||||
files
|
||||
|
||||
let zypp_rpm_get_file_from_package pkg file =
|
||||
- debug "extracting %s from %s ..." file (Filename.basename pkg);
|
||||
-
|
||||
- let outfile = tmpdir // file in
|
||||
- let cmd =
|
||||
- sprintf "umask 0000; rpm2cpio %s | (cd %s && cpio --quiet -id .%s)"
|
||||
- (Filename.quote pkg) (Filename.quote tmpdir) (Filename.quote file) in
|
||||
- run_command cmd;
|
||||
- outfile
|
||||
+ if use_installed then
|
||||
+ file
|
||||
+ else (
|
||||
+ debug "extracting %s from %s ..." file (Filename.basename pkg);
|
||||
+
|
||||
+ let outfile = tmpdir // file in
|
||||
+ let cmd =
|
||||
+ sprintf "umask 0000; rpm2cpio %s | (cd %s && cpio --quiet -id .%s)"
|
||||
+ (Filename.quote pkg) (Filename.quote tmpdir) (Filename.quote file) in
|
||||
+ run_command cmd;
|
||||
+ outfile
|
||||
+ )
|
||||
|
||||
let () =
|
||||
let ph = {
|
@ -1,34 +0,0 @@
|
||||
From c1353a4933d30ce9103149586fec2b997870b6fc Mon Sep 17 00:00:00 2001
|
||||
From: Olaf Hering <olaf@aepfle.de>
|
||||
Date: Thu, 11 Apr 2013 19:56:42 +0200
|
||||
Subject: skip unreadable files in zypp_rpm_list_files
|
||||
|
||||
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
||||
---
|
||||
src/supermin_zypp_rpm.ml | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/supermin_zypp_rpm.ml b/src/supermin_zypp_rpm.ml
|
||||
index 0f3b63a..9aa9de6 100644
|
||||
--- a/src/supermin_zypp_rpm.ml
|
||||
+++ b/src/supermin_zypp_rpm.ml
|
||||
@@ -175,12 +175,18 @@ let rec zypp_rpm_list_files pkg =
|
||||
let mode = int_of_string mode in
|
||||
let size = int_of_string size in
|
||||
if test_flag 'd' then None (* ignore documentation *)
|
||||
- else
|
||||
+ else (
|
||||
+ (* Skip unreadable files when called as non-root *)
|
||||
+ if Unix.getuid() > 0 &&
|
||||
+ (try Unix.access filename [Unix.R_OK]; false with
|
||||
+ Unix_error _ -> eprintf "supermin: EPERM %s\n%!" filename; true) then None
|
||||
+ else
|
||||
Some (filename, {
|
||||
ft_dir = mode land 0o40000 <> 0;
|
||||
ft_ghost = test_flag 'g'; ft_config = test_flag 'c';
|
||||
ft_mode = mode; ft_size = size;
|
||||
})
|
||||
+ )
|
||||
| _ ->
|
||||
eprintf "supermin: bad output from rpm command: '%s'" line;
|
||||
exit 1
|
@ -1,41 +0,0 @@
|
||||
From 7a2b8a95e0e6d8dea105db6853d23a6e6d68694e Mon Sep 17 00:00:00 2001
|
||||
From: Olaf Hering <olaf@aepfle.de>
|
||||
Date: Thu, 11 Apr 2013 19:57:41 +0200
|
||||
Subject: remove leading tabs in zypp driver
|
||||
|
||||
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
||||
---
|
||||
src/supermin_zypp_rpm.ml | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/supermin_zypp_rpm.ml b/src/supermin_zypp_rpm.ml
|
||||
index 9aa9de6..09b1695 100644
|
||||
--- a/src/supermin_zypp_rpm.ml
|
||||
+++ b/src/supermin_zypp_rpm.ml
|
||||
@@ -173,7 +173,7 @@ let rec zypp_rpm_list_files pkg =
|
||||
| [filename; flags; mode; size] ->
|
||||
let test_flag = String.contains flags in
|
||||
let mode = int_of_string mode in
|
||||
- let size = int_of_string size in
|
||||
+ let size = int_of_string size in
|
||||
if test_flag 'd' then None (* ignore documentation *)
|
||||
else (
|
||||
(* Skip unreadable files when called as non-root *)
|
||||
@@ -206,7 +206,7 @@ let rec zypp_rpm_list_files pkg =
|
||||
List.map (fun name ->
|
||||
name, { ft_dir = true; ft_ghost = false;
|
||||
ft_config = false; ft_mode = 0o40755;
|
||||
- ft_size = 0 }) dirs in
|
||||
+ ft_size = 0 }) dirs in
|
||||
let devs = [ "/dev/null"; "/dev/full"; "/dev/zero"; "/dev/random";
|
||||
"/dev/urandom"; "/dev/tty"; "/dev/console";
|
||||
"/dev/ptmx"; "/dev/stdin"; "/dev/stdout"; "/dev/stderr" ] in
|
||||
@@ -215,7 +215,7 @@ let rec zypp_rpm_list_files pkg =
|
||||
List.map (fun name ->
|
||||
name, { ft_dir = false; ft_ghost = false;
|
||||
ft_config = false; ft_mode = 0o644;
|
||||
- ft_size = 0 }) devs in
|
||||
+ ft_size = 0 }) devs in
|
||||
dirs @ devs @ files
|
||||
) else files in
|
||||
|
@ -1,25 +0,0 @@
|
||||
From c884b2bafa8434f8b15ec2d26bde4005a85cf9df Mon Sep 17 00:00:00 2001
|
||||
From: Olaf Hering <olaf@aepfle.de>
|
||||
Date: Thu, 11 Apr 2013 20:34:23 +0200
|
||||
Subject: use correct repos.d in zypp driver
|
||||
|
||||
A temporary dir used during debugging was added in a previous patch.
|
||||
|
||||
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
||||
---
|
||||
src/supermin_zypp_rpm.ml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/supermin_zypp_rpm.ml b/src/supermin_zypp_rpm.ml
|
||||
index 09b1695..ddc4085 100644
|
||||
--- a/src/supermin_zypp_rpm.ml
|
||||
+++ b/src/supermin_zypp_rpm.ml
|
||||
@@ -129,7 +129,7 @@ unset LANG ${!LC_*}
|
||||
zypper \
|
||||
%s \
|
||||
%s \
|
||||
- --root %S --reposd-dir /dev/shm/supermin/zypp/repos.d \
|
||||
+ --root %S --reposd-dir /etc/zypp/repos.d \
|
||||
--cache-dir %S \
|
||||
--gpg-auto-import-keys \
|
||||
--non-interactive \
|
@ -1,25 +0,0 @@
|
||||
From 5402943711abee13357c4951a96eeb634c2b9910 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 11 Apr 2013 23:09:30 +0100
|
||||
Subject: zypper: Use %%@ instead of %@.
|
||||
|
||||
OCaml 3.12.1 can't handle incorrect format string pattern "%@".
|
||||
---
|
||||
src/supermin_zypp_rpm.ml | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/supermin_zypp_rpm.ml b/src/supermin_zypp_rpm.ml
|
||||
index ddc4085..5d97205 100644
|
||||
--- a/src/supermin_zypp_rpm.ml
|
||||
+++ b/src/supermin_zypp_rpm.ml
|
||||
@@ -139,8 +139,8 @@ zypper \
|
||||
--dry-run \
|
||||
%s | \
|
||||
xml sel -t \
|
||||
- -m \"stream/install-summary/to-install/solvable[%@type='package']\" \
|
||||
- -c \"string(%@name)\" -n
|
||||
+ -m \"stream/install-summary/to-install/solvable[%%@type='package']\" \
|
||||
+ -c \"string(%%@name)\" -n
|
||||
"
|
||||
(if verbose then "set -x" else "")
|
||||
(if verbose then "--verbose --verbose" else "--quiet")
|
@ -1,37 +0,0 @@
|
||||
From 67194fc1feac8c99aeafb49ae92ab1996c320312 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Thu, 11 Apr 2013 23:20:37 +0100
|
||||
Subject: debian: Experiment with different options for 'apt-cache depends'.
|
||||
|
||||
However this commit does not change the current situation.
|
||||
---
|
||||
src/supermin_debian.ml | 14 ++++++++++++--
|
||||
1 file changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/supermin_debian.ml b/src/supermin_debian.ml
|
||||
index d0bcce8..da75c90 100644
|
||||
--- a/src/supermin_debian.ml
|
||||
+++ b/src/supermin_debian.ml
|
||||
@@ -43,10 +43,20 @@ let get_installed_pkgs () =
|
||||
| [] -> assert false
|
||||
| pkgs -> pkgs
|
||||
|
||||
+(* Select which dependencies will be installed. See apt-cache(8) for
|
||||
+ * complete details. Using "-i" means only Depends and Pre-depends
|
||||
+ * are installed, which is stricter (fewer packages) than ordinary
|
||||
+ * 'apt-get install'. Otherwise, enable everything, then selectively
|
||||
+ * disable what you don't want, to make it behave more like
|
||||
+ * 'apt-get install'.
|
||||
+ *)
|
||||
+let which_dependencies = "-i"
|
||||
+(*let which_dependencies = "--no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances"*)
|
||||
+
|
||||
let rec debian_resolve_dependencies_and_download names =
|
||||
let cmd =
|
||||
- sprintf "%s depends --recurse -i %s | grep -v '^[<[:space:]]' | grep -Ev ':\\w+\\b'"
|
||||
- Config.apt_cache
|
||||
+ sprintf "%s depends --recurse %s %s | grep -v '^[<[:space:]]' | grep -Ev ':\\w+\\b'"
|
||||
+ Config.apt_cache which_dependencies
|
||||
(String.concat " " (List.map Filename.quote names)) in
|
||||
let pkgs = run_command_get_lines cmd in
|
||||
let pkgs =
|
@ -1,27 +0,0 @@
|
||||
From 3329297abe2e7e055337583b2221fcade85f9f6b Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 29 Apr 2013 16:24:05 +0100
|
||||
Subject: zypp: Fix XPath expressions.
|
||||
|
||||
See:
|
||||
|
||||
https://www.redhat.com/archives/libguestfs/2013-April/thread.html#00075
|
||||
---
|
||||
src/supermin_zypp_rpm.ml | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/supermin_zypp_rpm.ml b/src/supermin_zypp_rpm.ml
|
||||
index 5d97205..c269aab 100644
|
||||
--- a/src/supermin_zypp_rpm.ml
|
||||
+++ b/src/supermin_zypp_rpm.ml
|
||||
@@ -139,8 +139,8 @@ zypper \
|
||||
--dry-run \
|
||||
%s | \
|
||||
xml sel -t \
|
||||
- -m \"stream/install-summary/to-install/solvable[%%@type='package']\" \
|
||||
- -c \"string(%%@name)\" -n
|
||||
+ -m \"stream/install-summary/to-install/solvable[@type='package']\" \
|
||||
+ -c \"string(@name)\" -n
|
||||
"
|
||||
(if verbose then "set -x" else "")
|
||||
(if verbose then "--verbose --verbose" else "--quiet")
|
@ -1,26 +0,0 @@
|
||||
From 9da479658818738b2a2a68456e867cdb609472c8 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 14 May 2013 19:21:04 +0100
|
||||
Subject: helper: Add megaraid drivers to the initrd.
|
||||
|
||||
This allows you to use the megaraid SAS emulation
|
||||
in qemu if you want.
|
||||
|
||||
Primarily I added this so I could test:
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=962079#c4
|
||||
---
|
||||
helper/ext2initrd.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/helper/ext2initrd.c b/helper/ext2initrd.c
|
||||
index aa3259f..8dab5e9 100644
|
||||
--- a/helper/ext2initrd.c
|
||||
+++ b/helper/ext2initrd.c
|
||||
@@ -68,6 +68,7 @@ static const char *kmods[] = {
|
||||
"crc*.ko*",
|
||||
"libcrc*.ko*",
|
||||
"ibmvscsic.ko*",
|
||||
+ "megaraid*.ko*",
|
||||
NULL
|
||||
};
|
||||
|
@ -1,23 +0,0 @@
|
||||
From 7b98faa1ca69115c8dc54ff1a19c8200d1415a1e Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Mon, 3 Jun 2013 14:30:26 +0100
|
||||
Subject: helper: Add a note that cpio might not be able to read -f cpio files.
|
||||
|
||||
---
|
||||
helper/supermin-helper.pod | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/helper/supermin-helper.pod b/helper/supermin-helper.pod
|
||||
index 86d7a97..8d5f8e3 100644
|
||||
--- a/helper/supermin-helper.pod
|
||||
+++ b/helper/supermin-helper.pod
|
||||
@@ -57,6 +57,9 @@ A Linux initramfs. This is the default.
|
||||
In this case you have to supply names for the C<kernel>
|
||||
and C<initrd>, where the C<initrd> is the appliance.
|
||||
|
||||
+Note that L<cpio(1)> might not be able to extract this file fully.
|
||||
+The format used by the Linux kernel is not quite a true cpio file.
|
||||
+
|
||||
=item ext2
|
||||
|
||||
An ext2 filesystem.
|
@ -1,125 +0,0 @@
|
||||
From 33d50fbe36a4a1eca5e7b3e3a1dcb2ce68b1a7e6 Mon Sep 17 00:00:00 2001
|
||||
From: Olaf Hering <olaf@aepfle.de>
|
||||
Date: Tue, 4 Jun 2013 11:37:45 +0200
|
||||
Subject: Handle --packager-config in zypp_rpm
|
||||
|
||||
This is an attempt to handle a different --reposd-dir in the zypp_rpm
|
||||
driver. Up to now the system repositories in /etc/zypp/repos.d were
|
||||
used.
|
||||
|
||||
To specify a different set of repositories for zypp a parser for a
|
||||
simple zypper.conf is added in this patch. It just looks for reposdir=
|
||||
in section main, like this:
|
||||
|
||||
[main]
|
||||
reposdir=/path/to/other/repofiles
|
||||
|
||||
If the config file provided via "--packager-config my_zypp.conf" is
|
||||
valid the other directory is passed to zypper, otherwise the system
|
||||
repos.d is used like its done in current code.
|
||||
|
||||
Depending on the kind of provided repos, the current code may fail to
|
||||
import a repo in non-interactive mode. This happens if the repo data are
|
||||
not properly signed. For this reason the option --no-gpg-checks is added
|
||||
by this patch.
|
||||
|
||||
Finally, the parser uses ocaml-inifiles to read the config file. This is
|
||||
a new build dependency. inifiles should be available in various
|
||||
distributions, copies of the original sources can be found via google.
|
||||
|
||||
This patch has received some light testing, I sent it out to the list
|
||||
for further comments. Particular about the new inifiles dependency..
|
||||
|
||||
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
||||
---
|
||||
src/Makefile.am | 2 +-
|
||||
src/supermin_zypp_rpm.ml | 23 ++++++++++++++++++++---
|
||||
2 files changed, 21 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||
index 3b6ca9b..6ed0faf 100644
|
||||
--- a/src/Makefile.am
|
||||
+++ b/src/Makefile.am
|
||||
@@ -56,7 +56,7 @@ OBJECTS = $(XOBJECTS)
|
||||
BEST = opt
|
||||
endif
|
||||
|
||||
-OCAMLPACKAGES = -package unix,str
|
||||
+OCAMLPACKAGES = -package unix,str,inifiles
|
||||
OCAMLFLAGS = -warn-error CDEFLMPSUVXYZ
|
||||
|
||||
supermin: $(OBJECTS)
|
||||
diff --git a/src/supermin_zypp_rpm.ml b/src/supermin_zypp_rpm.ml
|
||||
index c269aab..c9786ce 100644
|
||||
--- a/src/supermin_zypp_rpm.ml
|
||||
+++ b/src/supermin_zypp_rpm.ml
|
||||
@@ -45,6 +45,7 @@
|
||||
*)
|
||||
open Unix
|
||||
open Printf
|
||||
+open Inifiles
|
||||
|
||||
open Supermin_package_handlers
|
||||
open Supermin_utils
|
||||
@@ -54,6 +55,19 @@ open Supermin_cmdline
|
||||
(* Create a temporary directory for use by all the functions in this file. *)
|
||||
let tmpdir = tmpdir ()
|
||||
|
||||
+let get_repos_dir () =
|
||||
+ let zypper_default = "/etc/zypp/repos.d" in
|
||||
+ let parse_repos_dir path =
|
||||
+ let cfg = new inifile path in
|
||||
+ let dir = (try cfg#getval "main" "reposdir" with _ -> zypper_default) in
|
||||
+ dir
|
||||
+ in
|
||||
+ let dir = (match packager_config with None -> zypper_default |
|
||||
+ Some filename -> (try parse_repos_dir filename with _ -> zypper_default) ) in
|
||||
+ dir
|
||||
+
|
||||
+let repos_dir = get_repos_dir ()
|
||||
+
|
||||
let zypp_rpm_detect () =
|
||||
(file_exists "/etc/SuSE-release") &&
|
||||
Config.zypper <> "no" && Config.rpm <> "no"
|
||||
@@ -75,10 +89,11 @@ pkg_cache_dir=%S
|
||||
time zypper \
|
||||
%s \
|
||||
%s \
|
||||
- --root %S --reposd-dir /etc/zypp/repos.d \
|
||||
+ --root %S --reposd-dir %S \
|
||||
--cache-dir \"${cache_dir}\" \
|
||||
--pkg-cache-dir \"${pkg_cache_dir}\" \
|
||||
--gpg-auto-import-keys \
|
||||
+ --no-gpg-checks \
|
||||
--non-interactive \
|
||||
install \
|
||||
--auto-agree-with-licenses \
|
||||
@@ -92,6 +107,7 @@ time zypper \
|
||||
(match packager_config with None -> ""
|
||||
| Some filename -> sprintf "--config %s" filename)
|
||||
tmp_root
|
||||
+ repos_dir
|
||||
in
|
||||
run_shell sh names;
|
||||
|
||||
@@ -129,9 +145,10 @@ unset LANG ${!LC_*}
|
||||
zypper \
|
||||
%s \
|
||||
%s \
|
||||
- --root %S --reposd-dir /etc/zypp/repos.d \
|
||||
+ --root %S --reposd-dir %S \
|
||||
--cache-dir %S \
|
||||
--gpg-auto-import-keys \
|
||||
+ --no-gpg-checks \
|
||||
--non-interactive \
|
||||
--xml \
|
||||
install \
|
||||
@@ -146,7 +163,7 @@ zypper \
|
||||
(if verbose then "--verbose --verbose" else "--quiet")
|
||||
(match packager_config with None -> ""
|
||||
| Some filename -> sprintf "--config %s" filename)
|
||||
- tmpdir tmpdir (String.concat " " (List.map Filename.quote names)) in
|
||||
+ tmpdir repos_dir tmpdir (String.concat " " (List.map Filename.quote names)) in
|
||||
let pkg_names = run_command_get_lines cmd in
|
||||
|
||||
(* Return list of package names, remove empty lines. *)
|
@ -1,22 +0,0 @@
|
||||
From bf784ff3fedf37a230915ad3d278d1df22a25715 Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 4 Jun 2013 15:30:19 +0100
|
||||
Subject: zypp: Trailing whitespace.
|
||||
|
||||
---
|
||||
src/supermin_zypp_rpm.ml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/supermin_zypp_rpm.ml b/src/supermin_zypp_rpm.ml
|
||||
index c9786ce..655ba99 100644
|
||||
--- a/src/supermin_zypp_rpm.ml
|
||||
+++ b/src/supermin_zypp_rpm.ml
|
||||
@@ -57,7 +57,7 @@ let tmpdir = tmpdir ()
|
||||
|
||||
let get_repos_dir () =
|
||||
let zypper_default = "/etc/zypp/repos.d" in
|
||||
- let parse_repos_dir path =
|
||||
+ let parse_repos_dir path =
|
||||
let cfg = new inifile path in
|
||||
let dir = (try cfg#getval "main" "reposdir" with _ -> zypper_default) in
|
||||
dir
|
@ -1,118 +0,0 @@
|
||||
From e1dda9fde6193cc4cf42f359ee235369314857fa Mon Sep 17 00:00:00 2001
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Tue, 4 Jun 2013 15:32:35 +0100
|
||||
Subject: zypp: Only compile zypper support if OCaml inifiles module is found.
|
||||
|
||||
---
|
||||
README | 2 ++
|
||||
configure.ac | 4 ++++
|
||||
src/.depend | 2 --
|
||||
src/Makefile.am | 36 ++++++++++++++++++++++++++++--------
|
||||
4 files changed, 34 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/README b/README
|
||||
index c3e7699..cf16fbe 100644
|
||||
--- a/README
|
||||
+++ b/README
|
||||
@@ -60,6 +60,8 @@ For Debian/Ubuntu:
|
||||
Optional
|
||||
--------
|
||||
|
||||
+ ocaml inifiles library (needed for zypper only)
|
||||
+
|
||||
These are only needed if you plan to boot the supermin appliances you
|
||||
are building:
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index f975f3f..83f95e2 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -56,6 +56,10 @@ if test "$OCAMLFIND" = "no"; then
|
||||
AC_MSG_ERROR([You must install OCaml findlib (the ocamlfind command)])
|
||||
fi
|
||||
|
||||
+dnl Optional OCaml packages.
|
||||
+AC_CHECK_OCAML_PKG([inifiles])
|
||||
+AM_CONDITIONAL([HAVE_OCAML_INIFILES], [test "x$OCAML_PKG_inifiles" != "xno"])
|
||||
+
|
||||
dnl Optional programs.
|
||||
AC_CHECK_PROG(PERLDOC,[perldoc],[perldoc],[no])
|
||||
if test "x$PERLDOC" = "xno" ; then
|
||||
diff --git a/src/.depend b/src/.depend
|
||||
index 36a642f..624191e 100644
|
||||
--- a/src/.depend
|
||||
+++ b/src/.depend
|
||||
@@ -17,5 +17,3 @@ supermin_utils.cmo: supermin_cmdline.cmi supermin_utils.cmi
|
||||
supermin_utils.cmx: supermin_cmdline.cmx supermin_utils.cmi
|
||||
supermin_yum_rpm.cmo: supermin_utils.cmi supermin_package_handlers.cmi supermin_cmdline.cmi config.cmo
|
||||
supermin_yum_rpm.cmx: supermin_utils.cmx supermin_package_handlers.cmx supermin_cmdline.cmx config.cmx
|
||||
-supermin_zypp_rpm.cmo: supermin_utils.cmi supermin_package_handlers.cmi supermin_cmdline.cmi config.cmo
|
||||
-supermin_zypp_rpm.cmx: supermin_utils.cmx supermin_package_handlers.cmx supermin_cmdline.cmx config.cmx
|
||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||
index 6ed0faf..b0a6723 100644
|
||||
--- a/src/Makefile.am
|
||||
+++ b/src/Makefile.am
|
||||
@@ -17,6 +17,22 @@
|
||||
#
|
||||
# Written by Richard W.M. Jones <rjones@redhat.com>
|
||||
|
||||
+EXTRA_DIST = \
|
||||
+ config.ml \
|
||||
+ supermin.8 \
|
||||
+ supermin.pod \
|
||||
+ supermin.ml \
|
||||
+ supermin_cmdline.mli \
|
||||
+ supermin_cmdline.ml \
|
||||
+ supermin_debian.ml \
|
||||
+ supermin_package_handlers.mli \
|
||||
+ supermin_package_handlers.ml \
|
||||
+ supermin_pacman.ml \
|
||||
+ supermin_utils.mli \
|
||||
+ supermin_utils.ml \
|
||||
+ supermin_yum_rpm.ml \
|
||||
+ supermin_zypp_rpm.ml
|
||||
+
|
||||
# Note these must be in build dependency order.
|
||||
SOURCES = \
|
||||
config.ml \
|
||||
@@ -25,8 +41,14 @@ SOURCES = \
|
||||
supermin_utils.mli \
|
||||
supermin_utils.ml \
|
||||
supermin_package_handlers.mli \
|
||||
- supermin_package_handlers.ml \
|
||||
- supermin_zypp_rpm.ml \
|
||||
+ supermin_package_handlers.ml
|
||||
+
|
||||
+if HAVE_OCAML_INIFILES
|
||||
+SOURCES += \
|
||||
+ supermin_zypp_rpm.ml
|
||||
+endif
|
||||
+
|
||||
+SOURCES += \
|
||||
supermin_yum_rpm.ml \
|
||||
supermin_debian.ml \
|
||||
supermin_pacman.ml \
|
||||
@@ -34,11 +56,6 @@ SOURCES = \
|
||||
|
||||
CLEANFILES = *~ *.cmi *.cmo *.cmx *.o supermin
|
||||
|
||||
-EXTRA_DIST = \
|
||||
- supermin.8 \
|
||||
- supermin.pod \
|
||||
- $(SOURCES)
|
||||
-
|
||||
man_MANS = \
|
||||
supermin.8
|
||||
|
||||
@@ -56,7 +73,10 @@ OBJECTS = $(XOBJECTS)
|
||||
BEST = opt
|
||||
endif
|
||||
|
||||
-OCAMLPACKAGES = -package unix,str,inifiles
|
||||
+OCAMLPACKAGES = -package unix,str
|
||||
+if HAVE_OCAML_INIFILES
|
||||
+OCAMLPACKAGES += -package inifiles
|
||||
+endif
|
||||
OCAMLFLAGS = -warn-error CDEFLMPSUVXYZ
|
||||
|
||||
supermin: $(OBJECTS)
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f3ff7e21d237f10206e940ae26259b56a46dbfeeec0c99970d800b91dcb85a6b
|
||||
size 411692
|
3
supermin-4.1.3.tar.xz
Normal file
3
supermin-4.1.3.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:57ebc12de72b820a95486cd041b3dc82bbf991fc5baede18ec636f20fc02626b
|
||||
size 421972
|
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 19 18:58:20 CEST 2013 - ohering@suse.de
|
||||
|
||||
- Update to version 4.1.3
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jun 4 16:59:21 CEST 2013 - ohering@suse.de
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
Name: supermin
|
||||
Version: 4.1.1
|
||||
Version: 4.1.3
|
||||
Release: %(bash %_sourcedir/get_release_number.sh)
|
||||
Url: http://libguestfs.org/
|
||||
Summary: Bootstrapping tool for creating supermin appliances
|
||||
@ -29,24 +29,6 @@ Requires: xmlstarlet
|
||||
Requires: zypper
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Source0: http://libguestfs.org/download/supermin/supermin-%{version}.tar.xz
|
||||
Patch1: 0001-Actually-update-gnulib.patch
|
||||
Patch2: 0002-helper-Add-missing-options-to-help-and-man-page-RHBZ.patch
|
||||
Patch3: 0003-add-run_shell-helper.patch
|
||||
Patch4: 0004-add-support-for-zypp.patch
|
||||
Patch5: 0005-always-work-with-empty-root-in-zypp-driver.patch
|
||||
Patch6: 0006-handle-use-installed-in-zypp-driver.patch
|
||||
Patch7: 0007-skip-unreadable-files-in-zypp_rpm_list_files.patch
|
||||
Patch8: 0008-remove-leading-tabs-in-zypp-driver.patch
|
||||
Patch9: 0009-use-correct-repos.d-in-zypp-driver.patch
|
||||
Patch10: 0010-zypper-Use-instead-of.patch
|
||||
Patch11: 0011-debian-Experiment-with-different-options-for-apt-cac.patch
|
||||
Patch12: 0012-zypp-Fix-XPath-expressions.patch
|
||||
Patch13: 0013-helper-Add-megaraid-drivers-to-the-initrd.patch
|
||||
Patch14: 0014-helper-Add-a-note-that-cpio-might-not-be-able-to-rea.patch
|
||||
Patch15: 0015-Handle-packager-config-in-zypp_rpm.patch
|
||||
Patch16: 0016-zypp-Trailing-whitespace.patch
|
||||
Patch17: 0017-zypp-Only-compile-zypper-support-if-OCaml-inifiles-m.patch
|
||||
|
||||
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
@ -68,23 +50,6 @@ you need to boot one of them.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
%patch17 -p1
|
||||
|
||||
%build
|
||||
export ZYPPER=zypper
|
||||
|
Loading…
Reference in New Issue
Block a user