Skip to content

afetch: add new package (2.2.0)#29292

Open
tiagorochaxyz wants to merge 1 commit intoopenwrt:masterfrom
tiagorochaxyz:feature_afetch
Open

afetch: add new package (2.2.0)#29292
tiagorochaxyz wants to merge 1 commit intoopenwrt:masterfrom
tiagorochaxyz:feature_afetch

Conversation

@tiagorochaxyz
Copy link
Copy Markdown

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

@BKPepe BKPepe requested a review from Copilot May 3, 2026 06:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/Makefile to build/install afetch in OpenWrt.
  • Added a large patch to src/fetch.c to 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.

Comment thread utils/afetch/patches/100-add_openwrt_support_and_reduce_size.patch Outdated
+ info.col7 = BBLUE " OpenWrt " BBLUE;
info.col8 = BBLUE "";
info.getPkgCount =
"grep 'P:' /lib/apk/db/installed | wc -l";
Comment on lines +5 to +37
@@ -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";
Comment thread utils/afetch/patches/100-add_openwrt_support_and_reduce_size.patch
Comment thread utils/afetch/Makefile Outdated
@tiagorochaxyz tiagorochaxyz force-pushed the feature_afetch branch 2 times, most recently from 3efba52 to 265f6eb Compare May 4, 2026 03:32
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>
Copy link
Copy Markdown
Member

@BKPepe BKPepe left a comment

Choose a reason for hiding this comment

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

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.

Comment thread utils/afetch/Makefile
PKG_VERSION:=2.2.0
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
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.

This is default.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks, I'll remove that line.

Comment thread utils/afetch/Makefile
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=V$(PKG_VERSION).tar.gz
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.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks, I'll fix that.

Comment thread utils/afetch/Makefile
Comment on lines +1 to +6
#
# Copyright (C) 2007-2026 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
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.

Are you affiliated with OpenWrt somehow or not? If not, remove it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

Comment thread utils/afetch/Makefile

PKG_MAINTAINER:=Tiago Rocha <tiagorocha@disroot.org>
PKG_LICENSE:=GPL-3.0-only
PKG_LICENSE_FILES:=COPYING
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.

Are you sure? I can not find COPYING in the repository.
There is LICENSE - https://github.com/13-CF/afetch/blob/master/LICENSE

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sorry, this was a copy and paste error from an example in the documentation that went unnoticed.

Comment thread utils/afetch/Makefile
CATEGORY:=Utilities
TITLE:=Fast and simple system info written in C
URL:=https://github.com/13-CF/afetch
endef
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.

No depends?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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?

Comment thread utils/afetch/Makefile
Comment on lines +32 to +35
define Package/afetch/description
Fast and simple system info (for UNIX based operating systems)
written in POSIX compliant C99.
endef
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.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants