Solved Problem running pkgbasify.lua

Trying to pkgbasify another machine. I download pkgbasify.lua but when I run it I get this.

/usr/libexec/flua: ./pkgbasify.lua:82: attempt to index a nil value (local 'branch')
stack traceback:
./pkgbasify.lua:82: in upvalue 'base_repo_url'
./pkgbasify.lua:113: in upvalue 'create_base_repo_conf'
./pkgbasify.lua:385: in upvalue 'setup_conversion'
./pkgbasify.lua:597: in local 'main'
./pkgbasify.lua:612: in main chunk
[C]: in ?


I've run pkgbasify.lua on 2, possibly 3 machines, and not had this problem. It doesn't show up under common problems on the pkgbasify page. https://github.com/FreeBSDFoundation/pkgbasify.

I see one person opened an identical issue 7 hours ago, no updates on their issue yet. (At 16:08, EST). I'll add myself to the issue there, but if anyone has any ideas, please let me know. The main difference between this and the machines that had no problem is that this has zfs on a single SSD, the others were nvme, and this system has Nvidia while the others were AMD.

The identical issue is at
 
Last edited:
its same bug for me

this line
return assert(raw:match("(%d+)%.(%d+)%-(%u+)")), raw
seems to be the problem
Diff:
diff --git a/pkgbasify.lua b/pkgbasify.lua.new
index 36b61b7..b734fe7 100644
--- a/pkgbasify.lua
+++ b/pkgbasify.lua.new
@@ -69,7 +69,9 @@ local function freebsd_version()
                raw = capture("freebsd-version")
        end
        -- e.g. 15.0-CURRENT, 14.2-STABLE, 14.1-RxLEASE, 14.1-RELEASE-p6,
-       return assert(raw:match("(%d+)%.(%d+)%-(%u+)")), raw
+        tab = {assert(raw:match("(%d+)%.(%d+)%-(%u+)"))}
+        table.insert(tab,raw)
+        return table.unpack(tab)
 
Thanks, if I get or see a response on github, I'll post here. BTW, I keep meaning to compliment you on your icon. Is that any sort of special breed of cat, or just a good looking domestic shorthair?
The issue wasn't fixed, but I wound up using traditional freebsd-update to upgrade the machine to 15.0. I then tried to run it on the newly updated system and it seemed to work, but at the end I got
Code:
Error: Non-standard pkg REPOS_DIR config does not include //usr/local/etc/pkg/repos/

So... I guess new issue. Not sure if I should bother reporting it as it's possible it'll be fixed by the time of 15.1.
 
i know shit about lua but that was introduced 3 days ago with jail support
the raw:match("(%d+)%.(%d+)%-(%u+)"), raw
is supposed to return 4 values for the assignment for major, minor, release, raw but it seems it returns just 2 in the 3+1 construct
it just returns 14 14.3-RELEASE-p4 instead of 14 3 RELEASE 14.3-RELEASE-p4 as of just first result of the match is kept last 2 discarded


just a common yard cat, no special breed or anything
 
I can confirm, I ran into this error too yesterday.
I upgraded a VM 14.3 to 15.0, for that I used the traditional way freebsd-update, it went fine.
Then I converted it to pkg-base using pkgbasify, it didn't work, got the same error, so I applied the fix found in the bug report on github, enabled the pkg-base repo, then after that pkgbasify did its job correctly.
 
Yes, that fix seems to work, as I said I already used freebsd-update to update, and just ran pkgbasify.lua, downloading the very latest, and I no longer get that error about non standard pkg REPOS_DIR.
 
Yeah it seems they already accepted the fix, that's good.
pkgbasify needs some time to be more mature I suppose, hopefully things will be okay when 15.1 will come out.
 
Hopefully yes. The one that was first out with pkgbasify had the wrong path to keys, so it wouldn't update without the path being fixed. I put up a little page about it, mostly to remind myself, at https://srobb.net/fbsd14_15.html. (The page is pretty use case specific, only covering ZFS, though I figure the information could be easily adopted to non ZFS.) This way, if I do a new install anywhere, I'll remember where to find the information.
 
Notes are always welcome IMO, especially after months or years when the brain totally forgot some pieces of information, at this moment you really enjoy your notes :)
Nice notes BTW, simple and clear, keep it up mate!
 
Thanks very much.

I'm going to mark this thread as solved, since even though I couldn't test on 14.3, it seems from the comments on github and this thread that it's been fixed.
 
Back
Top