Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package distrobox for openSUSE:Factory 
checked in at 2022-07-29 16:47:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/distrobox (Old)
 and      /work/SRC/openSUSE:Factory/.distrobox.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "distrobox"

Fri Jul 29 16:47:24 2022 rev:6 rq:991609 version:1.3.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/distrobox/distrobox.changes      2022-06-23 
10:24:44.083770263 +0200
+++ /work/SRC/openSUSE:Factory/.distrobox.new.1533/distrobox.changes    
2022-07-29 16:47:41.846619113 +0200
@@ -1,0 +2,29 @@
+Thu Jul 28 09:48:32 UTC 2022 - Dario Faggioli <[email protected]>
+
+- Fix a (potential) problem with man and manpages
+  * Patch added:
+    0002-distrobox-handle-situations-with-weird-manpages-setu.patch
+- Default to distrobox-enter when only typing distrobox
+  * Patch added:
+    0003-distrobox-if-no-command-is-specified-default-to-ente.patch
+- Reordered the patchqueue:
+  * Patch removed:
+    0002-opensuse-check-for-the-config-file-in-usr-etc-too.patch
+  * Patch added:
+    0004-opensuse-check-for-the-config-file-in-usr-etc-too.patch
+
+-------------------------------------------------------------------
+Wed Jul 27 11:31:23 UTC 2022 - Dario Faggioli <[email protected]>
+
+- enable non-interactive mode by default
+- Fix a but with automatic cretion of rootful containers
+  * Patch added:
+    0001-enter-fix-automatic-container-creation-when-r-is-use.patch
+- Rework the /usr/etc config file patch (better changelog)
+  * Patch removed:
+    0001-Read-config-in-usr-etc-too.patch
+  * Patch added:
+    0002-opensuse-check-for-the-config-file-in-usr-etc-too.patch
+- Switched to %autosetup in the spec file
+
+-------------------------------------------------------------------

Old:
----
  0001-Read-config-in-usr-etc-too.patch

New:
----
  0001-enter-fix-automatic-container-creation-when-r-is-use.patch
  0002-distrobox-handle-situations-with-weird-manpages-setu.patch
  0003-distrobox-if-no-command-is-specified-default-to-ente.patch
  0004-opensuse-check-for-the-config-file-in-usr-etc-too.patch

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

Other differences:
------------------
++++++ distrobox.spec ++++++
--- /var/tmp/diff_new_pack.9Vwi71/_old  2022-07-29 16:47:42.362620548 +0200
+++ /var/tmp/diff_new_pack.9Vwi71/_new  2022-07-29 16:47:42.366620559 +0200
@@ -23,8 +23,14 @@
 URL:            https://github.com/89luca89/distrobox
 Source:         distrobox-%{version}.tar.gz
 Source1:        distrobox.conf
+# Fix a problem with automatic rootful container creation (from upstream)
+Patch1:         0001-enter-fix-automatic-container-creation-when-r-is-use.patch
+# Fix a problem if man is there but actual manpages are stripped (from 
upstream PR)
+Patch2:         0002-distrobox-handle-situations-with-weird-manpages-setu.patch
+# Default to distrobox-enter when just distrobox is used
+Patch3:         0003-distrobox-if-no-command-is-specified-default-to-ente.patch
 # Read the config from vendor specific directory (/usr/etc/distrobox) too
-Patch1:         0001-Read-config-in-usr-etc-too.patch
+Patch4:         0004-opensuse-check-for-the-config-file-in-usr-etc-too.patch
 Requires:       %{_bindir}/basename
 Requires:       %{_bindir}/find
 Requires:       %{_bindir}/grep
@@ -40,8 +46,7 @@
 external USB devices and graphical apps (X11/Wayland), and audio.
 
 %prep
-%setup -q -n distrobox-%{version}
-%patch1 -p1
+%autosetup -p1 -n distrobox-%{version}
 
 %build
 

++++++ 0001-enter-fix-automatic-container-creation-when-r-is-use.patch ++++++
>From 2773eff4dcafc8df176f74b001a56557c7893507 Mon Sep 17 00:00:00 2001
From: Dario Faggioli <[email protected]>
Date: Wed, 27 Jul 2022 13:17:34 +0200
Subject: [PATCH 1/4] enter: fix automatic container creation when '-r' is used
 (#364)

When calling 'distrobox-create', from inside 'distrobox-enter' (in cause
automatic creation of the container is enabled) we were not "forwarding"
the '-r' flag properly. Therefore, when 'distrobox enter -r' was used,
we were trying to create a rootless container, which is obviously wrong!

Fixes: 8b195e3328d0a6fb19564555dec067c607fa8116
Signed-off-by: Dario Faggioli <[email protected]>
(cherry picked from commit 19aa7bfccc1726551eda9df36403da58beb00823)
Signed-off-by: Dario Faggioli <[email protected]>
---
 distrobox-enter | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/distrobox-enter b/distrobox-enter
index 138446c..e754c6b 100755
--- a/distrobox-enter
+++ b/distrobox-enter
@@ -407,10 +407,15 @@ if [ "${container_status}" = "unknown" ]; then
        case "${response}" in
                y | Y | Yes | yes | YES)
                        # Ok, let's create the container with just 'distrobox 
