pbrisbin / aurget

A simple pacman-like interface to the AUR
GNU General Public License v2.0
69 stars 17 forks source link

Remove --pkg options since it was removed from pacman 5. #42

Closed Holzhaus closed 8 years ago

Holzhaus commented 8 years ago

The current makepkg (pacman) 5.0.1 doesn't have the --pkg option anymore.

pbrisbin commented 8 years ago

How do split package installations work without this option?

Holzhaus commented 8 years ago

Looks like it's necessary to build all parts of a split package.

Relevant discussion on the mailing list: https://lists.archlinux.org/pipermail/pacman-dev/2015-September/020353.html

Upstream commit: https://projects.archlinux.org/pacman.git/commit/scripts/makepkg.sh.in?id=169287e494a5348687260a00697be06b36ba4434

pbrisbin commented 8 years ago

Sorry I'm still a little confused. I get that if you omit this option, makepkg will build all the packages defined in a split PKGBUILD, but how does it know what to install?

Holzhaus commented 8 years ago

Doesn't makepkg just build packages without installation (unless you pass -i)? If the packages have been built, just call pacman -U pkgname manually for all packages you'd like to install and just ignore the other ones. I don't know if there's a better way to do this.

pbrisbin commented 8 years ago

Aurget specifically relies on makepkg -i because locating the built package file after the fact and installing it via pacman -U is fraught with edge cases and annoyances. Are you saying makepkg -i is just no longer supported for split packages, or that it installs all the built packages?

richq commented 8 years ago

Seems like for split packages it installs everything. Here's the install function from makepkg, the array it loops over contains all the package names in the split package, then it passes the list to pacman -U to install all of them. Previously the pkgname array could be overridden by the --pkg flag, but that's no longer possible.

If I were you, I'd just do the same in aurget - install everything from a package. The burden to support a feature that upstream has explicitly removed seems too much. There's always aurget -Sb and the user can install the split packages one by one manually.

# this function always returns 0 to make sure clean-up will still occur
install_package() {
        (( ! INSTALL )) && return

        if (( ! SPLITPKG )); then
                msg "$(gettext "Installing package %s with %s...")" "$pkgname" "$PACMAN -U"
        else
                msg "$(gettext "Installing %s package group with %s...")" "$pkgbase" "$PACMAN -U"
        fi

        local fullver pkgarch pkg pkglist
        (( ASDEPS )) && pkglist+=('--asdeps')
        (( NEEDED )) && pkglist+=('--needed')

        for pkg in ${pkgname[@]}; do
                fullver=$(get_full_version)
                pkgarch=$(get_pkg_arch $pkg)
                pkglist+=("$PKGDEST/${pkg}-${fullver}-${pkgarch}${PKGEXT}")

                if [[ -f "$PKGDEST/${pkg}-debug-${fullver}-${pkgarch}${PKGEXT}" ]]; then
                        pkglist+=("$PKGDEST/${pkg}-debug-${fullver}-${pkgarch}${PKGEXT}")
                fi
        done

        if ! run_pacman -U "${pkglist[@]}"; then
                warning "$(gettext "Failed to install built package(s).")"
                return 0
        fi
}
pbrisbin commented 8 years ago

Thanks for providing that context @richq . Interesting that there's still some SPLITPKG-based logic there, but the main loop does appear to do nothing special.

pbrisbin commented 8 years ago

Merged as 82aa6334. Thanks!