Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ updates:
day: "monday"
time: "09:00"
timezone: "Asia/Jakarta"
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "ci"
reviewers:
Expand Down
43 changes: 43 additions & 0 deletions tdocfix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/data/data/com.termux/files/usr/bin/bash
# -- Authors: Jean-Luc NAIL & Gemini
# -- Version: 1.01
# -- Description: Automatic and strict cleanup of orphan dpkg/apt locks

# 1. Security check: is there any active process?
ACTIVE_PROCS=$(ps aux | grep -E "apt|dpkg" | grep -v -E "grep|docfix.sh" | wc -l)

if [ "$ACTIVE_PROCS" -gt 0 ]; then
echo "[-] Error: An apt or dpkg process is currently running."
echo " Please wait or terminate the task cleanly."
exit 1
fi

echo "[+] No active process detected. Cleaning up residual locks..."

# 2. List of potential lock files
LOCKS=(
"$PREFIX/var/lib/dpkg/lock"
"$PREFIX/var/lib/dpkg/lock-frontend"
"$PREFIX/var/cache/apt/archives/lock"
)

DELETED_COUNT=0

for LOCK_FILE in "${LOCKS[@]}"; do
if [ -f "$LOCK_FILE" ]; then
rm "$LOCK_FILE" && echo " [✔] Removed: $(basename "$LOCK_FILE")"
((DELETED_COUNT++))
fi
done

if [ "$DELETED_COUNT" -eq 0 ]; then
echo "[~] No orphan lock files found. The system is already clean."
else
echo "[+] $DELETED_COUNT lock(s) cleaned up."
# Give the system a brief moment to release descriptors
sleep 0.5
fi

# 3. Final validation with tdoc
echo "[+] Validating global status:"
tdoc doctor --json | grep -E "dpkglock|broken"