pacstall / pacstall-programs

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

Broken symlinks in `aws-cli-v2-bin` #2107

Closed falko closed 2 months ago

falko commented 1 year ago

The package aws-cli-v2-bin creates broken symlinks, e.g.

/usr/local/bin/aws -> /usr/src/pacstall/aws-cli-v2-bin/usr/local/aws-cli/v2/current/bin/aws
/usr/local/bin/aws_completer -> /usr/src/pacstall/aws-cli-v2-bin/usr/local/aws-cli/v2/current/bin/aws_completer
/usr/local/aws-cli/v2/current -> /usr/src/pacstall/aws-cli-v2-bin/usr/local/aws-cli/v2/2.9.11

The folder /usr/src/pacstall/aws-cli-v2-bin does not exist and should not be part of the links.

falko commented 1 year ago

Maybe we have to specify --bin-dir and --install-dir as shown here: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html#getting-started-install-instructions

sudo ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli
falko commented 1 year ago

@Mar0xy I know you stepped down as a maintainer because of the high release cadence but could you have a look into this?

Elsie19 commented 1 year ago

I'll look into this.

Elsie19 commented 1 year ago
diff --git a/packages/aws-cli-v2-bin/aws-cli-v2-bin.pacscript b/packages/aws-cli-v2-bin/aws-cli-v2-bin.pacscript
index d9254992..67c96aa0 100644
--- a/packages/aws-cli-v2-bin/aws-cli-v2-bin.pacscript
+++ b/packages/aws-cli-v2-bin/aws-cli-v2-bin.pacscript
@@ -9,16 +9,8 @@ replace="awscli"
 repology=("project: awscli")
 hash="20826e1647c45c1e28715eb32dd073e8106c9a11506624af6e4c2d628fac9f92"

-prepare() {
-  true
-}
-
-build() {
-  true
-}
-
 install() {
-  sudo ./install --install-dir "${STOWDIR}/${name}/usr/local/aws-cli" --bin-dir "/usr/local/bin"
+  sudo ./install --bin-dir "${pkgdir}/usr/local/bin"

   # bash autocompletion
   echo "complete -C '/usr/local/bin/aws_completer' aws" > "aws-cli_bash_completion"

Does this work for you @falko?

falko commented 1 year ago

I would have expected sudo ./install --install-dir "/usr/local/aws-cli" --bin-dir "/usr/local/bin" because that's where dpkg --listfiles shows the files: dpkg_--listfiles_aws-cli-v2-bin.txt

falko commented 1 year ago

@Henryws How can I try your patch?

Elsie19 commented 1 year ago

I would have expected sudo ./install --install-dir "/usr/local/aws-cli" --bin-dir "/usr/local/bin" because that's where dpkg --listfiles shows the files: dpkg_--listfiles_aws-cli-v2-bin.txt

Yeah but it needs to be installed to a staging directory, not the raw file system.

Elsie19 commented 1 year ago

@Henryws How can I try your patch?

Edit the Pacscript during installation (it will prompt you), then replace:

install() {
  sudo ./install --install-dir "${STOWDIR}/${name}/usr/local/aws-cli" --bin-dir "/usr/local/bin"
}

with

install() {
    sudo ./install --bin-dir "${pkgdir}/usr/local/bin"
}