Skip to content

Commit

Permalink
fix corruption of /var/lib/dpkg/status on update if held package is n…
Browse files Browse the repository at this point in the history
…ot installed
  • Loading branch information
dimkr committed Oct 7, 2023
1 parent f89e9f6 commit c2e3386
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion woof-code/rootfs-skeleton/sbin/bdrv-update
Expand Up @@ -27,8 +27,10 @@ done < /initrd/pup_b/var/lib/dpkg/status
if [ -f "$NF" ]; then
NEWVERSION=`grep ^Version: "$NF" | awk -F ": " '{print $2}'`
# take the package information from bdrv if it's a newer version
if [ -n "$NEWVERSION" ]; then
if [ -n "$VERSION" -a -n "$NEWVERSION" ]; then
vercmp "$NEWVERSION" gt "$VERSION" && cat "$NF" || cat $F
elif [ -n "$VERSION" -a -z "$NEWVERSION" ]; then
cat $F
else
cat "$NF"
fi
Expand Down

0 comments on commit c2e3386

Please sign in to comment.