#1138788 shellcheck module seems to cache patches somewhere and tries to reapply them

#1138788#5
Date:
2026-06-03 19:43:57 UTC
From:
To:
Hi,

this morning I decided to try debcraft improve on my aide package. While
it was running, I got preempted and ended up resetting my git repository
to the state before debcraft improve was run.

In the afternoon, I came back to debcraft and aide and now the shell
check part of debcraft errors out since it wants to apply a patch that
was applied previously (which cannot be the case since I git reset
the repo). Anyway, the run stalls with:

Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
2 out of 2 hunks ignored -- saving rejects to file debian/bin/buildcache.rej
DEBCRAFT ERROR: Unresolvable issues found - please read the output above carefully

The script is fine though, shellchecck debian/bin/buildcache doesn't
show anything, buildcache.rej is empty, and the diff to
debian/bin/buildcache is tiny any makes sense:
diff --git a/debian/bin/buildcache b/debian/bin/buildcache
index 5d8912e5..4131240c 100755
--- a/debian/bin/buildcache
+++ b/debian/bin/buildcache
@@ -32,9 +32,9 @@ set -C
 # TODO: parse DIR from configuration file
 DIR="/var/lib/aide"
 AIDEUSER="_aide"
-mkdir -p "$DIR"
-TEMPFILE=$(mktemp "$DIR/tmp.XXXXXX")
-CACHEFILE="$DIR/10_aide_rootrules_cache"
+mkdir -p "${DIR}"
+TEMPFILE=$(mktemp "${DIR}/tmp.XXXXXX")
+CACHEFILE="${DIR}/10_aide_rootrules_cache"

 NOW="$(date --iso-8601=seconds)"
 SCRIPT="/etc/aide/aide.conf.d/10_aide_lvm_needsroot"

Now, what is going wrong here?

Deleting the debcraft podman containers and ~/.cache/debcraft don't
change that. I am attaching the shell log of the debcraft improve run.
Am I holding it wrong?

Greetings
Marc

#1138788#10
Date:
2026-06-04 03:51:36 UTC
From:
To:
I am running now `debcraft build aide` to see if I can reproduce this
myself and investigate what is going on.

#1138788#15
Date:
2026-06-04 12:32:42 UTC
From:
To:
Try the wip/lintian branch.

Greetings
Marc

#1138788#20
Date:
2026-06-04 13:55:31 UTC
From:
To:
Running `debcraft build` on neither the main nor the wip/lintian
branch produced any errors for me.

The branch wip/lintian has no patches?

aide wip/lintian ± find debian/patches
find: ‘debian/patches’: No such file or directory

To have a chance to seeing some patching issues the package should
have some patches I think?

#1138788#25
Date:
2026-06-04 13:58:58 UTC
From:
To:
Debcraft did a lot of shellcheck changes and than tried to repeat them
on the script that had those changes already applied. See the log of the
debcraft run I sent.

I am not talking about debian/patches kind of patches, just the ones
that debcraft did (they were all right, but applying them once is
enough).

Greetings
Marc