Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Spack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eic_tools
Spack
Commits
1b731e52
Commit
1b731e52
authored
9 years ago
by
Todd Gamblin
Browse files
Options
Downloads
Plain Diff
Merge pull request #703 from epfl-scitas/fixes/openssl_external
fix : no warning when installing 'openssl@external'
parents
c35994d5
d375ddad
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
var/spack/repos/builtin/packages/openssl/package.py
+28
-17
28 additions, 17 deletions
var/spack/repos/builtin/packages/openssl/package.py
with
28 additions
and
17 deletions
var/spack/repos/builtin/packages/openssl/package.py
+
28
−
17
View file @
1b731e52
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
from
spack
import
*
from
spack
import
*
class
Openssl
(
Package
):
class
Openssl
(
Package
):
"""
The OpenSSL Project is a collaborative effort to develop a
"""
The OpenSSL Project is a collaborative effort to develop a
robust, commercial-grade, full-featured, and Open Source
robust, commercial-grade, full-featured, and Open Source
...
@@ -30,26 +31,14 @@ def url_for_version(self, version):
...
@@ -30,26 +31,14 @@ def url_for_version(self, version):
# Same idea, but just to avoid issuing the same message multiple times
# Same idea, but just to avoid issuing the same message multiple times
warnings_given_to_user
=
getattr
(
Openssl
,
'
_warnings_given
'
,
{})
warnings_given_to_user
=
getattr
(
Openssl
,
'
_warnings_given
'
,
{})
if
openssl_url
is
None
:
if
openssl_url
is
None
:
latest
=
'
http://www.openssl.org/source/openssl-{version}.tar.gz
'
if
self
.
spec
.
satisfies
(
'
@external
'
):
older
=
'
http://www.openssl.org/source/old/{version_number}/openssl-{version_full}.tar.gz
'
# The version @external is reserved to system openssl. In that case return a fake url and exit
# Try to use the url where the latest tarballs are stored. If the url does not exist (404), then
openssl_url
=
'
@external (reserved version for system openssl)
'
# return the url for older format
version_number
=
'
.
'
.
join
([
str
(
x
)
for
x
in
version
[:
-
1
]])
older_url
=
older
.
format
(
version_number
=
version_number
,
version_full
=
version
)
latest_url
=
latest
.
format
(
version
=
version
)
response
=
urllib
.
urlopen
(
latest
.
format
(
version
=
version
))
if
response
.
getcode
()
==
404
:
openssl_url
=
older_url
# Checks if we already warned the user for this particular version of OpenSSL.
# If not we display a warning message and mark this version
if
not
warnings_given_to_user
.
get
(
version
,
False
):
if
not
warnings_given_to_user
.
get
(
version
,
False
):
tty
.
warn
(
'
This installation depends on an old version of OpenSSL, which may have known security issues.
'
)
tty
.
msg
(
'
Using openssl@external : the version @external is reserved for system openssl
'
)
tty
.
warn
(
'
Consider updating to the latest version of this package.
'
)
tty
.
warn
(
'
More details at {homepage}
'
.
format
(
homepage
=
Openssl
.
homepage
))
warnings_given_to_user
[
version
]
=
True
warnings_given_to_user
[
version
]
=
True
else
:
else
:
openssl_url
=
latest_url
openssl_url
=
self
.
check_for_outdated_release
(
version
,
warnings_given_to_user
)
# Store the computed URL
# Store the computed URL
openssl_urls
[
version
]
=
openssl_url
openssl_urls
[
version
]
=
openssl_url
# Store the updated dictionary of URLS
# Store the updated dictionary of URLS
Openssl
.
_openssl_url
=
openssl_urls
Openssl
.
_openssl_url
=
openssl_urls
...
@@ -58,6 +47,28 @@ def url_for_version(self, version):
...
@@ -58,6 +47,28 @@ def url_for_version(self, version):
return
openssl_url
return
openssl_url
def
check_for_outdated_release
(
self
,
version
,
warnings_given_to_user
):
latest
=
'
ftp://ftp.openssl.org/source/openssl-{version}.tar.gz
'
older
=
'
http://www.openssl.org/source/old/{version_number}/openssl-{version_full}.tar.gz
'
# Try to use the url where the latest tarballs are stored. If the url does not exist (404), then
# return the url for older format
version_number
=
'
.
'
.
join
([
str
(
x
)
for
x
in
version
[:
-
1
]])
try
:
openssl_url
=
latest
.
format
(
version
=
version
)
urllib
.
urlopen
(
openssl_url
)
except
IOError
:
openssl_url
=
older
.
format
(
version_number
=
version_number
,
version_full
=
version
)
# Checks if we already warned the user for this particular version of OpenSSL.
# If not we display a warning message and mark this version
if
not
warnings_given_to_user
.
get
(
version
,
False
):
tty
.
warn
(
'
This installation depends on an old version of OpenSSL, which may have known security issues.
'
)
tty
.
warn
(
'
Consider updating to the latest version of this package.
'
)
tty
.
warn
(
'
More details at {homepage}
'
.
format
(
homepage
=
Openssl
.
homepage
))
warnings_given_to_user
[
version
]
=
True
return
openssl_url
def
install
(
self
,
spec
,
prefix
):
def
install
(
self
,
spec
,
prefix
):
# OpenSSL uses a variable APPS in its Makefile. If it happens to be set
# OpenSSL uses a variable APPS in its Makefile. If it happens to be set
# in the environment, then this will override what is set in the
# in the environment, then this will override what is set in the
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment