summaryrefslogtreecommitdiff
path: root/aptdpkgro.sh
blob: 47da72b395b31cbc78c1982b52d839f174bfc4ee (plain)
  1. #!/bin/sh
  2. pathmatch="^/usr"
  3. while read debname; do
  4. pkg=$(dpkg --info $debname | sed -n 's/^ Package: *//p' | head -1)
  5. (dpkg -L "$pkg" 2>/dev/null || true) | grep "$pathmatch" |
  6. while read file; do
  7. [ -f "$file" -a ! -L "$file" ] || continue
  8. dir=`dirname "$file"`;
  9. base=`basename "$file"`;
  10. inode=`find "$file" -printf "%i\n"`
  11. [ -L "$dir/.${base}.dpkg-ro-used.$inode" ] || continue
  12. (cd "$dir" && ln "$base" ".${base}.dpkg-ro-used.$inode")
  13. echo "$dir/.${base}.dpkg-ro-used.$inode"
  14. done >>/var/lib/my_ro_hack.todel
  15. done