create $container_name
+                       create_command="$(dirname "${0}")/distrobox-create"
+                       if [ "${rootful}" -ne 0 ]; then
+                               create_command="${create_command} --root"
+                       fi
+                       create_command="${create_command} -i ${container_image} 
-n ${container_name}"
                        printf >&2 "Creating the container with command:\n"
-                       printf >&2 "  distrobox create -i %s %s\n" 
"${container_image}" "${container_name}"
+                       printf >&2 "  %s\n" "${create_command}"
                        if [ "${dryrun}" -ne 1 ]; then
-                               "$(dirname "${0}")"/distrobox-create -i 
"${container_image}" -n "${container_name}"
+                               eval "${create_command}"
                        fi
                        ;;
                n | N | No | no | NO)
-- 
2.37.1


++++++ 0002-distrobox-handle-situations-with-weird-manpages-setu.patch ++++++
>From d8f81bb5a6169b4efce137c3538afa770abb1fbb Mon Sep 17 00:00:00 2001
From: Dario Faggioli <[email protected]>
Date: Thu, 28 Jul 2022 11:02:05 +0200
Subject: [PATCH 2/4] distrobox: handle situations with weird manpages setup

So, assume you're distro strip manpages during packages install. That
might mean the `man` command exists, but there isn't any entry for
anything. In that case, the following happens:

    distrobox --help
    No manual entry for distrobox

    An error occurred

Fix this by checking also the return value of the `man` invocation too,
and show our own help if it failed.

Signed-off-by: Dario Faggioli <[email protected]>
(cherry picked from https://github.com/89luca89/distrobox/pull/365)
Signed-off-by: Dario Faggioli <[email protected]>
---
 distrobox | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/distrobox b/distrobox
index 5cbb6de..4e37031 100755
--- a/distrobox
+++ b/distrobox
@@ -19,8 +19,6 @@
 # along with distrobox; if not, see <http://www.gnu.org/licenses/>.
 
 # POSIX
-set -o errexit
-set -o nounset
 
 trap '[ "$?" -ne 0 ] && printf "\nAn error occurred\n"' EXIT
 
@@ -50,6 +48,19 @@ if [ $# -eq 0 ]; then
        exit
 fi
 
+# Handle 'help' here, before setting 'errexit', so we have a chance
+# to show our help if the man command is there but fails.
+if [ "$1" = "help" ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
+       if command -v man > /dev/null; then
+               man distrobox && exit 0
+       fi
+       show_help
+       exit 0
+fi
+
+set -o errexit
+set -o nounset
+
 distrobox_path="$(dirname "${0}")"
 distrobox_command="${1}"
 shift
@@ -76,14 +87,6 @@ case "${distrobox_command}" in
                printf "distrobox: %s\n" "${version}"
                exit 0
                ;;
-       help | --help | -h)
-               if command -v man > /dev/null; then
-                       man distrobox
-                       exit 0
-               fi
-               show_help
-               exit 0
-               ;;
        *) # Default case: If no more options then break out of the loop.
                printf >&2 "Error: invalid command\n"
                show_help
-- 
2.37.1


++++++ 0003-distrobox-if-no-command-is-specified-default-to-ente.patch ++++++
>From 0f1a928d310ea35465f892ff0bda563d110a4ce7 Mon Sep 17 00:00:00 2001
From: Dario Faggioli <[email protected]>
Date: Thu, 28 Jul 2022 10:10:28 +0200
Subject: [PATCH 3/4] distrobox: if no command is specified, default to enter

If just `distrobox` is invoked, without any command, assume
`distrobox enter`.

Signed-off-by: Dario Faggioli <[email protected]>
---
 distrobox      | 19 ++++++++++++-------
 docs/README.md |  1 +
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/distrobox b/distrobox
index 4e37031..ce0469c 100755
--- a/distrobox
+++ b/distrobox
@@ -19,6 +19,11 @@
 # along with distrobox; if not, see <http://www.gnu.org/licenses/>.
 
 # POSIX
+# Optional env variables:
+#      DBX_DEFAULT_COMMAND
+
+default_command="enter"
+[ -n "${DBX_DEFAULT_COMMAND}" ] && default_command="${DBX_DEFAULT_COMMAND}"
 
 trap '[ "$?" -ne 0 ] && printf "\nAn error occurred\n"' EXIT
 
@@ -43,11 +48,6 @@ Choose one of the available commands:
 EOF
 }
 
