archlinux-downgrade / downgrade

Downgrade packages in Arch Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

downgrade-11.3.0-1 package doesn't include executables

pbrisbin opened this issue Β· comments

πŸ› Bug Report

Checklist

  • No duplicate issues/PRs
  • Are you running the latest downgrade release from the AUR?

Environment

  • System information:
  • Downgrade version:
    11.3.0-1

Description

Packing doesn't include executables.

Steps to Reproduce

See https://pastebin.com/DETBtY9r.

Expected behavior

Executables should be included in package (and installed).

Actual behavior

Executables are not packaged or installed.

Other

It seems like this bit is broken:

for script_ in ; do \
  ...
done

I would expect that to be something like,

for script_ in downgrade pacignore; do \
  ...
done

But I suspect there is a make variable that is incorrect.

I'm not able to reproduce

% cat >PKGBUILD <<'EOM'
\`heredoc> # shellcheck disable=SC2034
# shellcheck disable=SC2154
# Author: Patrick Brisbin <pbrisbin@gmail.com>
pkgname=downgrade
pkgver=11.3.0
pkgrel=1
pkgdesc="Bash script for downgrading one or more packages to a version in your cache or the A.L.A."
arch=('any')
url="https://github.com/archlinux-downgrade/$pkgname"
license=('GPL')
backup=(etc/xdg/downgrade/downgrade.conf)
source=("downgrade-v$pkgver.tar.gz::https://github.com/archlinux-downgrade/$pkgname/archive/v$pkgver.tar.gz")
depends=('pacman-contrib' 'fzf') # pacsort
optdepends=('sudo: for installation via sudo')

package() {
  cd "$pkgname-$pkgver" || exit 1

  make DESTDIR="$pkgdir" PREFIX=/usr install
}
md5sums=('ca0c6958ef85116f96bb65e07cb26aff')
EOM
% makepkg -rsi
==> Making package: downgrade 11.3.0-1 (Tue 17 Oct 2023 08:57:15 AM EDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading downgrade-v11.3.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 54199    0 54199    0     0   175k      0 --:--:-- --:--:-- --:--:--  175k
==> Validating source files with md5sums...
    downgrade-v11.3.0.tar.gz ... Passed
==> Extracting sources...
  -> Extracting downgrade-v11.3.0.tar.gz with bsdtar
==> Entering fakeroot environment...
==> Starting package()...
install -Dm644 conf/downgrade.conf "/tmp/pkg/downgrade/etc/xdg/downgrade/downgrade.conf"
install -Dm644 doc/downgrade.8 "/tmp/pkg/downgrade/usr/share/man/man8/downgrade.8"
install -Dm644 doc/pacignore.8 "/tmp/pkg/downgrade/usr/share/man/man8/pacignore.8"
for script_ in pacignore downgrade; do \
  install -Dm755 "bin/$script_" "/tmp/pkg/downgrade/usr/bin/$script_"; \
  install -Dm644 "completion/$script_/bash" "/tmp/pkg/downgrade/usr/share/bash-completion/completions/$script_"; \
  install -Dm644 "completion/$script_/zsh" "/tmp/pkg/downgrade/usr/share/zsh/site-functions/_${script_}"; \
  install -Dm644 "completion/$script_/fish" "/tmp/pkg/downgrade/usr/share/fish/vendor_completions.d/${script_}.fish"; \
done
for po_file_ in locale/**/*.po; do \
  locale_="$(basename "$po_file_" .po)"; \
  script_="$(basename "$(dirname "$po_file_")")"; \
  mkdir -p "/tmp/pkg/downgrade/usr/share/locale/$locale_/LC_MESSAGES/"; \
  msgfmt "$po_file_" -o "/tmp/pkg/downgrade/usr/share/locale/$locale_/LC_MESSAGES/${script_}.mo"; \
done
==> 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 "downgrade"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: downgrade 11.3.0-1 (Tue 17 Oct 2023 08:57:19 AM EDT)
==> Installing package downgrade with pacman -U...
loading packages...
warning: downgrade-11.3.0-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) downgrade-11.3.0-1

Total Installed Size:  0.07 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] y
(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) reinstalling downgrade                                                                             [##############################################################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
makepkg -rsi  3.78s user 2.71s system 74% cpu 8.754 total
% p -Ql downgrade | grep bin
downgrade /usr/bin/
downgrade /usr/bin/downgrade
downgrade /usr/bin/pacignore

So this must be something about the reporting user's system that makes,

SCRIPTS      ?= $(shell find bin -type f -executable -printf "%f\n")

not work.

One theory could be that SCRIPTS is defined somehow for them and is overriding this because of ?=. I don't know that we have a valid use-case for allowing override, and perhaps using := instead would make this work. If that's even the issue.

commented

The above issue happens when building on a partition with the noexec option.

Thanks for following up, that makes sense. It seems like a bit of an edge-case to add an explicit check for, but if someone opened that as a PR I would probably merge it. Closing this issue now, since it seems to be have been explained.