Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: replace hardcoded package names with $(PKG_NAME) #118

Closed
wants to merge 1 commit into from

Conversation

maurerle
Copy link
Member

It is best practice to not repeat the PKG_NAME multiple times, as it reduces the changes when renaming a package.

This unifies the way packages are defined, by using the PKG_NAME variable when possible in the Makefile.

I don't know any downside to this, so I hope that everybody is fine with this change in their maintained package?

I would like to get feedback from some other people active in this repository, before merging this.

Copy link
Contributor

@grische grische left a comment

Choose a reason for hiding this comment

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

LGTM

@neocturne
Copy link
Member

Personally, I would prefer to keep the style that is used throughout all of OpenWrt base and other feeds. In some cases, mixing PKG_NAME (which is not the package name, but the source archive / directory name) and package name can also be confusing when they differ.

@maurerle
Copy link
Member Author

Thanks for your feedback!
I don't see a reason why your actual package-name would be different from the directory name?
It seems to be an unspoken convention that they match (as every package here adheres to it), and this PR makes sure this is consistent by reducing complexity and creating a DRY (Dont-Repeat-Yourself) approach using the variable for this.

But I am also okay to not generalize this in the packages I am not involved in and close this PR.

@neocturne
Copy link
Member

neocturne commented Jun 15, 2024

Thanks for your feedback! I don't see a reason why your actual package-name would be different from the directory name? It seems to be an unspoken convention that they match (as every package here adheres to it), and this PR makes sure this is consistent by reducing complexity and creating a DRY (Dont-Repeat-Yourself) approach using the variable for this.

There are 3 different namespaces in which each package exists; often all 3 names are the same, but they could also all differ:

  • Source package name - what the package is referenced as in a make call when building individual packages. This name is not mentioned in the Makefile; instead, it is the name of the directory containing the Makefile
  • Binary package name - what is passed to BuildPackage, mentioned in various definitions in the Makefile, in dependencies, and used to install a package using opkg. One source package can build multiple binary packages with different names.
  • PKG_NAME - controls the default source archive filename and build directory. For packages with an upstream source, this is controlled by the upstream and not by OpenWrt, which is the reason why PKG_NAME and source/binary package name differ for some packages.

Thinking about this again, having most package use PKG_NAME, with only some packages not being able to do that because their upstream name differs from the package name, seems even worse for consistency than just having Gluon's packages differ from other feeds.

Also, using PKG_NAME in place of a binary package name might lead people into thinking that these namespaces are the same... but given that the difference is already unclear to many developers, I'm not sure if that is much of an argument.

@maurerle maurerle closed this Jun 15, 2024
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.

3 participants