-if [ $# -eq 0 ]; then
-       show_help
-       exit
-fi
-
 # Handle 'help' here, before setting 'errexit', so we have a chance
 # to show our help if the man command is there but fails.
 if [ "$1" = "help" ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
@@ -62,8 +62,13 @@ set -o errexit
 set -o nounset
 
 distrobox_path="$(dirname "${0}")"
-distrobox_command="${1}"
-shift
+if [ $# -eq 0 ]; then
+       printf "No command specified. Assuming: distrobox-%s\n" 
"${default_command}"
+       distrobox_command="${default_command}"
+else
+       distrobox_command="${1}"
+       shift
+fi
 
 # Simple wrapper to the distrobox utilities.
 # We just detect the 1st argument and launch the matching distrobox utility.
diff --git a/docs/README.md b/docs/README.md
index df00785..64e4c0d 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -268,6 +268,7 @@ Alternatively it is possible to specify preferences using 
ENV variables:
 - DBX_CONTAINER_NAME
 - DBX_NON_INTERACTIVE
 - DBX_SKIP_WORKDIR
+- DBX_DEFAULT_COMMAND
 
 ---
 
-- 
2.37.1


++++++ 0004-opensuse-check-for-the-config-file-in-usr-etc-too.patch ++++++
>From 9a9a4dd4843199e9e40668dc58986abb82fb9020 Mon Sep 17 00:00:00 2001
From: Dario Faggioli <[email protected]>
Date: Wed, 27 Jul 2022 12:50:16 +0200
Subject: [PATCH 4/4] opensuse: check for the config file in /usr/etc too

Signed-off-by: Dario Faggioli <[email protected]>
---
 distrobox-create | 1 +
 distrobox-enter  | 1 +
 distrobox-list   | 1 +
 distrobox-rm     | 1 +
 distrobox-stop   | 1 +
 docs/README.md   | 1 +
 6 files changed, 6 insertions(+)

diff --git a/distrobox-create b/distrobox-create
index b0bb0e9..94fe003 100755
--- a/distrobox-create
+++ b/distrobox-create
@@ -79,6 +79,7 @@ version="1.3.1"
 # leave priority to environment variables.
 config_files="
        /usr/share/distrobox/distrobox.conf
+       /usr/etc/distrobox/distrobox.conf
        /etc/distrobox/distrobox.conf
        ${HOME}/.config/distrobox/distrobox.conf
        ${HOME}/.distroboxrc
diff --git a/distrobox-enter b/distrobox-enter
index e754c6b..25870f2 100755
--- a/distrobox-enter
+++ b/distrobox-enter
@@ -69,6 +69,7 @@ version="1.3.1"
 # leave priority to environment variables.
 config_files="
        /usr/share/distrobox/distrobox.conf
+       /usr/etc/distrobox/distrobox.conf
        /etc/distrobox/distrobox.conf
        ${HOME}/.config/distrobox/distrobox.conf
        ${HOME}/.distroboxrc
diff --git a/distrobox-list b/distrobox-list
index f62da97..36788df 100755
--- a/distrobox-list
+++ b/distrobox-list
@@ -42,6 +42,7 @@ container_manager="autodetect"
 # leave priority to environment variables.
 config_files="
        /usr/share/distrobox/distrobox.conf
+       /usr/etc/distrobox/distrobox.conf
        /etc/distrobox/distrobox.conf
        ${HOME}/.config/distrobox/distrobox.conf
        ${HOME}/.distroboxrc
diff --git a/distrobox-rm b/distrobox-rm
index 4d6b0a8..e23a1d7 100755
--- a/distrobox-rm
+++ b/distrobox-rm
@@ -46,6 +46,7 @@ version="1.3.1"
 # leave priority to environment variables.
 config_files="
        /usr/share/distrobox/distrobox.conf
+       /usr/etc/distrobox/distrobox.conf
        /etc/distrobox/distrobox.conf
        ${HOME}/.config/distrobox/distrobox.conf
        ${HOME}/.distroboxrc
diff --git a/distrobox-stop b/distrobox-stop
index accfce0..f848b7e 100755
--- a/distrobox-stop
+++ b/distrobox-stop
@@ -45,6 +45,7 @@ version="1.3.1"
 # leave priority to environment variables.
 config_files="
        /usr/share/distrobox/distrobox.conf
+       /usr/etc/distrobox/distrobox.conf
        /etc/distrobox/distrobox.conf
        ${HOME}/.config/distrobox/distrobox.conf
        ${HOME}/.distroboxrc
diff --git a/docs/README.md b/docs/README.md
index 64e4c0d..58cf1d8 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -243,6 +243,7 @@ Configuration files can be placed in the following paths, 
from the least importa
 to the most important:
 
 - /usr/share/distrobox/distrobox.conf
+- /usr/etc/distrobox/distrobox.conf
 - /etc/distrobox/distrobox.conf
 - ${HOME}/.config/distrobox/distrobox.conf
 - ${HOME}/.distroboxrc
-- 
2.37.1


++++++ distrobox.conf ++++++
--- /var/tmp/diff_new_pack.9Vwi71/_old  2022-07-29 16:47:42.450620792 +0200
+++ /var/tmp/diff_new_pack.9Vwi71/_new  2022-07-29 16:47:42.454620804 +0200
@@ -1,4 +1,5 @@
 container_image="registry.opensuse.org/opensuse/tumbleweed:latest"
 container_name="tumbleweed"
 container_manager="autodetect"
+non_interactive="true"
 

Reply via email to