pacstall / pacstall-programs

Pacstall's official program repository
https://pacstall.dev/packages
MIT License
172 stars 134 forks source link

[Help Wanted] pacstall does not download url file. #221

Closed kwon37xi closed 3 years ago

kwon37xi commented 3 years ago

Describe the bug I'm trying to build a new package called grive2.

https://github.com/kwon37xi/pacstall-programs/blob/grive2/packages/grive2/grive2.pacscript

I use pacstall develop branch version(2021/09/01).

To Reproduce

$ pacstall -Il grive2
Do you want to view/edit the pacscript [y/N]
[+] INFO: Sourcing pacscript

[+] INFO: URL exists
[+] INFO: grive2 requires cmake libgcrypt20-dev libyajl-dev libboost-all-dev libcurl4-openssl-dev libexpat1-dev libcppunit-dev binutils-dev debhelper zlib1g-dev dpkg-dev pkg-config to install
Do you want to remove them after installing grive2 [y/N] [+] INFO: Creating dummy package
Selecting previously unselected package grive2.
(Reading database ... 599476 files and directories currently installed.)
Preparing to unpack .../pacstall/grive2-pacstall.deb ...
Unpacking grive2 (0.5.1-1) ...
Setting up grive2 (0.5.1-1) ...
[+] INFO: Installing dependencies
[+] INFO: Retrieving packages
sha256sum: v0.5.1.tar.gz: No such file or directory
[!] ERROR: Hashes don't match
[+] INFO: Cleaning up
[!] ERROR: Failed to install grive2

Expected behavior pacstall should download url file(https://github.com/vitalif/grive2/archive/v0.5.1.tar.gz). But there is no file in /tmp/pacstall.

Screenshots no screenshot

Desktop (please complete the following information):

Additional context

Elsie19 commented 3 years ago

Can I see the pacscript?

kwon37xi commented 3 years ago

https://github.com/kwon37xi/pacstall-programs/blob/grive2/packages/grive2/grive2.pacscript

I think I found the reason.

/tmp/pacscript directory is owned by root, but pacstall's wget command executed without sudo. https://github.com/pacstall/pacstall/blob/develop/pacstall line 186.

# use axel if avaliable
function download() {
    sudo rm -f "${1##*/}"
    if command -v axel > /dev/null; then
        axel -ao "${1##*/}" "$1"
    else
        wget -q --show-progress --progress=bar:force "$1" 2>&1
    fi
}
Elsie19 commented 3 years ago

@wizard-28

wizard-28 commented 3 years ago

It's not really a bug. In the develop branch we have written a new installer.sh which automatically chownes /tmp/pacstall, so we don't need to run sudo with the download() function.

Closing this for now.

kwon37xi commented 3 years ago

I updated pacstall with pacstall -U pacstall develop then try again but it didn't work. Same error occured.

Do I need to do something else??

I guess this is because chown is done after dowload(not before). install-local.sh line 418

    *)
        download "$url"
        # I think you get it by now
        hashcheck "${url##*/}"
        if [[ $? -ne 0 ]]; then
            return 1
        fi
        sudo tar -xf "${url##*/}" 1>&1 2>/dev/null
        cd ./*/ 2>/dev/null
        export srcdir="/tmp/pacstall/$PWD"
        sudo chown -R "$LOGNAME":"$LOGNAME" . 2>/dev/null
wizard-28 commented 3 years ago

It's not really a bug. In the develop branch we have written a new installer.sh which automatically chownes /tmp/pacstall, so we don't need to run sudo with the download() function.

Run the lastest installer from develop branch. Then update to develop branch using Pacstall.

kwon37xi commented 3 years ago

I cloned develop branch, then reinstall pacstall and pacstall -U pacstall develop. It works! But it means that every pacstall users must remove pacstall and reinstall new version, does it??

Elsie19 commented 3 years ago

But it means that every pacstall users must remove pacstall and reinstall new version, does it??

Yup