You are not logged in.

#1 2026-01-30 01:31:11

phoenix324
Member
Registered: 2023-08-23
Posts: 106

[solved] rm needed to remove file no longer packaged in PKGBUILD?

https://aur.archlinux.org/cgit/aur.git/ … unsetr-bin has `rm` inside post_upgrade(), is this needed?

https://wiki.archlinux.org/title/PKGBUILD#backup reading this i though pacman will handle deletion of file no longer present in package.

Last edited by phoenix324 (2026-01-30 02:13:14)

Offline

#2 2026-01-30 01:36:16

loqs
Member
Registered: 2014-03-06
Posts: 18,759

Re: [solved] rm needed to remove file no longer packaged in PKGBUILD?

Because the following is in the PKGBUILD rather than the packages .install I do not believe it will ever be executed:

post_install() {
    echo ":: Sleep/resume detection is handled automatically via D-Bus"
}

post_upgrade() {
    # Clean up old sleep hook from previous versions (< 0.8.0)
    if [ -f "/usr/lib/systemd/system-sleep/${_realname}-resume" ]; then
        echo ":: Removing deprecated sleep hook (sleep/resume now handled via D-Bus)"
        rm -f "/usr/lib/systemd/system-sleep/${_realname}-resume"
    fi
}

Offline

#3 2026-01-30 01:53:14

phoenix324
Member
Registered: 2023-08-23
Posts: 106

Re: [solved] rm needed to remove file no longer packaged in PKGBUILD?

oh, totally missed that. What about wether if this was in .install file, would the `rm` even be needed? isn't this done by pacman automatically?

Offline

#4 2026-01-30 02:02:46

loqs
Member
Registered: 2014-03-06
Posts: 18,759

Re: [solved] rm needed to remove file no longer packaged in PKGBUILD?

Everything placed under $pkgdir in the PKGBUILD's install function will be tracked by pacman and there is no need to remove it. Things installed by pacman's hooks or install scripts or created by running the binary the package provides may need to be removed either manually or by a hook.  So the PKGBUILD's current implementation is wrong and it is an open question if the intent behind it is wrong.

Offline

Board footer

Powered by FluxBB