@@ -316,8 +316,110 @@ DeterminePythonVersion() {
316316{{ bootstrappers/smartos.sh }}
317317{{ bootstrappers/mageia_common.sh }}
318318
319- # Certbot-auto is now fully deprecated
320- DEPRECATED_OS=1
319+ # Set Bootstrap to the function that installs OS dependencies on this system
320+ # and BOOTSTRAP_VERSION to the unique identifier for the current version of
321+ # that function. If Bootstrap is set to a function that doesn't install any
322+ # packages BOOTSTRAP_VERSION is not set.
323+ if [ -f /etc/debian_version ]; then
324+ DEPRECATED_OS=1
325+ elif [ -f /etc/mageia-release ]; then
326+ # Mageia has both /etc/mageia-release and /etc/redhat-release
327+ DEPRECATED_OS=1
328+ elif [ -f /etc/redhat-release ]; then
329+ # Run DeterminePythonVersion to decide on the basis of available Python versions
330+ # whether to use 2.x or 3.x on RedHat-like systems.
331+ # Then, revert LE_PYTHON to its previous state.
332+ prev_le_python=" $LE_PYTHON "
333+ unset LE_PYTHON
334+ DeterminePythonVersion " NOCRASH"
335+
336+ RPM_DIST_NAME=` (. /etc/os-release 2> /dev/null && echo $ID ) || echo " unknown" `
337+
338+ if [ " $PYVER " -eq 26 -a $( uname -m) != ' x86_64' ]; then
339+ # 32 bits CentOS 6 and affiliates are not supported anymore by certbot-auto.
340+ DEPRECATED_OS=1
341+ fi
342+
343+ # Set RPM_DIST_VERSION to VERSION_ID from /etc/os-release after splitting on
344+ # '.' characters (e.g. "8.0" becomes "8"). If the command exits with an
345+ # error, RPM_DIST_VERSION is set to "unknown".
346+ RPM_DIST_VERSION=$( (. /etc/os-release 2> /dev/null && echo " $VERSION_ID " ) | cut -d ' .' -f1 || echo " unknown" )
347+
348+ # If RPM_DIST_VERSION is an empty string or it contains any nonnumeric
349+ # characters, the value is unexpected so we set RPM_DIST_VERSION to 0.
350+ if [ -z " $RPM_DIST_VERSION " ] || [ -n " $( echo " $RPM_DIST_VERSION " | tr -d ' [0-9]' ) " ]; then
351+ RPM_DIST_VERSION=0
352+ fi
353+
354+ # Handle legacy RPM distributions
355+ if [ " $PYVER " -eq 26 ]; then
356+ # Check if an automated bootstrap can be achieved on this system.
357+ if ! Python36SclIsAvailable; then
358+ INTERACTIVE_BOOTSTRAP=1
359+ fi
360+
361+ Bootstrap () {
362+ BootstrapMessage " Legacy RedHat-based OSes that will use Python3"
363+ BootstrapRpmPython3Legacy
364+ }
365+ USE_PYTHON_3=1
366+ BOOTSTRAP_VERSION=" BootstrapRpmPython3Legacy $BOOTSTRAP_RPM_PYTHON3_LEGACY_VERSION "
367+
368+ # Try now to enable SCL rh-python36 for systems already bootstrapped
369+ # NB: EnablePython36SCL has been defined along with BootstrapRpmPython3Legacy in certbot-auto
370+ EnablePython36SCL
371+ else
372+ # Starting to Fedora 29, python2 is on a deprecation path. Let's move to python3 then.
373+ # RHEL 8 also uses python3 by default.
374+ if [ " $RPM_DIST_NAME " = " fedora" -a " $RPM_DIST_VERSION " -ge 29 ]; then
375+ RPM_USE_PYTHON_3=1
376+ elif [ " $RPM_DIST_NAME " = " rhel" -a " $RPM_DIST_VERSION " -ge 8 ]; then
377+ RPM_USE_PYTHON_3=1
378+ elif [ " $RPM_DIST_NAME " = " centos" -a " $RPM_DIST_VERSION " -ge 8 ]; then
379+ RPM_USE_PYTHON_3=1
380+ else
381+ RPM_USE_PYTHON_3=0
382+ fi
383+
384+ if [ " $RPM_USE_PYTHON_3 " = 1 ]; then
385+ Bootstrap () {
386+ BootstrapMessage " RedHat-based OSes that will use Python3"
387+ BootstrapRpmPython3
388+ }
389+ USE_PYTHON_3=1
390+ BOOTSTRAP_VERSION=" BootstrapRpmPython3 $BOOTSTRAP_RPM_PYTHON3_VERSION "
391+ else
392+ Bootstrap () {
393+ BootstrapMessage " RedHat-based OSes"
394+ BootstrapRpmCommon
395+ }
396+ BOOTSTRAP_VERSION=" BootstrapRpmCommon $BOOTSTRAP_RPM_COMMON_VERSION "
397+ fi
398+ fi
399+
400+ LE_PYTHON=" $prev_le_python "
401+ elif [ -f /etc/os-release ] && ` grep -q openSUSE /etc/os-release` ; then
402+ DEPRECATED_OS=1
403+ elif [ -f /etc/arch-release ]; then
404+ DEPRECATED_OS=1
405+ elif [ -f /etc/manjaro-release ]; then
406+ DEPRECATED_OS=1
407+ elif [ -f /etc/gentoo-release ]; then
408+ DEPRECATED_OS=1
409+ elif uname | grep -iq FreeBSD ; then
410+ DEPRECATED_OS=1
411+ elif uname | grep -iq Darwin ; then
412+ DEPRECATED_OS=1
413+ elif [ -f /etc/issue ] && grep -iq " Amazon Linux" /etc/issue ; then
414+ Bootstrap () {
415+ ExperimentalBootstrap " Amazon Linux" BootstrapRpmCommon
416+ }
417+ BOOTSTRAP_VERSION=" BootstrapRpmCommon $BOOTSTRAP_RPM_COMMON_VERSION "
418+ elif [ -f /etc/product ] && grep -q " Joyent Instance" /etc/product ; then
419+ DEPRECATED_OS=1
420+ else
421+ DEPRECATED_OS=1
422+ fi
321423
322424# We handle this case after determining the normal bootstrap version to allow
323425# variables like USE_PYTHON_3 to be properly set. As described above, if the
0 commit comments