Skip to content

Commit

Permalink
added debian_list_pkg_changed_and_added_files.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
br-cpvc committed Aug 3, 2023
1 parent e0835cf commit fc3c34b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions debian_list_pkg_changed_and_added_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -ex

echo "NOTE: should be executed with super user privs, e.g. using sudo"

# from: https://superuser.com/questions/676075/get-a-diff-of-my-current-linux-configuration-to-a-default-configuration-across
#debsums -ca

# from: https://askubuntu.com/questions/318483/list-files-not-originating-from-packages

##find / -xdev -type f | sort >/tmp/root.files
#find / -xdev -type f -path /home -prune -o -path /var -prune -o -print | sort >/tmp/root.files
#sort /var/lib/dpkg/info/*.list >/tmp/installed.files
#comm -23 /tmp/root.files /tmp/installed.files
{ \
find "${PREFIX-}/" -xdev -type f && \
echo "" && \
cat -- "${PREFIX}"/var/lib/dpkg/info/*.list; \
} | awk '
done { --seen[$0]; }
/^$/ { done = 1; }
!done { files[++n] = $0; ++seen[$0]; }
END { for (i = 1; i <= n; ++i) { if (seen[files[i]] > 0) { print(files[i]); } } }
' && debsums --admindir="${PREFIX-}"/var/lib/dpkg -a -c 2> /dev/null

0 comments on commit fc3c34b

Please sign in to comment.