diff options
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | cmd/podman/main_local.go | 2 | ||||
-rw-r--r-- | contrib/build_rpm.sh | 8 | ||||
-rw-r--r-- | contrib/spec/podman.spec.in | 16 | ||||
-rw-r--r-- | libpod/oci_util.go | 19 |
5 files changed, 39 insertions, 9 deletions
@@ -32,6 +32,7 @@ BUILDTAGS ?= \ exclude_graphdriver_devicemapper \ seccomp \ varlink +PYTHON ?= $(shell command -v python python3) GO_BUILD=$(GO) build # Go module support: set `-mod=vendor` to use the vendored sources @@ -133,7 +134,7 @@ endef export PRINT_HELP_PYSCRIPT help: - @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) + @$(PYTHON) -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) .gopathok: ifeq ("$(wildcard $(GOPKGDIR))","") diff --git a/cmd/podman/main_local.go b/cmd/podman/main_local.go index 968d7331a..bc46e4652 100644 --- a/cmd/podman/main_local.go +++ b/cmd/podman/main_local.go @@ -159,7 +159,7 @@ func setupRootless(cmd *cobra.Command, args []string) error { Remote: remoteclient, } - runtime, err := libpodruntime.GetRuntime(getContext(), &podmanCmd) + runtime, err := libpodruntime.GetRuntimeNoStore(getContext(), &podmanCmd) if err != nil { return errors.Wrapf(err, "could not get runtime") } diff --git a/contrib/build_rpm.sh b/contrib/build_rpm.sh index c79e49772..b2560fb1a 100644 --- a/contrib/build_rpm.sh +++ b/contrib/build_rpm.sh @@ -28,9 +28,7 @@ declare -a PKGS=(device-mapper-devel \ libseccomp-devel \ libselinux-devel \ make \ - golang-github-cpuguy83-go-md2man \ rpm-build \ - btrfs-progs-devel \ go-compilers-golang-compiler \ ) @@ -38,6 +36,12 @@ if [ $pkg_manager == "/usr/bin/dnf" ]; then PKGS+=(python3-devel \ python3-varlink \ ) +# btrfs-progs-devel is not available in CentOS/RHEL-8 + if ! grep -i -q 'Red Hat\|CentOS' /etc/redhat-release; then + PKGS+=(btrfs-progs-devel) + fi + + fi echo ${PKGS[*]} diff --git a/contrib/spec/podman.spec.in b/contrib/spec/podman.spec.in index 33ecc8eba..f282642f3 100644 --- a/contrib/spec/podman.spec.in +++ b/contrib/spec/podman.spec.in @@ -3,6 +3,7 @@ %global with_debug 1 %global with_check 0 %global with_unit_test 0 +%global with_doc 1 %if 0%{?fedora} >= 28 %bcond_without varlink @@ -52,12 +53,17 @@ ExclusiveArch: aarch64 %{arm} ppc64le s390x x86_64 # The COPR process will uncomment this #BuildRequires: golang-bin # +# btrfs-progs-devel package is not available in CentOS/RHEL-8 +%if 0%{?rhel} != 8 && 0%{?centos} != 8 BuildRequires: btrfs-progs-devel +%endif BuildRequires: glib2-devel BuildRequires: glibc-devel BuildRequires: glibc-static BuildRequires: git +%if 0%{?with_doc} BuildRequires: go-md2man +%endif BuildRequires: gpgme-devel BuildRequires: libassuan-devel BuildRequires: libgpg-error-devel @@ -357,7 +363,9 @@ tar zxf %{SOURCE1} sed -i 's/install.remote: podman-remote/install.remote:/' Makefile sed -i 's/install.bin: podman/install.bin:/' Makefile +%if 0%{?with_doc} sed -i 's/install.man: docs/install.man:/' Makefile +%endif %build mkdir _build @@ -370,8 +378,12 @@ export GOPATH=$(pwd)/_build:$(pwd):$(pwd):%{gopath} export BUILDTAGS="varlink selinux seccomp $(hack/btrfs_installed_tag.sh) $(hack/btrfs_tag.sh) $(hack/libdm_tag.sh) exclude_graphdriver_devicemapper" GOPATH=$GOPATH go generate ./cmd/podman/varlink/... -BUILDTAGS=$BUILDTAGS make binaries docs +%if 0%{?with_doc} +BUILDTAGS=$BUILDTAGS make binaries docs +%else +BUILDTAGS=$BUILDTAGS make binaries +%endif # build conmon pushd conmon @@ -477,8 +489,10 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath} %license LICENSE %doc README.md CONTRIBUTING.md pkg/hooks/README-hooks.md install.md code-of-conduct.md transfer.md %{_bindir}/%{name} +%if 0%{?with_doc} %{_mandir}/man1/*.1* %{_mandir}/man5/*.5* +%endif %{_datadir}/bash-completion/completions/* %{_datadir}/zsh/site-functions/* %{_libexecdir}/%{name}/conmon diff --git a/libpod/oci_util.go b/libpod/oci_util.go index c1a7f1c9a..3345220ac 100644 --- a/libpod/oci_util.go +++ b/libpod/oci_util.go @@ -83,11 +83,22 @@ func bindPorts(ports []ocicni.PortMapping) ([]*os.File, error) { func getOCIRuntimeError(runtimeMsg string) error { r := strings.ToLower(runtimeMsg) - if match, _ := regexp.MatchString(".*permission denied.*|.*operation not permitted.*", r); match { - return errors.Wrapf(define.ErrOCIRuntimePermissionDenied, "%s", strings.Trim(runtimeMsg, "\n")) + + includeFullOutput := logrus.GetLevel() == logrus.DebugLevel + + if match := regexp.MustCompile(".*permission denied.*|.*operation not permitted.*").FindString(r); match != "" { + errStr := match + if includeFullOutput { + errStr = runtimeMsg + } + return errors.Wrapf(define.ErrOCIRuntimePermissionDenied, "%s", strings.Trim(errStr, "\n")) } - if match, _ := regexp.MatchString(".*executable file not found in.*|.*no such file or directory.*", r); match { - return errors.Wrapf(define.ErrOCIRuntimeNotFound, "%s", strings.Trim(runtimeMsg, "\n")) + if match := regexp.MustCompile(".*executable file not found in.*|.*no such file or directory.*").FindString(r); match != "" { + errStr := match + if includeFullOutput { + errStr = runtimeMsg + } + return errors.Wrapf(define.ErrOCIRuntimeNotFound, "%s", strings.Trim(errStr, "\n")) } return errors.Wrapf(define.ErrOCIRuntime, "%s", strings.Trim(runtimeMsg, "\n")) } |