All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Lautrbach <plautrba@redhat.com>
To: Jason Zaman <jason@perfinion.com>, selinux@vger.kernel.org
Cc: Jason Zaman <jason@perfinion.com>
Subject: Re: [PATCH 2/2] python: Ignore installed when installing to DESTDIR
Date: Thu, 22 Dec 2022 10:09:46 +0100	[thread overview]
Message-ID: <87sfh77qjp.fsf@redhat.com> (raw)
In-Reply-To: <20221222064452.13722-2-jason@perfinion.com>

Jason Zaman <jason@perfinion.com> writes:

> When installing to a destdir with pip install --prefix= --root=, pip tries to
> uninstall the existing root-owned package and fails
>
> Fixes:
> python3 -m pip install --prefix=/usr `test -n "/tmp/selinux-release//build-master" && echo --root /tmp/selinux-release//build-master`  .
> Processing /tmp/selinux-release/selinux-master/python/sepolicy
>   Preparing metadata (setup.py) ... done
> Building wheels for collected packages: sepolicy
>   Building wheel for sepolicy (setup.py) ... done
>   Created wheel for sepolicy: filename=sepolicy-3.4-py3-none-any.whl size=1663564 sha256=229546db123e7d84613d190d49c192291b1a4f7f2a037657b39283b04ac391a4
>   Stored in directory: /tmp/pip-ephem-wheel-cache-50r2x4cn/wheels/b2/9e/63/6a6212a84d65a709923228719d065ed34e66a90c7fed01e8cf
> Successfully built sepolicy
> Installing collected packages: sepolicy
>   Attempting uninstall: sepolicy
>     Found existing installation: sepolicy 3.4
>     Uninstalling sepolicy-3.4:
> ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: 'generate.py'
> Consider using the `--user` option or check the permissions.


Acked-by: Petr Lautrbach <lautrbach@redhat.com>


> ---
>  python/sepolicy/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/python/sepolicy/Makefile b/python/sepolicy/Makefile
> index 57a2e55e..4e9e93d0 100644
> --- a/python/sepolicy/Makefile
> +++ b/python/sepolicy/Makefile
> @@ -27,7 +27,7 @@ test:
>  	@$(PYTHON) test_sepolicy.py -v
>  
>  install:
> -	$(PYTHON) -m pip install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR)` $(PYTHON_SETUP_ARGS) .
> +	$(PYTHON) -m pip install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR) --ignore-installed --no-deps` $(PYTHON_SETUP_ARGS) .
>  	[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR)
>  	install -m 755 sepolicy.py $(DESTDIR)$(BINDIR)/sepolicy
>  	(cd $(DESTDIR)$(BINDIR); ln -sf sepolicy sepolgen)
> -- 
> 2.38.2


  reply	other threads:[~2022-12-22  9:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22  6:44 [PATCH 1/2] libselinux: Ignore installed when installing python bindings to DESTDIR Jason Zaman
2022-12-22  6:44 ` [PATCH 2/2] python: Ignore installed when installing " Jason Zaman
2022-12-22  9:09   ` Petr Lautrbach [this message]
2022-12-22  6:54 ` [PATCH 1/2] libselinux: Ignore installed when installing python bindings " Jason Zaman
2022-12-22  9:09 ` Petr Lautrbach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sfh77qjp.fsf@redhat.com \
    --to=plautrba@redhat.com \
    --cc=jason@perfinion.com \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.