helixarch / debtap

A script for converting .deb packages into Arch Linux packages, focused on accuracy
GNU General Public License v2.0
1.35k stars 78 forks source link

Creates corrupt .INSTALL script #89

Open latekvo opened 1 year ago

latekvo commented 1 year ago

I will follow up on this later but Im running late today and just wanted to report as much as i remember for today. When i used debtap on Cisco packet tracer 8.2.1-1 debian package, the install script that had been generated was missing line 20 causing pacman to crash during the install with this error:

/tmp/alpm_qPMsyx/.INSTALL: line 20: syntax error near unexpected token `else'
/tmp/alpm_qPMsyx/.INSTALL: line 20: `       else'
/usr/bin/bash: line 1: pre_upgrade: command not found
error: command failed to execute correctly

context:

pre_install() {
    STATE=1 
    while [ "$STATE" != 0 -a "$STATE" != 4 ]; do
        case "$STATE" in
        1)
        ;;
        2)
        ;;
        3)
            if [ "$RET" = "false" ]; then
                exit 1
            fi
        ;;
        esac
            # here is the missing IF statement
            STATE=$(($STATE + 1))
        else
            STATE=$(($STATE - 1))
        fi
    done
    exit 0
}

I later determined the missing statement has to be

        if [ "$STATE" -eq 3 ]; then

Please ask me for any missing details.

latekvo commented 1 year ago

Hello I wanted to follow up, during the install, there was one more error in the .INSTALL script, but it didn't prevent packettracer from installing.

:: Processing package changes...
/tmp/alpm_6jAOKD/.INSTALL: line 128: syntax error near unexpected token `elif'
/tmp/alpm_6jAOKD/.INSTALL: line 128: `  elif [ ! -r $PROFILE ]; then'
(1/1) reinstalling packettracer                                                                                    [####################################################################] 100%
/tmp/alpm_BhgJf8/.INSTALL: line 128: syntax error near unexpected token `elif'
/tmp/alpm_BhgJf8/.INSTALL: line 128: `  elif [ ! -r $PROFILE ]; then'
gtk-update-icon-cache: No theme index file.

I confirm that after making the changes i made to the .INSTALL script, the program installs and runs as expected.