Joachim Nilsson
daf41d326b
Relocate source files to an src/ sub directory
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-11-22 09:02:21 +01:00
Joachim Nilsson
3179be4348
Update ChangeLog, hint at future v2.0
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-11-21 23:57:31 +01:00
Joachim Nilsson
56530a8c78
Ignore global indexing files
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-11-20 18:37:59 +01:00
Joachim Nilsson
abd6e3abd6
Update rsync() unit test slightly, does not verify MTIME yet ...
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-11-20 17:32:31 +01:00
Joachim Nilsson
b078a8676f
rsync(): Refactor @delete argument into an @opt to keep mtime
...
This patch changes the @delete rsync() argument to @opt. The first bit
is reserved for %LITE_FOPT_RSYNC_DELETE, for backwards compatibility.
A new %LITE_FOPT_KEEP_MTIME option is also added. If set the mtime of
the @src file is set on @dst, both directories and regular files are
fully supported. However, if the base @dst directory does not exist,
and rsync() has to create it, its mtime will be the time of the last
file copied into it.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-11-20 17:29:39 +01:00
Joachim Nilsson
c2b92a38ef
copyfile(): Refactor @sym argument into an @opt to keep mtime
...
This patch changes the @sym copyfile() argument to @opt. The first bit
is reserved for %LITE_FOPT_COPYFILE_SYM, for backwards compatibility.
A new %LITE_FOPT_KEEP_MTIME option is also added. If set the mtime of
the @src file is set on @dst.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-11-20 17:24:08 +01:00
Joachim Nilsson
98b2e9d426
debian/changelog: New upstream release
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-11-19 22:43:03 +01:00
Joachim Nilsson
96d3e5dd8b
Bump version for v1.9.4 release cycle (-pre)
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-11-16 21:31:33 +01:00
Joachim Nilsson
ff626acb73
Update ChangeLog for upcoming v1.9.4
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-11-16 21:31:20 +01:00
Joachim Nilsson
ba3f7c89fb
Update makepath() unit test
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-31 21:08:21 +01:00
Joachim Nilsson
714ea88cc9
makepath(): Update doc, recommend mkpath() over this function
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-31 21:08:21 +01:00
Joachim Nilsson
add4d5d325
Fix #8 : constify mkpath() and makepath()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-31 21:08:21 +01:00
Joachim Nilsson
be6f276557
Fix #7 : inconsistent return value in mkpath()
...
When the required `dir` argument is missing `mkpath()` inconsistently
returns 1 instead of -1. Found by @jesponde
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-31 00:33:19 +01:00
Joachim Nilsson
6daebf4ea4
Bump version for v1.9.3 release
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-24 15:56:30 +02:00
Joachim Nilsson
4d6e3e060e
Update ChangeLog(s) for v1.9.3
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-24 15:56:17 +02:00
Joachim Nilsson
86eef8e38d
tree(): Increase internal buffer size, result may be truncated
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-24 08:42:55 +02:00
Joachim Nilsson
d5d3dafc78
Slight ABI bump due to changes in initscr()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-24 08:38:10 +02:00
Joachim Nilsson
2534c398ea
initscr(): Use stdout, not stderr, just like other conio.h macros
...
A program's stderr may have been redirected by the operator. We want to
query the size of stdout, even though it is buffered, so add fflush() to
handle that.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-24 08:33:02 +02:00
Joachim Nilsson
3691044007
conio.h: initscr() requires termios.h as well
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-24 08:32:30 +02:00
Joachim Nilsson
6770dad0cc
conio.h: Minor, whitespace only
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-24 08:32:18 +02:00
Joachim Nilsson
ef0db5e766
initscr(): Check if stdin and stdout are TTYs first
...
Programs that may be called in the background or with the stdin/stdout
redirected are not proper TTYs and we should not try to perform any
tricks on them. This patch checks isatty() and returns standard term
sizes as a fallback.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-10-24 08:31:43 +02:00
Joachim Nilsson
485463c70e
Update tree() test, use /usr/sbin instead of /sbin
...
Seems Debian finally went through with their move to symlink /bin and
/sbin to /usr/bin and /usr/sbin, respectively.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-30 11:13:23 +02:00
Joachim Nilsson
4b77eb1423
Update ChangeLog diff URLs
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-09-22 16:27:08 +02:00
Joachim Nilsson
0b54dc6015
Update Debian packaging, v1.9.2-1
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-08-15 08:15:30 +02:00
Joachim Nilsson
9d6df87d0d
Update ChangeLog and bump version for v1.9.2 release
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-09 15:52:29 +02:00
Joachim Nilsson
5b2eee6aff
conio.h: Minor refactor, cleanup
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-09 15:46:49 +02:00
Joachim Nilsson
6904f6e0fe
conio.h: Add initscr(), probes terminal rows + cols
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-07 13:19:53 +02:00
Joachim Nilsson
877ba02d13
conio.h: Revert 018e607, fails unit tests
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-07 13:19:23 +02:00
Joachim Nilsson
25dfded835
conio.h: Update copyright years
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-07 12:51:43 +02:00
Joachim Nilsson
1323a88e94
conio.h: Convert printheader() to static inline function
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-07 12:51:25 +02:00
Joachim Nilsson
018e607290
conio.h: Use stderr instead of stdout because it's non-buffered
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-07 11:58:48 +02:00
Joachim Nilsson
e48c9c5589
Bump version and update ChangeLog for v1.9.1, minor fix release
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-03 12:57:52 +02:00
Joachim Nilsson
2c875afe06
which: Allow which("ps aux"), which skips any arguments to command
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-03 12:48:02 +02:00
Joachim Nilsson
10e4a1d057
Update which() unit test, check for /bin/which and /bin/ps aux
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-03 12:45:33 +02:00
Joachim Nilsson
3dde2922c3
Add whichp() predicate function to which()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-03 12:34:05 +02:00
Joachim Nilsson
4dd9459f65
Update debian/changelog for v1.9.0-1
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 19:23:49 +02:00
Joachim Nilsson
7172f487d5
Bump version for v1.9.0 GA release
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 19:18:55 +02:00
Joachim Nilsson
4c0967405d
Bump ABI version, removed UNUSED() added which(), fixed touch()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 19:18:55 +02:00
Joachim Nilsson
fd65af31db
Update HACKING document, mostly wrt library versioning
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 19:18:55 +02:00
Joachim Nilsson
e55976d137
Update ChangeLog for v1.9 release
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 19:18:55 +02:00
Joachim Nilsson
1b1ffb33f1
Bump version to v1.9 due to new functionality, which()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 16:51:21 +02:00
Joachim Nilsson
d018a5215f
which.c: C implementation of UNIX which(1)
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 16:50:58 +02:00
Joachim Nilsson
0d70c116d7
Update .gitignore files
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 16:33:00 +02:00
Joachim Nilsson
32c774deef
tree(): Refactor, flatten tree
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-07-02 16:32:04 +02:00
Joachim Nilsson
441d5f58d7
Add simple ocular unit test for printheader()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-30 20:28:31 +02:00
Joachim Nilsson
2a59289d53
conio.h: Add top-like heading macro, printheader()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-30 20:27:59 +02:00
Joachim Nilsson
f89c3c88de
Clear build warnings for unit tests
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-30 17:43:11 +02:00
Joachim Nilsson
705b402344
Remove UNUSED() macro, just use -Wno-unused instead
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-30 17:36:10 +02:00
Joachim Nilsson
fe82ab953c
Fix non-writable tempfile(), "rw" --> "w+", found by Westermo
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-18 18:18:08 +02:00
Joachim Nilsson
6ec2a31042
Update tempfile() unit test to detect failed write + read
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-06-18 18:14:39 +02:00
Joachim Nilsson
9f5e852084
Bump version in preparation for 1.8.4 bug-fix release
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-05-20 09:29:26 +02:00
Joachim Nilsson
628c5597b9
Fix issue #6 : touch does not update mtime if file exists
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-05-19 17:50:44 +02:00
Joachim Nilsson
b7b635a3f4
Add unit test for touch to replicate issue #6
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-05-19 17:50:22 +02:00
Joachim Nilsson
dd53c3ae9e
Minor refactor of unit tests
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-05-19 17:50:07 +02:00
Joachim Nilsson
16a30a293c
Add support for make package to build .deb files
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-12 17:43:53 +01:00
Joachim Nilsson
325fcbe149
lite.h: Add whitespace to compat macros, for readability
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-03-12 17:43:31 +01:00
Joachim Nilsson
cbb1604ea0
New release for .deb package, 1.8.3-1
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-08 15:22:42 +01:00
Joachim Nilsson
8587971fb9
Update ChangeLog and bump version for v1.8.3 release
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-08 15:17:17 +01:00
Joachim Nilsson
6545ac8fd4
Bump ABI revision 3:0:0 --> 3:1:0
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-08 15:16:36 +01:00
Joachim Nilsson
9105e8d3d8
Update pidfile() documentation
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-08 15:16:00 +01:00
Joachim Nilsson
3555af6a6a
Update ChangeLog and bump version for upcoming v1.8.3 release
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-07 13:58:59 +01:00
Joachim Nilsson
42715eab8a
ChangeLog: Add missing link to v1.8.2 release
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-07 13:57:57 +01:00
Joachim Nilsson
497d58dbf0
ChangeLog: Minor Markdown fixes
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-07 13:57:21 +01:00
Joachim Nilsson
9ab70ebbcd
Build all unit tests static, for easier debugging
...
- Add -static to LDFLAGS
- Remove CFLAGS override, respect input from configure script
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-07 13:00:08 +01:00
Joachim Nilsson
bad363883d
Fix leaky makepath() unit test
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-07 12:59:27 +01:00
Joachim Nilsson
7f3215b3e6
Update pidfile unit test to cover new use-case
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-07 12:59:02 +01:00
Joachim Nilsson
729cc5307f
pidfile: Add support for absolute path
...
The OpenBSD version of pidfile() makes sure to place all PID files in
the same, canonical, location: _PATH_VARRUN. On Linux, however, some
disitributions prefer to place PID files in a sub-directory under the
canonical location: _PATH_VARRUN + __progname/ ...
This patch adds support for creating PID files in any location. If the
PID file name argument starts with a '/', the function assumes the rest
of the string is the full PATH to the PID file.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-07 12:55:26 +01:00
Joachim Nilsson
66290d132f
pidfile: Re-create file on consequetive calls if it doesn't exist
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-07 08:15:49 +01:00
Joachim Nilsson
59f7a78441
pidfile: Always initialize global variables
...
Always initialize global variables, even though they cannot be used in
current code paths without being initialized at runtime.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-07 08:15:42 +01:00
Joachim Nilsson
b716776863
tests/pidfile: Cleanup test files from /tmp
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-07 06:53:21 +01:00
Joachim Nilsson
018ecaca15
debian/source/format: Change to native mode to allow building from GIT
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2017-01-07 04:10:21 +01:00
Joachim Nilsson
a293c37777
debian/: Support for building .deb packages
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-11-29 08:32:06 +01:00
Joachim Nilsson
a4937a93e2
Add reminder about umask()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-10-02 12:13:43 +02:00
Joachim Nilsson
94d547c9ec
Unit test: fix search path for library header
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-05 00:19:52 +02:00
Joachim Nilsson
68cf8b6576
Update ChangeLog and bump version for v1.8.2 release
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-05 00:13:03 +02:00
Joachim Nilsson
b6a55fcc46
Add err.h include to tests
...
lite.h no longer includes err.h it has to be included in each test.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-05 00:07:24 +02:00
Joachim Nilsson
5f29ef6413
Convert touch() et al to inline functions
...
The touch(), makedir(), makefifo(), and erase() macros print warnings to
stderr, which mess up the logging in Finit. This patch refactors these
macros into inline functions and in the process removes the warn() use.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-09-04 23:58:32 +02:00
Joachim Nilsson
627c47caff
Bump version for v1.8.2 devel
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-08-22 01:33:12 +02:00
Joachim Nilsson
7c2ed556b9
Replace \e GNUism w/ ISO \033 for escape sequences
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-08-22 01:31:49 +02:00
Joachim Nilsson
6dec4e3858
Extend lfile test with fstab parser
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-08-02 00:29:52 +02:00
Joachim Nilsson
dff92356b3
Remove sys/cdefs.h include, does not exist in musl libc
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-07-19 15:39:57 +02:00
Joachim Nilsson
883c90112d
Update modification date
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-07-04 12:46:44 +02:00
Joachim Nilsson
a2c8dddaad
Free pidfile_path atexit()
...
To prevent warnings from tools like Valgrind, or handle issues
with RAM leaks on non-MMU systems like uClinux, we must free
the memory allocated by pidfile().
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-07-04 12:42:22 +02:00
Joachim Nilsson
14f547b638
Add ldconfig to build instructions, thanks rooth!
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-30 18:53:59 +02:00
Joachim Nilsson
6f2a03bba7
Update ChangeLog & bump version for v1.8.1 release
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-25 12:50:21 +02:00
Joachim Nilsson
cdfffa312b
Update ChangeLog for upcoming v1.8.1 fix release
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-08 07:18:30 +02:00
Joachim Nilsson
50cb72018f
pidfile: Portability fix, utimensat() in sys/time.h
...
For building libite on NetBSD, and probably other BSD's as well.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-08 06:25:02 +02:00
Joachim Nilsson
e8a3117158
fparseln: Portability fix _DIAGASSERT()
...
Only define _DIAGASSERT() if it's not already defined.
For building libite on NetBSD.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-08 06:23:34 +02:00
Joachim Nilsson
7cf2a3786c
Bump version and ABI for v1.8.0 release
...
- Change from v1.7.1 to v1.8.0 due to amount of changes
including ABI bump
- Update ChangeLog
- Bump library ABI version due to change in API semantics
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-06 19:05:26 +02:00
Joachim Nilsson
1c1d5c94e3
Clarify ABI versioning and encourage more unit tests
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-06 19:00:14 +02:00
Joachim Nilsson
23703c75da
tests/dir.c: Remove nested checker function
...
Move nested check function is_startup_config() outside main().
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-06 18:15:47 +02:00
Joachim Nilsson
efae15416c
Bump version to -rc1, many changes since last release
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-06 18:11:03 +02:00
Joachim Nilsson
661b4b4d0b
Remove last remnants of old build/unit test framework
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-06 18:09:59 +02:00
Joachim Nilsson
682b662bd5
Add unit test for chomp()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-06 18:09:29 +02:00
Joachim Nilsson
75d4edb424
check.h: Add stdlib.h for exit()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-06 18:08:54 +02:00
Joachim Nilsson
141d4f6936
Add unit test for copyfile()/fcopyfile()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-06 17:59:52 +02:00
Joachim Nilsson
63aa6c5d07
Add unit test for dir()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-06 17:56:13 +02:00
Joachim Nilsson
1d698418c7
dir(): Do not assert(), return -1 and errno
...
The dir() function, although useless compared to glob(), called assert()
and perror() instead of returning an error code.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-06 17:56:13 +02:00
Joachim Nilsson
92d81280a9
Add unit test for fexist()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-06 17:45:19 +02:00
Joachim Nilsson
267465f3d2
Add unit test for fisdir()
...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com >
2016-06-06 17:42:31 +02:00