|
82 | 82 | if type apt-get > /dev/null 2>&1; then |
83 | 83 | PKG_MGR_CMD=apt-get |
84 | 84 | INSTALL_CMD="${PKG_MGR_CMD} -y install --no-install-recommends" |
| 85 | + TIME_PIECE_PKG="libtime-piece-perl" |
85 | 86 | elif type microdnf > /dev/null 2>&1; then |
86 | 87 | PKG_MGR_CMD=microdnf |
87 | 88 | INSTALL_CMD="${PKG_MGR_CMD} ${INSTALL_CMD_ADDL_REPOS} -y install --refresh --best --nodocs --noplugins --setopt=install_weak_deps=0" |
| 89 | + TIME_PIECE_PKG="perl-Time-Piece" |
88 | 90 | elif type dnf > /dev/null 2>&1; then |
89 | 91 | PKG_MGR_CMD=dnf |
90 | 92 | INSTALL_CMD="${PKG_MGR_CMD} ${INSTALL_CMD_ADDL_REPOS} -y install --refresh --best --nodocs --noplugins --setopt=install_weak_deps=0" |
| 93 | + TIME_PIECE_PKG="perl-Time-Piece" |
91 | 94 | else |
92 | 95 | PKG_MGR_CMD=yum |
93 | 96 | INSTALL_CMD="${PKG_MGR_CMD} ${INSTALL_CMD_ADDL_REPOS} -y install --noplugins --setopt=install_weak_deps=0" |
| 97 | + TIME_PIECE_PKG="perl-Time-Piece" |
94 | 98 | fi |
| 99 | +# Install Time::Piece Perl module required by OpenSSL 3.0.18+ build system |
| 100 | +install_time_piece() { |
| 101 | + echo "(*) Ensuring Time::Piece Perl module is available..." |
| 102 | + |
| 103 | + # Check if Time::Piece is already available (it's usually in Perl core) |
| 104 | + if perl -MTime::Piece -e 'exit 0' 2>/dev/null; then |
| 105 | + echo "(*) Time::Piece already available" |
| 106 | + return 0 |
| 107 | + fi |
| 108 | + |
| 109 | + echo "(*) Time::Piece not found, attempting installation..." |
| 110 | + |
| 111 | + case ${ADJUSTED_ID} in |
| 112 | + debian) |
| 113 | + # Update package cache |
| 114 | + pkg_mgr_update |
| 115 | + |
| 116 | + # Try different package combinations |
| 117 | + if ${INSTALL_CMD} perl-modules-5.36 2>/dev/null; then |
| 118 | + echo "(*) Installed perl-modules-5.36" |
| 119 | + elif ${INSTALL_CMD} perl-modules-5.34 2>/dev/null; then |
| 120 | + echo "(*) Installed perl-modules-5.34" |
| 121 | + elif ${INSTALL_CMD} perl-modules 2>/dev/null; then |
| 122 | + echo "(*) Installed perl-modules" |
| 123 | + elif ${INSTALL_CMD} perl-base perl-modules-5.* 2>/dev/null; then |
| 124 | + echo "(*) Installed perl-base and modules" |
| 125 | + else |
| 126 | + echo "(*) Warning: Could not install Time::Piece via packages" |
| 127 | + echo "(*) Time::Piece is usually built into Perl core, continuing..." |
| 128 | + fi |
| 129 | + ;; |
| 130 | + rhel) |
| 131 | + ${INSTALL_CMD} ${TIME_PIECE_PKG} || { |
| 132 | + echo "(*) Warning: Could not install ${TIME_PIECE_PKG}" |
| 133 | + } |
| 134 | + ;; |
| 135 | + esac |
| 136 | + |
| 137 | + # Final check |
| 138 | + if perl -MTime::Piece -e 'exit 0' 2>/dev/null; then |
| 139 | + echo "(*) Time::Piece is now available" |
| 140 | + else |
| 141 | + echo "(*) Warning: Time::Piece may not be available" |
| 142 | + echo "(*) This could cause issues with OpenSSL 3.0.18+ builds" |
| 143 | + fi |
| 144 | +} |
| 145 | + |
95 | 146 |
|
96 | 147 | # Clean up |
97 | 148 | clean_up() { |
@@ -1090,6 +1141,8 @@ if [ "${INSTALL_JUPYTERLAB}" = "true" ]; then |
1090 | 1141 | fi |
1091 | 1142 | fi |
1092 | 1143 |
|
| 1144 | +# Call the installation function |
| 1145 | +install_time_piece |
1093 | 1146 | # Clean up |
1094 | 1147 | clean_up |
1095 | 1148 |
|
|
0 commit comments