View Single Post
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#643
Originally Posted by Stskeeps View Post
One possibility is to instead of deleting the files, truncating them instead to 0 bytes - feel like hacking up docpurge to do that?
I seem to remember suggesting this in #mer a long while back

But anyway:

Code:
#! /bin/sh

# Copyright (C) 2006 Nokia Corporation. 
# 
# Contact: Marius Vollmer <marius.vollmer@nokia.com>
# 
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License 
# version 2 as published by the Free Software Foundation. 
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
 
# Real hackers don't read docs.
#
PURGE="/usr/share/doc/ /usr/share/man/ /usr/share/info/"

#the below is a lot faster than the for loop below but it prints **** to stdout
#find $PURGE ! -type d -exec dd if=/dev/zero of='{}' bs=1b count=0 \;

for f in `find $PURGE ! -type d `; do
  rm -rf $f
  touch $f
done

for d in $PURGE; do
  echo "Purged by docpurge" >$d/README
done

Last edited by qwerty12; 2009-04-30 at 17:58.
 

The Following User Says Thank You to qwerty12 For This Useful Post: