Bug 250926 - ports-mgmt/pkg: @shell keyword is broken: attempt to index a nil value (global 'shell') pkg: lua script failed
Summary: ports-mgmt/pkg: @shell keyword is broken: attempt to index a nil value (globa...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-pkg (Nobody)
URL:
Keywords:
: 252126 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-11-07 15:19 UTC by Christian Ullrich
Modified: 2021-08-17 15:40 UTC (History)
8 users (show)

See Also:
bugzilla: maintainer-feedback? (pkg)
ehaupt: merge-quarterly-


Attachments
Backport of https://github.com/freebsd/pkg/pull/1900/files#diff-69ee594b7055cf448f55b648f8cfb55e6094f72f13383e4e946abd37fe7e226c (923 bytes, patch)
2020-12-21 17:49 UTC, Emanuel Haupt
no flags Details | Diff
Backport of https://github.com/freebsd/pkg/pull/1900/files#diff-69ee594b7055cf448f55b648f8cfb55e6094f72f13383e4e946abd37fe7e226c (1.32 KB, patch)
2020-12-21 17:53 UTC, Emanuel Haupt
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Ullrich 2020-11-07 15:19:41 UTC
The @shell keyword is broken:

# pkg install -f bash
Updating packagesite repository catalogue...
packagesite repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
        bash-5.0.18_3

Number of packages to be reinstalled: 1

Proceed with this action? [y/N]: y
[1/1] Reinstalling bash-5.0.18_3...
[1/1] Extracting bash-5.0.18_3: 100%
pkg: Failed to execute lua script: [string "shell_path = pkg.prefixed_path("bin/bash")..."]:7: attempt to index a nil value (global 'shell')
pkg: lua script failed


Same for other ports with the @shell keyword (devel/git), same within poudriere testport.

The last change to Keywords/shell.ucl replaced the working sh implementation with Lua. I noticed the problem with the second git upgrade since then, so this was the first time pkg tried to run a post-deinstall script that has the Lua implementation.

FreeBSD 12.2-RELEASE (releng/12.2), pkg 1.15.10, ports head, amd64.
Comment 1 Kyle Evans freebsd_committer freebsd_triage 2020-11-07 15:21:13 UTC
I have a PR against PKG that fixes it here: https://github.com/freebsd/pkg/pull/1900
Comment 2 Emanuel Haupt freebsd_committer freebsd_triage 2020-12-21 07:36:30 UTC
@bapt: do you think you could merge the upstream committed patch? I am getting a lot of reports due to the recent bash updates.
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2020-12-23 02:49:26 UTC
^Triage: Regression in ports/latest only or MFH required?
Comment 6 Emanuel Haupt freebsd_committer freebsd_triage 2020-12-23 07:32:09 UTC
(In reply to Kubilay Kocak from comment #5)
No, the regression is in ports/latest only. 2020Q4 is not affected.
Comment 7 Emanuel Haupt freebsd_committer freebsd_triage 2020-12-25 09:22:12 UTC
*** Bug 252126 has been marked as a duplicate of this bug. ***