Tell the world how to convert gigabytes to bytes with units(1) easilyIt turns out that units(1) is not as horrible to use in scriptsas I initially thought. When the --terse flag is combinedwith a
Tell the world how to convert gigabytes to bytes with units(1) easilyIt turns out that units(1) is not as horrible to use in scriptsas I initially thought. When the --terse flag is combinedwith an appropriate output format (set via --output-format),units(1) is actually capable of producing very nice results.For example: units -o %0.f -t '4 gigabytes' bytesis is just going to print out the expected value of 4294967296.There is no time to waste. People have to know about it.I am adding an example for this at the top of the examples sectionbecause this is what users are most likely looking for.Approved by: bcr (mentor)Differential Revision: https://reviews.freebsd.org/D24096
show more ...
units(1): Refactor the manual page and update usage informationChanges to units.1:- Change the description to a more descriptive "conversion calculator".- Sort options.- Split the description i
units(1): Refactor the manual page and update usage informationChanges to units.1:- Change the description to a more descriptive "conversion calculator".- Sort options.- Split the description into sections to make it easier to navigate the manual page.- Improve the description of various options.- Document the default value of the output format.- Use more mdoc macros for better readability.- Document the behavior of the PATH environmental variable.- Improve examples.- Add sections: EXIT STATUS, DIAGNOSTICS, and HISTORY.- Document that units(1) cannot convert negative values and it handles long unit lists poorly.- Update the documentation of the -V flag to match the implementation. units(1) prints its version and the units data file instead of its version and usage information.Changes to units.c:- Update usage information.- Sort longopts elements.This commit does not attempts to change the current behavior of units(1).What's left to do is probably defining a better versioning (at the momentunits(1) always reports "FreeBSD units" as its version) and changing thebehavior of the -V flag to only print version.Reviewed by: allanjude (earlier version), bcrApproved by: bcr (mentor)Differential Revision: https://reviews.freebsd.org/D18977
Correct a typo: was -> way.Submitted by: Larry HynesMFC after: 3 daysSponsored by: The FreeBSD Foundation
capsicum: use a new capsicum helpers in toolsUse caph_{rights,ioctls,fcntls}_limit to simplify the code.
Convert `cap_enter() < 0 && errno != ENOSYS` to `caph_enter() < 0`.No functional change intended.
units: fix some nits- prefer braces to abusing the `,` operator- mark dead function as dead- remove dead break
units(1): units(1) free savescr in error condition tooCID: 978392Reviewed by: desMFC After: 1 week
units(1): add missing ':' for two short argumentsPR: 209850MFC After: 3 days
various: general adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - error
various: general adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.No functional change intended.
DIRDEPS_BUILD: Update dependencies.Sponsored by: Dell EMC Isilon
Update URLs in usr.bin- http -> https- contents have moved locations- removal of URL if I could not find new location
Correct the -H longopt equivillantPR: 209876Submitted by: <kdrakehp AT zoho DOT com>Approved by: bcr (mentor)Differential Revision: https://reviews.freebsd.org/D11988
Add HAS_TESTS to all Makefiles that are currently using the`SUBDIR.${MK_TESTS}+= tests` idiom.This is a follow up to r321912.
Convert traditional ${MK_TESTS} conditional idiom for including testdirectories to SUBDIR.${MK_TESTS} idiomThis is being done to pave the way for future work (and homogenity) in^/projects/make-ch
Convert traditional ${MK_TESTS} conditional idiom for including testdirectories to SUBDIR.${MK_TESTS} idiomThis is being done to pave the way for future work (and homogenity) in^/projects/make-check-sandbox .No functional change intended.MFC after: 1 weeks
Escape No to avoid confusion with the No macroReported by: make manlintMFC after: 2 days
Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedafter r298107Summary of changes:- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that na
Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedafter r298107Summary of changes:- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed- Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc- Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously.- Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk- Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk.- Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo- Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)Document the proposed changes in share/examples/tests/tests/... via examplesso it's clear that ${PACKAGES}FILES is the suggested way forward in terms ofreplacing FILES. share/mk/bsd.README didn't seem like the appropriate methodof communicating that info.MFC after: never probablyX-MFC with: r298107PR: 209114Relnotes: yesTested with: buildworld, installworld, checkworld; buildworld, packageworldSponsored by: EMC / Isilon Storage Division
Bring a little more compability with GNU units 2.12- notionally support a 'history file' flag. This doesn't do much now, but is there to prevent scripts written against GNU units from breaking-
Bring a little more compability with GNU units 2.12- notionally support a 'history file' flag. This doesn't do much now, but is there to prevent scripts written against GNU units from breaking- correctly gracefully quit rather than exit (this will make it easier to support a history file in the future)- remove the "t" flag from fopen which was there to support windows. We have not supported windows since at the latest, the introduction of capsicum.
Fix build breakage introduced by r298253.
Rename units.lib -> definitions.units- this matches GNU units 2.12add ISO country codes from units 2.12
Remove pathnames.h- it only holds a single constant- it doesn't exist in the GNU variant
DIRDEPS_BUILD: Connect MK_TESTS.Sponsored by: EMC / Isilon Storage Division
Avoid adding the '-release' suffix to non-debug kernel packages.Sponsored by: The FreeBSD Foundation
Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) andnetbsd-tests.test.mk (r289151)- Eliminate explicit OBJTOP/SRCTOP setting- Convert all ad hoc NetBSD test integration
Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) andnetbsd-tests.test.mk (r289151)- Eliminate explicit OBJTOP/SRCTOP setting- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk- Remove unnecessary TESTSDIR setting- Use SRCTOP where possible for clarityMFC after: 2 weeksSponsored by: EMC / Isilon Storage Divison
Fix interaction between libedit initialization and Capsicumin units(1). The most visible is the removal of libedit warningsabout being unable to open termcap database.Reviewed by: eadler@MFC aft
Fix interaction between libedit initialization and Capsicumin units(1). The most visible is the removal of libedit warningsabout being unable to open termcap database.Reviewed by: eadler@MFC after: 1 monthSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D3322
Only initialize libedit when necessaryThe code path to support units conversions from the command lineneed not initialize neither libedit nor the history. Therefore, only dothat when in interact
Only initialize libedit when necessaryThe code path to support units conversions from the command lineneed not initialize neither libedit nor the history. Therefore, only dothat when in interactive mode.This hides the issue reported in PR bin/201167 whereby running commandsof the form 'echo "$(units ft in)"' would corrupt the terminal. The realissue causing the corruption most likely still remains somewhere.PR: bin/201167Differential Revision: D2935Reviewed by: eadler
1234