summaryrefslogtreecommitdiff
path: root/aptdpkgro.sh
diff options
context:
space:
mode:
Diffstat (limited to 'aptdpkgro.sh')
-rwxr-xr-xaptdpkgro.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/aptdpkgro.sh b/aptdpkgro.sh
new file mode 100755
index 0000000..71dc44d
--- /dev/null
+++ b/aptdpkgro.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+pathmatch="^/usr"
+
+while read debname; do
+ pkg=$(dpkg --info $debname | sed -n 's/^ Package: *//p' | head -1)
+ (dpkg -L "$pkg" 2>/dev/null || true) | grep "$pathmatch" |
+ while read file; do
+ [ -f "$file" -a ! -L "$file" ] || continue
+ dir=`dirname "$file"`;
+ base=`basename "$file"`;
+ inode=`find "$file" -printf "%i\n"`
+ (cd "$dir" && ln "$base" ".${base}.dpkg-ro-used.$inode")
+ echo "$dir/.${base}.dpkg-ro-used.$inode"
+ done >>/var/lib/my_ro_hack.todel
+done