Update install_perccli.sh
This commit is contained in:
parent
cd1b9d8ec4
commit
98e109c21d
|
|
@ -68,24 +68,29 @@ elif [[ "$PACKAGE_FILE" == *.rpm ]]; then
|
||||||
echo "Attempting to convert $PACKAGE_FILE to .deb using 'alien'..."
|
echo "Attempting to convert $PACKAGE_FILE to .deb using 'alien'..."
|
||||||
# Convert the RPM to DEB. The resulting .deb file will be created in the current directory.
|
# Convert the RPM to DEB. The resulting .deb file will be created in the current directory.
|
||||||
alien -d "$PACKAGE_FILE"
|
alien -d "$PACKAGE_FILE"
|
||||||
|
|
||||||
|
# Check the return code of the alien conversion
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
# Find the name of the newly created .deb file (e.g., from perccli-007.3208.0000.0000-1.noarch.rpm to perccli_0.7.3208.0000.0000-2_all.deb)
|
echo "Conversion successful. Searching for generated .deb file..."
|
||||||
# Alien renames packages, so we search for a .deb file with the original name prefix.
|
# FIX: Alien renames files, typically changing hyphens to underscores.
|
||||||
DEB_NAME_PREFIX=$(basename "$PACKAGE_FILE" .rpm)
|
# Isolate the base package name (e.g., 'perccli' from the full name).
|
||||||
NEW_DEB_FILE=$(find . -maxdepth 1 -name "${DEB_NAME_PREFIX}*.deb" | head -n 1)
|
PACKAGE_NAME_ROOT=$(basename "$PACKAGE_FILE" | cut -d'-' -f1)
|
||||||
|
|
||||||
|
# Search for any .deb file in the current directory starting with the package name root and an underscore.
|
||||||
|
NEW_DEB_FILE=$(find . -maxdepth 1 -name "${PACKAGE_NAME_ROOT}_*.deb" | head -n 1)
|
||||||
|
|
||||||
if [ -f "$NEW_DEB_FILE" ]; then
|
if [ -f "$NEW_DEB_FILE" ]; then
|
||||||
echo "Conversion successful. Installing $NEW_DEB_FILE..."
|
echo "Found converted file: $NEW_DEB_FILE. Installing..."
|
||||||
dpkg -i "$NEW_DEB_FILE"
|
dpkg -i "$NEW_DEB_FILE"
|
||||||
INSTALL_SUCCESS=$?
|
INSTALL_SUCCESS=$?
|
||||||
# Clean up the converted .deb file regardless of final install success
|
# Clean up the converted .deb file regardless of final install success
|
||||||
rm -f "$NEW_DEB_FILE"
|
rm -f "$NEW_DEB_FILE"
|
||||||
else
|
else
|
||||||
echo "ERROR: Conversion succeeded, but could not locate the newly created .deb file for installation."
|
echo "ERROR: Conversion succeeded, but could not locate the newly created .deb file for installation (Searched for: ${PACKAGE_NAME_ROOT}_*.deb)."
|
||||||
INSTALL_SUCCESS=1
|
INSTALL_SUCCESS=1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "ERROR: 'alien' conversion failed."
|
echo "ERROR: 'alien' conversion failed. Please check the 'alien' output above for details."
|
||||||
INSTALL_SUCCESS=1
|
INSTALL_SUCCESS=1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue