Skip to content

Aur packages could be installed as needed - #1100

Merged
Morganamilo merged 1 commit into
masterfrom
unknown repository
Mar 7, 2024
Merged

Morganamilo merged 1 commit into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Dec 5, 2023

Copy link
Copy Markdown

Fix #1093

paru should always retrieve package info from local package database instead of aur repo.

Fix #1093

paru should always retrieve package info from local
package database instead of aur repo.
@ghost
ghost force-pushed the fix-aur-needed branch from e1c2778 to 6625605 Compare December 5, 2023 07:20
@ghost

ghost commented Dec 14, 2023

Copy link
Copy Markdown
Author

@Morganamilo Please review the code, I really need it

@Morganamilo

Copy link
Copy Markdown
Owner

The base version and the version of each package inside will always be the same so I don't see this changing anything.

I took a look when at this when it was first reported and saw the issue. It's over in https://github.com/Morganamilo/aur-depends and is bit annoying to fix. I'll get to it before the next release.

@ghost

ghost commented Dec 28, 2023

Copy link
Copy Markdown
Author

Thanks for your work. But the base version and the package version are not the same in my system, and the packages can be installed when use package version.

@C0rn3j

C0rn3j commented Feb 7, 2024 •

Copy link
Copy Markdown

@Morganamilo Please pull this, it fixes the issue, just tested it on Arch Linux against your AUR/paru as a patch.

patched PKGBUILD + `wget -O paru.patch https://github.com//pull/1100.patch`
# Maintainer: Morgan 
pkgname=paru
pkgver=2.0.1
pkgrel=999
pkgdesc='Feature packed AUR helper'
url='https://github.com/morganamilo/paru'
source=("$pkgname-$pkgver.tar.gz::https://github.com/Morganamilo/paru/archive/v$pkgver.tar.gz"
'paru.patch')
backup=("etc/paru.conf")
arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64')
license=('GPL3')
makedepends=('cargo')
depends=('git' 'pacman')
optdepends=('bat: colored pkgbuild printing' 'devtools: build in chroot and downloading pkgbuilds')
sha256sums=('47cae94d227cc08f86706408d234444af6dda192ba24309c251a0b43a8aa7980'
            'd934a13ea0ad29318698c9c94b0c95d605543440bb3d3ab1e3b9d177aad74a92')

prepare() {
  cd "$pkgname-$pkgver"
  cargo fetch --locked --target "$(rustc -vV | sed -n 's|host: ||p')"
  cd "${srcdir}/${pkgname}-${pkgver}"
  patch -p1 < "${srcdir}/paru.patch"
}

build () {
  cd "$srcdir/$pkgname-$pkgver"

  if pacman -T pacman-git > /dev/null; then
    _features+="git,"
  fi

  if [[ $CARCH != x86_64 ]]; then
    export CARGO_PROFILE_RELEASE_LTO=off
  fi

  cargo build --frozen --features "${_features:-}" --release --target-dir target
  ./scripts/mkmo locale/
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  install -Dm755 target/release/paru "${pkgdir}/usr/bin/paru"
  install -Dm644 paru.conf "${pkgdir}/etc/paru.conf"

  install -Dm644 man/paru.8 "$pkgdir/usr/share/man/man8/paru.8"
  install -Dm644 man/paru.conf.5 "$pkgdir/usr/share/man/man5/paru.conf.5"

  install -Dm644 completions/bash "${pkgdir}/usr/share/bash-completion/completions/paru.bash"
  install -Dm644 completions/fish "${pkgdir}/usr/share/fish/vendor_completions.d/paru.fish"
  install -Dm644 completions/zsh "${pkgdir}/usr/share/zsh/site-functions/_paru"

  install -d "$pkgdir/usr/share/"
  cp -r locale "$pkgdir/usr/share/"
}
2.0.1 from AUR/paru-bin
[0] % env LC_ALL=C LANGUAGE=C paru -S --noconfirm --needed --cleanafter --ignore=deemix-git,deemix-gui-git -u
:: Starting full system upgrade...
 there is nothing to do
:: Looking for PKGBUILD upgrades...
:: Looking for AUR upgrades...
:: Looking for devel upgrades...
:: Resolving dependencies...
:: Calculating conflicts...
:: Calculating inner conflicts...

Aur (1)              Old Version  New Version    Make Only
aur/python-telethon  1.33.1-1     1.34.0-1       No

:: Proceed to review? [Y/n]: 

:: Downloading PKGBUILDs...
 PKGBUILDs up to date
fetching devel info...
==> Making package: python-telethon 1.34.0-1 (Wed Feb  7 17:39:01 2024)
==> Retrieving sources...
  -> Downloading Telethon-1.34.0.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  563k  100  563k    0     0  1401k      0 --:--:-- --:--:-- --:--:-- 1401k
==> Validating source files with sha256sums...
    Telethon-1.34.0.tar.gz ... Passed
==> Making package: python-telethon 1.34.0-1 (Wed Feb  7 17:39:02 2024)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found Telethon-1.34.0.tar.gz
==> Validating source files with sha256sums...
    Telethon-1.34.0.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting Telethon-1.34.0.tar.gz with bsdtar
==> Sources are ready.
python-telethon-1.34.0-1: parsing pkg list...
:: python-telethon-1.34.0-1 is up to date -- skipping
:: python-telethon-1.34.0-1 is up to date -- skipping build
loading packages...
error: '/home/c0rn3j/.cache/paru/clone/python-telethon/python-telethon-1.34.0-1-any.pkg.tar.zst': could not find or read package

[1] % pacman -Q python-telethon
python-telethon 1.33.1-1

[130] % paru --version           
paru v2.0.1 - libalpm v13.0.2
2.0.1 from AUR/paru with this patch
[0] % env LC_ALL=C LANGUAGE=C paru -S --noconfirm --needed --cleanafter --ignore=deemix-git,deemix-gui-git -u
:: Starting full system upgrade...
 there is nothing to do
:: Looking for PKGBUILD upgrades...
:: Looking for AUR upgrades...
:: Looking for devel upgrades...
:: Resolving dependencies...
:: Calculating conflicts...
:: Calculating inner conflicts...

Aur (1)              Old Version  New Version    Make Only
aur/python-telethon  1.33.1-1     1.34.0-1       No

:: Proceed to review? [Y/n]: 

:: Downloading PKGBUILDs...
 PKGBUILDs up to date
fetching devel info...
==> Making package: python-telethon 1.34.0-1 (Wed Feb  7 17:55:59 2024)
==> Retrieving sources...
  -> Downloading Telethon-1.34.0.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  563k  100  563k    0     0  2478k      0 --:--:-- --:--:-- --:--:-- 2478k
==> Validating source files with sha256sums...
    Telethon-1.34.0.tar.gz ... Passed
==> Making package: python-telethon 1.34.0-1 (Wed Feb  7 17:56:00 2024)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found Telethon-1.34.0.tar.gz
==> Validating source files with sha256sums...
    Telethon-1.34.0.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting Telethon-1.34.0.tar.gz with bsdtar
==> Sources are ready.
python-telethon-1.34.0-1: parsing pkg list...
==> Making package: python-telethon 1.34.0-1 (Wed Feb  7 17:56:00 2024)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting build()...
running build
<removed build log>
==> Entering fakeroot environment...
==> Starting package()...
running install
<removed build log>
Copying Telethon.egg-info to /home/c0rn3j/.cache/paru/clone/python-telethon/pkg/python-telethon/usr/lib/python3.11/site-packages/Telethon-1.34.0-py3.11.egg-info
running install_scripts
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "python-telethon"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: python-telethon 1.34.0-1 (Wed Feb  7 17:56:03 2024)
==> Cleaning up...
loading packages...
resolving dependencies...
looking for conflicting packages...

Package (1)      Old Version  New Version  Net Change

python-telethon  1.33.1-1     1.34.0-1       0.34 MiB

Total Installed Size:  15.10 MiB
Net Upgrade Size:       0.34 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                                                                                                                 [-------------------------------------------------------------------------------------------------------------] 100%
(1/1) checking package integrity                                                                                                                                               [-------------------------------------------------------------------------------------------------------------] 100%
(1/1) loading package files                                                                                                                                                    [-------------------------------------------------------------------------------------------------------------] 100%
(1/1) checking for file conflicts                                                                                                                                              [-------------------------------------------------------------------------------------------------------------] 100%
(1/1) checking available disk space                                                                                                                                            [-------------------------------------------------------------------------------------------------------------] 100%
:: Processing package changes...
(1/1) upgrading python-telethon                                                                                                                                                [-------------------------------------------------------------------------------------------------------------] 100%
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Removing unnecessary cached files (keeping only the latest)…
==> no candidate packages found for pruning

@Morganamilo

Copy link
Copy Markdown
Owner

Merging based on your results. Though I swear there are some other issues with --needed right now even though those ones may not cause crashing.

@Morganamilo
Morganamilo merged commit cdecf97 into Morganamilo:master Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot install AUR packages v2.0.1

3 participants