Blame env-builder-data/build/script/include/inc-pkunpack-default.sh

e14835
d32e1c
# PK_VERSION
e14835
# PK_ARCHIVE
e14835
e14835
pkunpack() {
183b24
    if [ ${PK_ARCHIVE: -7} == ".tar.gz" ]; then
183b24
        if ! tar -xzf "$DOWNLOAD_PACKET_DIR/$PK_ARCHIVE"; then
183b24
            return 1
183b24
        fi
183b24
    elif [ ${PK_ARCHIVE: -7} == ".tgz" ]; then
183b24
        if ! tar -xzf "$DOWNLOAD_PACKET_DIR/$PK_ARCHIVE"; then
183b24
            return 1
183b24
        fi
183b24
    else
183b24
        if ! tar -xf "$DOWNLOAD_PACKET_DIR/$PK_ARCHIVE"; then
183b24
            return 1
183b24
        fi
183b24
    fi
9ab948
183b24
    if [ -z "$PK_VERSION" ]; then
183b24
        PK_VERSION="$(pkhook_version)"
183b24
        [ $? -eq 0 ] || return 1
183b24
    fi
183b24
    echo "$PK_VERSION" > "$UNPACK_PACKET_DIR/version-$NAME"
183b24
    [ $? -eq 0 ] || return 1
183b24
    return 0
e14835
}