Fix convert pup_event_ipc.bac to C
Yesterday I posted about using Claude AI to convert some utilities in the pup-tools package written in BaCon and nim to C:
- pup-tools utilities converted from bacon and nim to C — November 17, 2026
The BaCon utilities: welcome1stboot.bac, find_cat.bac, pup_event_ipc.bac
The nim utility: debdb2pupdb.nim
Don't actually use welcome1stboot anymore, nor, I think, find_cat; however, pup_event_ipc is an important part of the pup_event mechanism.
I compiled these C programs, and unfortunately pup_event_ipc does not work. Could probably work through it and find where it is going wrong; however, decided on a different approach. The BaCon compiler is not an actual compiler; it generates C code then calls gcc. So, I told the 'bacon' executable to create the C code only, then I made it into a tarball and provided it to Claude. I asked Claude:
Could you simplify this C code
What followed is quite remarkable. The C code created by bacon is very human-unreadable, so I was hoping that Claude could reduce it to something simpler and human-readable. It did. This is Claude's analysis:
I've rewritten the BaCon-generated code as one standalone
file, `pup_event_ipc.c`, about 186 lines. It builds with `cc -o
pup_event_ipc pup_event_ipc.c`. The original was roughly 1,850
lines spread over nine files, plus the BaCon runtime.
I compiled both versions and ran them side by side. They gave
the same output and exit codes for every case I tried:
- mailbox send, read and empty
- the `waitmail` timeout
- a bad format
- a request/reply exchange
- the keyword waits
**What changed**
- The `#line` markers, the BaCon string runtime, the
`select`/`CONCAT` machinery and the `exitsub`/`waitsub` wrappers
are gone.
- The help text is one string literal.
- The keyword handling is a small table: `block`, `dbus`,
`network`, `x`, `bluetoothhw`, `timeout1`, `timeout4`,
`timeout60` and `netchg` all wait on
`<keyword>_<client>`.
- The "Not implemented" branch is gone. It could never run,
because the file had just been created a few lines earlier.
- Cleanup is left to `exit`, which closes the file descriptors.
There's no explicit `inotify_rm_watch`.
- The timeout wait now uses `poll` in both cases, with an
infinite timeout when `-t` is 0, instead of a separate blocking
`read`.
**Behaviour that differs from the original**
- **`dbus`:** In the original it was missing from the keyword
list, so `dbus:x` wrote to file descriptor 0 (stdin). Now it
behaves like the other keywords. This is a guess at what the
author intended.
- **Error codes 3 and 4:** A failed `open` used to hit BaCon's
runtime error first, so the documented exit codes 3 and 4 never
happened. They now work as the help text says.
- **`-t` as the last argument:** It used to read past the end of
`argv`. Now it's ignored.
The client names go straight into
`/tmp/pup_event_ipc/<name>` with no check for `/`, same as
the original. That would allow path traversal if untrusted input
ever reaches it. I left it alone to keep behaviour identical,
but it's a one-line check if you want it.
The result is a single small C file, completely redesigned, using
some C functions that must be in libc, but I know nothing about
them. Anyway, it compiled, and it works. Haven't studied how it
works; for now, just happy that it does.
Tags: easy
gcc14 patch for ROX-Filer
ROX-Filer is compiled in woofQ2 and a PET created, that is used
in the EasyOS build. You can download the woofQ2 tarball to see
the source: it is old source dated 2011-10-22, with 22 patches.
It compiles ok in EasyOS, with gcc 14, with a lot of warnings, so I thought why not ask Claude AI? Blog post yesterday, reported on using Claude for the first time, converted some BaCon and nim coded utilities to C. Was very impressed with Claude -- and a bit worried how clever it is.
Decided why not ask Claude if can create a patch so ROX-Filer will compile cleanly with gcc14. Using the free Claude, uploaded rox source tarball, with the 22 patches already applied, and asked this:
Please create a patch so this code will compile cleanly with gcc 14 in linux
This is the reply:
This is ROX-Filer (GTK2). The sandbox has gcc 13 and no GTK2
headers, so I can’t do a full gcc 14 build. I’m statically
checking for the constructs gcc 14 turns into errors (implicit
declarations, int/pointer conversions) and fixing the configure
GCC-version check.
Still auditing: no GTK2/libxml headers here, so I’m checking the
likely gcc 14 error spots by hand (pointer-type mismatches on
gsize/len arguments, missing includes) and I’ve already found
the configure.in/configure GCC-version bug. Patch comes next.
I’ve made a patch (rox-filer-gcc14.patch), but I couldn’t
compile it. This sandbox has gcc 13 only, with no GTK2 or libxml
headers and no network to fetch them. It applies cleanly to your
tarball, and configure still passes a shell syntax check. Please
do a real build on your gcc 14 system to confirm.
I found one definite gcc 14 problem:
configure.in and configure: the GCC version check only matched
single-digit major versions ([5-9]). On gcc 10 and up, including
14, it fell through to the default branch. That branch skipped
-Wno-pointer-sign and -fno-stack-protector, so the build gets a
flood of pointer-sign warnings. The patch changes the pattern to
[5-9]|[1-9][0-9]. It edits both files because the generated
configure is in the tarball, so you don’t need to re-run
autoconf.
I also added includes that were missing as far as I could tell
by grep. Each one was reached only through other headers, so gcc
14’s stricter implicit-declaration errors could bite if those
paths change:
dir.c: <fcntl.h> for open/fcntl.
minibuffer.c and support.c: <strings.h> for strncasecmp.
xdgmimemagic.c: <wchar.h> for mbrtowc.
action.c: <sys/select.h> for select.
I also looked at hash-table and qsort callback signatures and
the int/pointer conversions I could find by grep, and found no
mismatches. If your gcc 14 build still stops with an error, send
me the compiler output and I’ll extend the patch.
filer.c.orig in the tarball differs from filer.c. I left it
alone, so it still sits in the source tree.
And Claude created 'rox-filer-gcc14.patch', that I added to
woofQ2, compiled rox; there was just one deprecated warning. Very
impresssed.
Tags: easy
Fix Easy Containers accelerated graphics checkbox
Chose "excalibur" container in the Manage tab, causes Expert tab
to be immediately set to the security settings for excalibur:

