afetch: add new package (2.2.0)#29292
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds an OpenWrt package definition for afetch v2.2.0 and includes a patch intended to tailor afetch output for OpenWrt and reduce upstream code size.
Changes:
- Added
utils/afetch/Makefileto build/installafetchin OpenWrt. - Added a large patch to
src/fetch.cto add OpenWrt branding and remove many other OS/distro branches.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| utils/afetch/Makefile | Introduces the OpenWrt packaging metadata and install recipe for afetch 2.2.0 |
| utils/afetch/patches/100-add_openwrt_suporte_and_reduces_size.patch | Patches upstream fetch.c to add OpenWrt detection/art and significantly trim other OS/distro handling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| + info.col7 = BBLUE " OpenWrt " BBLUE; | ||
| info.col8 = BBLUE ""; | ||
| info.getPkgCount = | ||
| "grep 'P:' /lib/apk/db/installed | wc -l"; |
| @@ -155,334 +155,18 @@ void *os() | ||
| strcpy(osname, newContents); | ||
| free(newContents); | ||
| /* end */ | ||
| - if (strncmp(osname, "Alpine Linux", 12) == 0) { | ||
| - info.col1 = BBLUE "\n"; | ||
| - info.col2 = BBLUE " /\\ /\\ "; | ||
| - info.col3 = BBLUE " / \\ \\ "; | ||
| - info.col4 = BBLUE " / \\ \\ "; | ||
| - info.col5 = BBLUE " / \\ \\ "; | ||
| - info.col6 = BBLUE "/ \\ \\"; | ||
| - info.col7 = BBLUE " \\ "; | ||
| + if (strncmp(osname, "OpenWrt", 7) == 0) { | ||
| + info.col1 = BWHITE " ______ \n" BBLUE; | ||
| + info.col2 = BWHITE " / ____ \\ " BBLUE; | ||
| + info.col3 = BWHITE "/ / __ \\ \\" BBLUE; | ||
| + info.col4 = BBLUE " / "BWHITE"/ \\"BBLUE" \\ " BBLUE; | ||
| + info.col5 = BBLUE " \\ "BWHITE"()"BBLUE" / " BBLUE; | ||
| + info.col6 = BBLUE " \\____/ " BBLUE; | ||
| + info.col7 = BBLUE " OpenWrt " BBLUE; | ||
| info.col8 = BBLUE ""; | ||
| info.getPkgCount = | ||
| "grep 'P:' /lib/apk/db/installed | wc -l"; | ||
| - } else if (strncmp(osname, "Arch Linux", 10) == 0) { | ||
| - info.col1 = BCYAN ""; | ||
| - info.col2 = BCYAN " /\\ "; | ||
| - info.col3 = BCYAN " / \\ "; | ||
| - info.col4 = BCYAN " /\\ \\ "; | ||
| - info.col5 = BCYAN " / \\ "; | ||
| - info.col6 = BCYAN " / ,, \\ "; | ||
| - info.col7 = BCYAN " / | | -\\ "; | ||
| - info.col8 = BCYAN "/_-'' ''-_\\\n"; | ||
| - info.getPkgCount = "pacman -Qq | wc -l"; |
3efba52 to
265f6eb
Compare
Fast and simple system info (for UNIX based operating systems) written in POSIX compliant C99. Link: https://github.com/13-CF/afetch Signed-off-by: Tiago Rocha <tiagorocha@disroot.org>
265f6eb to
51bed4a
Compare
BKPepe
left a comment
There was a problem hiding this comment.
I took a quick look at it and found some inconsistencies that need to be resolved. Overall, however, it leaves me wondering what the actual use case for this package is in OpenWrt, and why we should package afetch to be built for all routers supported by OpenWrt.
We can obviously find it in some GNU/Linux distributions according to https://repology.org/project/afetch/versions, but it doesn't really seem like afetch is actively maintained or developed anymore. It is 5 years old, after all.
And if I understand it correctly, it basically just displays information from /etc/os-release in a fancy layout. Personally, I don't find that interesting or useful enough to justify having a package here along with a massive patch adding OpenWrt support, which we would then have to maintain and modify with every future update.
| PKG_VERSION:=2.2.0 | ||
| PKG_RELEASE:=1 | ||
|
|
||
| PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) |
There was a problem hiding this comment.
Thanks, I'll remove that line.
| PKG_RELEASE:=1 | ||
|
|
||
| PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) | ||
| PKG_SOURCE:=V$(PKG_VERSION).tar.gz |
There was a problem hiding this comment.
This is wrong. :) We can not download tarball as vX.Y.Z.tar.gz and put it to the dl folder. What if this is going to be replaced by another tarball? There should be always name-version.
| # | ||
| # Copyright (C) 2007-2026 OpenWrt.org | ||
| # | ||
| # This is free software, licensed under the GNU General Public License v2. | ||
| # See /LICENSE for more information. | ||
| # |
There was a problem hiding this comment.
Are you affiliated with OpenWrt somehow or not? If not, remove it.
There was a problem hiding this comment.
Sorry, I misunderstood the documentation. I thought something like this was necessary as a formal way of saying that I am giving up the Makefile copyright to the OpenWrt project. I will remove this comment.
|
|
||
| PKG_MAINTAINER:=Tiago Rocha <tiagorocha@disroot.org> | ||
| PKG_LICENSE:=GPL-3.0-only | ||
| PKG_LICENSE_FILES:=COPYING |
There was a problem hiding this comment.
Are you sure? I can not find COPYING in the repository.
There is LICENSE - https://github.com/13-CF/afetch/blob/master/LICENSE
There was a problem hiding this comment.
Sorry, this was a copy and paste error from an example in the documentation that went unnoticed.
| CATEGORY:=Utilities | ||
| TITLE:=Fast and simple system info written in C | ||
| URL:=https://github.com/13-CF/afetch | ||
| endef |
There was a problem hiding this comment.
As the only dependency I thought of was a libc I thought I didn't need to add anything. Should I have added the base-files package because of the /etc/os-release file?
| define Package/afetch/description | ||
| Fast and simple system info (for UNIX based operating systems) | ||
| written in POSIX compliant C99. | ||
| endef |
There was a problem hiding this comment.
Why do we need to have this in our repository? What is the usage? As it does not support OpenWrt given the patch, which you want to add here in downstream instead of adding it to upstream, I think majority of users will not use this.
There was a problem hiding this comment.
You're right, there is a real risk that afetch will no longer be maintained, it was precisely the upstream inactivity that led me to not send a patch there first. However, as the last 6 years have been insane, and many have stopped with personal projects, I believe it is worth giving more time for the upstream to return or fork to emerge. Of course there are other actively maintained fetches, but I believe they are too big and bloated for OpenWrt.
Regarding practical utility, afetch and similar tools should have no use other than being a fancy and cool way to share our setup. However, these tools are relatively popular among users of Linux and BSD distros.
Since there are some users who miss something like this in the official OpenWrt repositories, I thought I'd take the opportunity to give back and learn a little more about the project.
afetch: add new package (2.2.0)
Fast and simple system info (for UNIX based operating systems)
written in POSIX compliant C99.
Link: https://github.com/13-CF/afetch
Signed-off-by: Tiago Rocha tiagorocha@disroot.org