Skip to content

Commit 44e98b2

Browse files
use --ignore-installed instead of --target
1 parent 130a5ff commit 44e98b2

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

lib/fpm/package/python.rb

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -594,14 +594,6 @@ def fix_name(name)
594594
end
595595
end # def fix_name
596596

597-
def pip_install_dir()
598-
execmd([attributes[:python_bin], "-c",
599-
"import sysconfig; print(sysconfig.get_path('stdlib'))"],
600-
:stdin => false, :stderr => false) do |stdout|
601-
return stdout.read(64<<10).strip()
602-
end
603-
end
604-
605597
# Install this package to the staging directory
606598
def install_to_staging(path)
607599
prefix = "/"
@@ -610,8 +602,10 @@ def install_to_staging(path)
610602
# XXX: Note: pip doesn't seem to have any equivalent to `--install-lib` or similar flags.
611603
# XXX: Deprecate :python_install_data, :python_install_lib, :python_install_bin
612604
# XXX: Deprecate: :python_setup_py_arguments
613-
flags = [ "--target", staging_path + pip_install_dir() ]
614-
#flags += [ "--prefix", prefix ] if !attributes[:prefix].nil?
605+
flags = [ "--root", staging_path ]
606+
flags += [ "--prefix", prefix ] if !attributes[:prefix].nil?
607+
flags += [ "--ignore-installed" ]
608+
615609
safesystem(*attributes[:python_pip], "install", "--no-deps", *flags, path)
616610
end # def install_to_staging
617611

0 commit comments

Comments
 (0)