...however, "accel. graphics" checkbox wasn't getting set, it
should have been. Fixed in script
/usr/local/easy_containers/EC_SEC_INSERT
Tags: easy
pup-tools utilities converted from bacon and nim to C
pup-tools is a package with lots of little utilities that are used in EasyOS. Most are written in C; however, a couple are written in BaCon and one in nim language.
For a very long time I have wanted to convert them all to C; however, it is not easy, so just put it off. Until today; used AI for the first time.
Went to claude.ai, used the free version, online, gave it the BaCon and the nim programs and it converted them to C.
I was very surprised that Claude knows all about BaCon Basic, BaCON HUG (Highlevel Universal GUI), nim, even the Puppy Linux package format. It was actually quite scary how clever Claude was, analyzing the programs.
Now have pup-tools-20261117.tar.gz source, but cannot upload to ibiblio.org, as ibiblio is having some serious problem. Don't know what it is, tried to upload about 12 hours ago, again this evening, no go. support.ibiblio.org was working this morning, now broken, so can't even find it information about the breakage.
pup-tools was previously compiled in OpenEmbedded, for Scarthgap,
and I used that in the EasyOS Excalibur build. Now though, have
put pup-tools compile in woofQ2.
Tags: easy
Cleanup user-installed packages when version update
I was reading posts by pp4mnk:
https://forum.puppylinux.com/viewtopic.php?p=180049#p180049
Yes, easy.sfs in Easy version 7.5.3 has bumped yradio to 1.9.6-1. If the user has installed a yradio .pet, that is going to interfere. In the initrd, there is a script /sbin/zrem-user-pkgs, that removes the conflicting user-installed .pet
I reviewed that code, and found that it does work, but only for .deb packages. When a package is installed, a file is created in /root/.packages/filesdb, with a list of all installed folders and files.
To test this, I installed 'yradio-1.9.5-1.pet' and yes, /root/.packages/filesdb/yradio-1.9.5-1.files got created.
Good, but the code in zrem-user-pkgs only looks for "yradio.files" and "yradio_*.files", which is ok for .deb packages, not the yradio .pet. I have modified the script:
FLIST="$(find /mnt/${WKG_DEV}/${WKG_DIR}.session/session1/root/.packages/filesdb -maxdepth 1 -name "${aU}_*.files" | head -n 1)"
#20261117 pet pkg has filesdb/yradio-1.9.5-1.files ...
if [ -z "$FLIST" ];then
xaU="$(grep -F "|${aU}|" /mnt/${WKG_DEV}/${WKG_DIR}.session/session1/root/.packages/user-installed-packages | cut -f 1 -d '|' | head -n 1)"
FLIST="$(find /mnt/${WKG_DEV}/${WKG_DIR}.session/session1/root/.packages/filesdb -maxdepth 1 -name "${xaU}*.files" | head -n 1)"
fi
...looks like it will do the job.
This is a developer policy decision, that user-installed packages
should not override those in easy.sfs. This is important, as the
user may have installed an older package, say yradio-1.9.5-1,
whereas the easy.sfs has a later version.
Tags: easy
Fix kexec in 6.6.x kernel
I have posted recently about being able to rollback to an older kernel. For example, when linux-kernel-old_6.6.161_amd64.sfs is selected to be loaded, at next bootup the inc/05-kernel-change script changes from the 7.2.12 kernel over to the 6.6.161 kernel, using the 'kexec' utility.
That's ok, but if you de-select the linux-kernel-old_6.6.161_amd64.sfs, at next bootup, kexec attempts to swap back to the 7.2.12 kernel, but fails. Just hangs, requiring to hold down the power button to hard power-off. Then when bootup it is ok, back on the 7.2.12 kernel.
I found that CONFIG_KEXEC_FILE is required to be set, but isn't, so have compiled the 6.6.162 kernel, like this:
General setup ->
Kexec and crash features ->
[*] Enable kexec file based system call
...which enables that CONFIG_KEXEC_FILE
Haven't uploaded linux-kernel-old_6.6.162_amd64.sfs, will do so
soon.
Tags: easy
Slightly wider EasyJWM window
Forum member pp4mnk has suggested this:
https://forum.puppylinux.com/viewtopic.php?t=17729
Yes, done.
Tags: easy
EasyApps fix missing apps
Forum member pp4mnk reported the problem. Fixes applied:
https://forum.puppylinux.com/viewtopic.php?t=17727
EasyApps is a convenient alternative to the menu, for finding
apps, organized in a way that might make finding what you want
easier. Though, it might not have everything that is in the main
menu.
Tags: easy