hal/tools Makefile.am, 1.27, 1.28 hal-system-storage-cleanup-mountpoints, NONE, 1.1

Kay Sievers kay at freedesktop.org
Wed Dec 21 08:07:42 PST 2005


Update of /cvs/hal/hal/tools
In directory gabe:/tmp/cvs-serv14894/tools

Modified Files:
	Makefile.am 
Added Files:
	hal-system-storage-cleanup-mountpoints 
Log Message:
2005-12-21  Kay Sievers  <kay.sievers at vrfy.org>

        Move callout one level up.

        * tools/Makefile.am:
        * tools/callouts/hal-system-storage-cleanup-mountpoints:
        * tools/hal-system-storage-cleanup-mountpoints:


Index: Makefile.am
===================================================================
RCS file: /cvs/hal/hal/tools/Makefile.am,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- Makefile.am	20 Dec 2005 19:19:12 -0000	1.27
+++ Makefile.am	21 Dec 2005 16:07:40 -0000	1.28
@@ -57,7 +57,7 @@
 	hal-system-storage-mount		\
 	hal-system-storage-unmount		\
 	hal-system-storage-eject		\
-	callouts/hal-system-storage-cleanup-mountpoints
+	hal-system-storage-cleanup-mountpoints
 
 EXTRA_DIST=$(man_MANS) $(MAN_IN_FILES) gen-libgphoto-hal-fdi $(script_SCRIPTS)
 

--- NEW FILE: hal-system-storage-cleanup-mountpoints ---
#!/bin/sh

# Copyright (C) 2005, Kay Sievers <kay.sievers at vrfy.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2.

MOUNT_ROOT="/media"

for DIR in $MOUNT_ROOT/*; do
    # check if we created it
    if [ ! -e $DIR/.created-by-hal ]; then
	continue
    fi

    # don't touch mounted volumes
    BUSY=
    while read dev dir type options; do
	if [ "$dir" = "$DIR" ]; then
	    BUSY=1
	    break
	fi
    done < /proc/mounts
    if [ "$BUSY" = "1" ]; then
	continue
    fi

    rm -f $DIR/.created-by-hal
    rmdir --ignore-fail-on-non-empty "$DIR"
done

exit 0




More information about the hal-commit mailing list