summaryrefslogtreecommitdiff
path: root/aptdpkgro.sh
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2001-12-12 19:52:40 +0000
committerJonas Smedegaard <dr@jones.dk>2001-12-12 19:52:40 +0000
commitc81b7f986867db292d62a1757123723b5ef66518 (patch)
treea217cf2f481ab7b3099ef76b519a4cc8e1786096 /aptdpkgro.sh
Initial revision
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