Comments (3)
Please ensure the version is defined using semver format. It should also be easily checked in the code with pre-processor macros. Usually, having integral and string versions are useful. Eg. (something like below, not necessarily exactly this):
#define xstr(s) str(s)
#define str(s) #s
#define VERSION_BUILD(_major, _minor_, _build) ((_major << 24 | _minor << 16 | _build))
#define ZTP_LIB_VERSION_MAJOR 3
#define ZTP_LIB_VERSION_MINOR 11
#define ZTP_LIB_VERSION_PATCH 1
// Define numerical version for pre-process macro checks/comparisons
#define ZTP_LIB_VERSION_3_11_1 VERSION_BUILD(ZTP_LIB_VERSION_MAJOR, ZTP_LIB_VERSION_MINOR, ZTP_LIB_VERSION_PATCH)
#define ZTP_VERSION_CURRENT ZTP_LIB_VERSION_3_11_1
#define ZTP_VERSION_CURRENT_STR "v" xstr(ZTP_LIB_VERSION_MAJOR) "." xstr(ZTP_LIB_VERSION_MINOR) "." xtr(ZTP_LIB_VERSION_PATCH)
#if ZTP_VERSION_CURRENT > ZTP_VERSION_3_11_1
// do version conditional-things
#endif
...
main(int argv, char *argv[]) {
switch (optarg) {
case 'v':
printf("ztpd " ZTP_VERSION_CURRENT_STR);
break;
// ...
}
}
from wifi-ztp.
A current workaround for this is to query the package manager:
rpm -qa | grep ztpd
from wifi-ztp.
A current workaround for this is to query the package manager:
rpm -qa | grep ztpd
This works ok for rpm-based distros, but won't work for .deb-based distros (Debian, Ubuntu). For the former, consider using rpm query tags to extract very specific versioning information. Also, instead of grepping the output, you should instead specify the package name explicitly, rpm -qa ztpd
. Be careful as well, since if multiple versions are installed, you need to take care to format/filter/select the expected output. It's not trivial to list the "latest"/"newest" version installed.
from wifi-ztp.
Related Issues (7)
- Replace custom event loop with open-source alternative HOT 3
- Undefined behavior because null terminator was not explicitly set before strtoul uses it
- ztpd exit code is always 0 regardless of exit condition HOT 5
- Add option to specify static DPP bootstrap key for role=enrollee
- Enable static code analysis as part of CI/CD
- possible memory leak in the future if we switch to a multithreaded ztpd HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wifi-ztp.