From 85d7610aadf1be8e4d1bece0a5ad5d63ccd3089c Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 7 Mar 2002 16:22:51 +0000 Subject: Rename files and add/improve descriptive headers. --- aptdpkgro | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 aptdpkgro (limited to 'aptdpkgro') diff --git a/aptdpkgro b/aptdpkgro new file mode 100755 index 0000000..b574c88 --- /dev/null +++ b/aptdpkgro @@ -0,0 +1,43 @@ +#!/bin/sh +# +# /usr/local/sbin/aptdpkgro +# Put together and tweaked by Jonas Smedegaard +# 2001-2002 +# +# $Id: aptdpkgro,v 1.1 2002-03-07 16:22:51 jonas Exp $ +# +# Auto re-mounting of a readonly /usr +# Put the following in a file below /etc/apt/apt.conf.d: +# +# // Auto re-mounting of a readonly /usr +# // Based on mail from Anthony Towns +# // http://lists.debian.org/debian-devel/2001/debian-devel-200111/msg00212.html +# +# // This is the intended thing: +# // DPkg { +# // Pre-Invoke {"mount -o remount,rw /usr";}; +# // Post-Invoke {"mount -o remount,ro /usr";}; +# // }; +# +# DPkg { +# Pre-Install-Pkgs {"/usr/local/sbin/aptdpkgro";}; +# Pre-Invoke {"mount -o remount,rw /usr";}; +# Post-Invoke {"/usr/local/sbin/aptdpkgclean; mount -o remount,ro /usr";}; +# }; +# + +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"` + [ -L "$dir/.${base}.dpkg-ro-used.$inode" ] || continue + (cd "$dir" && ln "$base" ".${base}.dpkg-ro-used.$inode") + echo "$dir/.${base}.dpkg-ro-used.$inode" + done >>/var/lib/my_ro_hack.todel +done -- cgit v1.2.3