todo/doneetckeeperhttp://etckeeper.branchable.com/todo/done/etckeeperikiwiki2023-01-16T15:43:57ZConsistent tempfile creationhttp://etckeeper.branchable.com/todo/Consistent_tempfile_creation/2023-01-16T15:43:57Z2023-01-07T17:52:10Z
<p>Currently etckeeper has two different mechanisms for creating temporary files. There's no clear reason for that, and it caught me out when I was trying to update some of the scripts for my own purposes.</p>
<p>I don't particularly mind how this is resolved, but I'd like it resolved in some consistent fashion! I've made two patches for two different resolutions:</p>
<ul>
<li><a href="https://github.com/me-and/etckeeper/commit/96d4da2314ad64147835554371d04372cb4a4612">Allow either <code>mktemp</code> or <code>tempfile</code> everywhere</a> (best for backwards compatibility, as it'll keep working for folk who don't have <code>mktemp</code>)</li>
<li><a href="https://github.com/me-and/etckeeper/commit/3fb703588997590fec4776fb91e3b119ab3f75f9">Consistently assume <code>mktemp</code> is available</a> (best for simplicity)</li>
</ul>
<blockquote><p>Thanks, I've applied the first patch. It looks like all the code that
assumed mktemp was available only ran when using darcs, so there are
presumably systems where mktemp is not available that the second patch
would break. <span class="selflink">done</span> --<span class="createlink"><a href="http://etckeeper.branchable.com/ikiwiki.cgi?do=create&from=todo%2FConsistent_tempfile_creation&page=Joey" rel="nofollow">?</a>Joey</span></p></blockquote>
Skip running pre-commit hook inside linked worktreeshttp://etckeeper.branchable.com/todo/Skip_running_pre-commit_hook_inside_linked_worktrees/2022-11-30T17:27:49Z2022-11-27T22:05:10Z
<p>Adding a git <a href="https://git-scm.com/docs/git-worktree">worktree</a> is a great way to being able to change the version history without changing all the other files under <code>/etc</code> to some arbitrary old version while doing interactive rebases etc. With a worktree you can do all the work there and then merge in the final result in a clean operation in <code>/etc</code> later on.</p>
<p>This could be done by cloning the repository and add it as a remote instead, but that is more cumbersome.</p>
<p>However the pre-commit hook messes things up when it is being run inside the linked worktree as well. It really should only run in the main worktree.</p>
<p>Could you please merge the <a href="https://github.com/hlovdal/etkeeper/compare/master...worktree">worktree</a> branch which contains one commit that adds a check to avoid running the pre-commit hook in linked worktrees?</p>
<blockquote><p>Good patch, <span class="selflink">done</span>! --<span class="createlink"><a href="http://etckeeper.branchable.com/ikiwiki.cgi?do=create&from=todo%2FSkip_running_pre-commit_hook_inside_linked_worktrees&page=Joey" rel="nofollow">?</a>Joey</span></p></blockquote>
regex in 20-warn-problem-fileshttp://etckeeper.branchable.com/todo/regex_in_20-warn-problem-files/2022-05-18T16:51:19Z2016-12-19T19:14:48Z
<pre><code>exclude_internal () {
grep -E -v '(^|/)(.git|.hg|.bzr|_darcs)/'
}
</code></pre>
<p>should probably escape the <code>.</code>s.</p>
<pre><code>exclude_internal () {
grep -E -v '(^|/)(\.git|\.hg|\.bzr|_darcs)/'
}
</code></pre>
<blockquote><p><span class="selflink">fixed</span> --<span class="createlink"><a href="http://etckeeper.branchable.com/ikiwiki.cgi?do=create&from=todo%2Fregex_in_20-warn-problem-files&page=Joey" rel="nofollow">?</a>Joey</span></p></blockquote>
LANG issue with grep in store-metadatahttp://etckeeper.branchable.com/todo/LANG_issue_with_grep_in_store-metadata/2022-01-07T15:14:16Z2021-12-31T13:46:03Z
<p>Two users report issues (<a href="https://bugzilla.redhat.com/show_bug.cgi?id=1979456">here</a>, <a href="https://bugzilla.redhat.com/show_bug.cgi?id=2036327">here</a>) with <code>pre-commit.d/30store-metadata</code> resp. <code>commit.d/20store-metadata</code>:</p>
<p>In a German locale, <code>etckeeper commit 'daily autocommit'</code> creates messages like this:</p>
<pre><code>grep: (Standardeingabe): Übereinstimmungen in Binärdatei
</code></pre>
<p>coming from the <code>grep</code> in line 25. It can be fixed by either setting
<code>LC_CTYPE=C</code> (maybe generally, in that file), or by adding <code>-a</code> to the <code>grep</code> call.</p>
<blockquote><p><span class="selflink">done</span> --<span class="createlink"><a href="http://etckeeper.branchable.com/ikiwiki.cgi?do=create&from=todo%2FLANG_issue_with_grep_in_store-metadata&page=Joey" rel="nofollow">?</a>Joey</span></p></blockquote>
updaiting error: etckeeper.noarch 0:1.18.7-2.el6http://etckeeper.branchable.com/todo/updaiting_error:_etckeeper.noarch_0:1.18.7-2.el6/2021-10-17T13:52:29Z2018-05-17T07:46:47Z
<p>I have installed version: 1.18.5
Trying to update: yum update from epel.</p>
<p>getting error:</p>
<p>Error: Package: etckeeper-1.18.7-2.el6.noarch (epel)
Requires: hostname</p>
<p>OS version: CentOS release 6.9 (Final)</p>
<blockquote><p><span class="selflink">notabug</span> --<span class="createlink"><a href="http://etckeeper.branchable.com/ikiwiki.cgi?do=create&from=todo%2Fupdaiting_error%3A_etckeeper.noarch_0%3A1.18.7-2.el6&page=Joey" rel="nofollow">?</a>Joey</span></p></blockquote>
unit tests with bats and fakeroothttp://etckeeper.branchable.com/todo/unit_tests_with_bats_and_fakeroot/2021-10-17T13:52:29Z2017-05-23T19:52:36Z
<p>Hi Joey,</p>
<p>Here are some more tests that uses fakeroot:
https://gitlab.com/HRio/etckeeper/commits/fakeroot</p>
<p>Can you please have a look?</p>
<p>Thanks,
Henrik</p>
<blockquote><p>merged <span class="selflink">done</span> --<span class="createlink"><a href="http://etckeeper.branchable.com/ikiwiki.cgi?do=create&from=todo%2Funit_tests_with_bats_and_fakeroot&page=Joey" rel="nofollow">?</a>Joey</span></p></blockquote>
vcs-commit hook is not POSIX-friendlyhttp://etckeeper.branchable.com/todo/vcs-commit_hook_is_not_POSIX-friendly/2021-10-17T13:52:29Z2019-12-18T19:41:34Z
<p><a href="https://bugs.debian.org/946055">Bug #946055</a> mentions that if <code>/bin/sh</code> is not bash, it will fail (specifically with mksh):</p>
<blockquote><pre><code>/etc/etckeeper/commit.d/50vcs-commit[22]: ${@#-m}: bad substitution
</code></pre>
<p>This is because doing trim operations on an array are not implemented
in mksh, and unspecified in POSIX:</p>
<p>[…] If parameter is '#', '*', or '@', the result of the expansion is unspecified. […]</p>
<p>cf. <a href="https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02">https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02</a></p></blockquote>
<p>The bug suggests a patch that uses <code>sed</code> instead of that pattern substitution:</p>
<pre><code>--- a/commit.d/50vcs-commit
+++ b/commit.d/50vcs-commit
@@ -12,10 +12,9 @@ if [ -n "$1" ]; then
if [ "x$1" = "x--stdin" ]; then
cat > "$logfile"
else
- if [ "x$1" = "x-m" ]; then
- shift 1
- fi
- echo "${@#-m}" > "$logfile"
+ sed '1s/^-m \{0,1\}//' >"$logfile" <<-EOF
+ $*
+ EOF
fi
else
logfile=""
</code></pre>
<p>Thanks! -- <span class="createlink"><a href="http://etckeeper.branchable.com/ikiwiki.cgi?do=create&from=todo%2Fvcs-commit_hook_is_not_POSIX-friendly&page=anarcat" rel="nofollow">?</a>anarcat</span></p>
<blockquote><p><span class="selflink">done</span> --<span class="createlink"><a href="http://etckeeper.branchable.com/ikiwiki.cgi?do=create&from=todo%2Fvcs-commit_hook_is_not_POSIX-friendly&page=Joey" rel="nofollow">?</a>Joey</span></p></blockquote>
use getent(1) from glibc to retrieve user home #27http://etckeeper.branchable.com/todo/use_getent__40__1__41___from_glibc_to_retrieve_user_home___35__27/2021-10-17T13:52:29Z2015-06-01T08:29:16Z
<p>use getent(1) from glibc to retrieve user home #27</p>
<p>https://github.com/joeyh/etckeeper/pull/27</p>
<p>url for git am:
https://patch-diff.githubusercontent.com/raw/joeyh/etckeeper/pull/27.patch</p>
<blockquote><p>I had to guess at the motivation for this patch, which is never the best
position for a patch to leave its receiver in.</p>
<p>I guess that getent is a little faster than running perl to do the same
thing. And, getent seems to always be available, at least on debian.</p>
<p>So, applied, with some doubt. <span class="selflink">done</span> --<span class="createlink"><a href="http://etckeeper.branchable.com/ikiwiki.cgi?do=create&from=todo%2Fuse_getent__40__1__41___from_glibc_to_retrieve_user_home___35__27&page=Joey" rel="nofollow">?</a>Joey</span></p></blockquote>
unit tests with batshttp://etckeeper.branchable.com/todo/unit_tests_with_bats/2021-10-17T13:52:29Z2017-03-15T21:10:10Z
<p>Hi,</p>
<p>I have started to implement some basic unit test cases using bats for etckeeper.</p>
<p>During that work I found one small issue also fixed in the branch.</p>
<p>Could you please review: https://gitlab.com/HRio/etckeeper/commits/unit-test ?</p>
<p>Thanks,
Henrik</p>
<blockquote><p>merged the updated branch <span class="selflink">done</span> --<span class="createlink"><a href="http://etckeeper.branchable.com/ikiwiki.cgi?do=create&from=todo%2Funit_tests_with_bats&page=Joey" rel="nofollow">?</a>Joey</span></p></blockquote>
fixed typo in READMEhttp://etckeeper.branchable.com/todo/fixed_typo_in_README/2021-10-17T13:52:28Z2016-11-11T20:30:42Z
<p>fixed typo in README</p>
<p>https://github.com/Yky/etckeeper/commit/5f2556abbc404eb0d06b31f620fe655c8802d8e7</p>
<blockquote><p>applied <span class="selflink">done</span> --<span class="createlink"><a href="http://etckeeper.branchable.com/ikiwiki.cgi?do=create&from=todo%2Ffixed_typo_in_README&page=Joey" rel="nofollow">?</a>Joey</span></p></blockquote>