Skip to content

lime-utils: init the package with the script unique_append - #1276

Draft
a-gave wants to merge 2 commits into
libremesh:masterfrom
a-gave:packages/lime-utils
Draft

lime-utils: init the package with the script unique_append#1276
a-gave wants to merge 2 commits into
libremesh:masterfrom
a-gave:packages/lime-utils

Conversation

@a-gave

@a-gave a-gave commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

[WIP] still untested

lime-system: utils.lua use nixio.fs for file operations
This includes also a similar minor fix:

  • fix: use the lua native #var to count tableLength(var)

lime-utils: init the package with the script unique_append
The following changes are made:

  • initialize the package lime-utils with the script unique_append
  • add a dependency on lime-utils to all packages
  • always 'exit 0' on uci defaults that add new crontabs, to execute them
    only at firstboot and not at every boot

Fixes: #949

The following changes are made:
- initialize the package lime-utils with the script unique_append
- add a dependency on lime-utils to all packages
- always 'exit 0' on uci defaults that add new crontabs, to execute them
only at firstboot and not at every boot

Fixes: libremesh#949
@a-gave
a-gave force-pushed the packages/lime-utils branch 2 times, most recently from 2882400 to d28e343 Compare September 4, 2026 14:21
This includes also a similar minor fix:
- fix: use the lua native #var to count tableLength(var)
@a-gave
a-gave force-pushed the packages/lime-utils branch from d28e343 to e569bd0 Compare September 4, 2026 14:23
@a-gave
a-gave deployed to physical-lab September 4, 2026 15:04 — with GitHub Actions Active
@a-gave
a-gave deployed to physical-lab September 4, 2026 15:04 — with GitHub Actions Active
@a-gave
a-gave deployed to physical-lab September 4, 2026 15:04 — with GitHub Actions Active
@a-gave
a-gave deployed to physical-lab September 4, 2026 15:04 — with GitHub Actions Active
@a-gave
a-gave deployed to physical-lab September 4, 2026 15:04 — with GitHub Actions Active
else
return false
end
return fs.stat(name, "type") == "reg"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the new implementation!
But this function passed to be true also for directories to be true only for regular files, and this requires updating this test:

assert.is_true(utils.file_exists(dir))

and some (mostly unused) code here (just checked the ones where the variable name looked like a directory's one):

if not utils.file_exists(dst_dirname) then

if not utils.file_exists(workdir) then

And also here as it seems that keeping directories over updates is supported (according to lime-example.txt, I did not check):

@ilario

ilario commented Sep 5, 2026

Copy link
Copy Markdown
Member

I love the new lime-utils package!!!
Do you think that eventually, slowly slowly, it could contain the utils.lua, config.lua and modules.lua files from lime-system, as proposed in #771 ?


define Package/$(PKG_NAME)
TITLE:=LibreMesh utils core
CATEGORY:=LibreMesh

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this package could be used out of LibreMesh and be pushed to OpenWrt's repositories, eventually?
In this case, you could already place the package in the Utilities category.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unique_append should check if /etc/crontabs/root file exist before appending

2 participants