[Usbmount-commit] r16 - in trunk: usbmount usbmount/debian www www/package

Martin Dickopp mdickopp-guest@costa.debian.org
Wed, 06 Apr 2005 22:16:46 +0000


Author: mdickopp-guest
Date: 2005-04-06 22:16:45 +0000 (Wed, 06 Apr 2005)
New Revision: 16

Added:
   trunk/usbmount/debian/dirs
   trunk/usbmount/debian/preinst
   trunk/www/package/usbmount_0.0.9.dsc
   trunk/www/package/usbmount_0.0.9.tar.gz
   trunk/www/package/usbmount_0.0.9_all.deb
   trunk/www/package/usbmount_0.0.9_amd64.changes
Removed:
   trunk/usbmount/debian/postinst
   trunk/www/package/usbmount_0.0.8.dsc
   trunk/www/package/usbmount_0.0.8.tar.gz
   trunk/www/package/usbmount_0.0.8_all.deb
   trunk/www/package/usbmount_0.0.8_amd64.changes
Modified:
   trunk/usbmount/debian/changelog
   trunk/usbmount/debian/prerm
   trunk/usbmount/usbmount
   trunk/www/index.html.in
   trunk/www/style.css
Log:
* When a device is removed, make sure that only the corresponding model
  symlink in /var/run/usbmount is removed.
* Include directory /var/run/usbmount in package instead of creating it
  in postinst.
* Move creation of mount points in /media from 'postinst configure' to
  'preinst install'. This ensures that the mount points are created if
  the package is removed (but not purged) and then reinstalled.
* New package (version 0.0.9).


Modified: trunk/usbmount/debian/changelog
===================================================================
--- trunk/usbmount/debian/changelog	2005-04-06 13:25:38 UTC (rev 15)
+++ trunk/usbmount/debian/changelog	2005-04-06 22:16:45 UTC (rev 16)
@@ -1,3 +1,16 @@
+usbmount (0.0.9) unstable; urgency=low
+
+  * Upload sponsored by Rafael Laboissiere.
+  * When a device is removed, make sure that only the corresponding model
+    symlink in /var/run/usbmount is removed (closes: #303376).
+  * Include directory /var/run/usbmount in package instead of creating it
+    in postinst (closes: #303434).
+  * Move creation of mount points in /media from 'postinst configure' to
+    'preinst install'. This ensures that the mount points are created if
+    the package is removed (but not purged) and then reinstalled.
+
+ -- Martin Dickopp <martin@zero-based.org>  Wed,  6 Apr 2005 23:54:53 +0200
+
 usbmount (0.0.8) unstable; urgency=low
 
   * Upload sponsored by Rafael Laboissiere (closes: #298526).

Added: trunk/usbmount/debian/dirs
===================================================================
--- trunk/usbmount/debian/dirs	2005-04-06 13:25:38 UTC (rev 15)
+++ trunk/usbmount/debian/dirs	2005-04-06 22:16:45 UTC (rev 16)
@@ -0,0 +1 @@
+var/run/usbmount

Deleted: trunk/usbmount/debian/postinst
===================================================================
--- trunk/usbmount/debian/postinst	2005-04-06 13:25:38 UTC (rev 15)
+++ trunk/usbmount/debian/postinst	2005-04-06 22:16:45 UTC (rev 16)
@@ -1,19 +0,0 @@
-#!/bin/sh
-set -e
-
-# If the package is configured for the first time, try to create the
-# default mountpoints and /var/run/usbmount. Failure to do so is not
-# considered fatal.
-if test "$1" = configure && test "$2" = ""; then
-    mkdir /media 2> /dev/null || :
-    for i in 0 1 2 3 4 5 6 7; do
-	mkdir /media/usb$i 2> /dev/null || :
-    done
-    ln -s usb0 /media/usb 2> /dev/null || :
-
-    mkdir /var/run/usbmount 2> /dev/null || :
-fi
-
-#DEBHELPER#
-
-exit 0

Copied: trunk/usbmount/debian/preinst (from rev 15, trunk/usbmount/debian/postinst)
===================================================================
--- trunk/usbmount/debian/postinst	2005-04-06 13:25:38 UTC (rev 15)
+++ trunk/usbmount/debian/preinst	2005-04-06 22:16:45 UTC (rev 16)
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -e
+
+# Actions to perform if the package is installed.
+if test "$1" = install; then
+    # Try to create the default mountpoints.  Failure to do so is not
+    # considered fatal.
+    mkdir /media 2> /dev/null || :
+    for i in 0 1 2 3 4 5 6 7; do
+	mkdir /media/usb$i 2> /dev/null || :
+    done
+    ln -s usb0 /media/usb 2> /dev/null || :
+fi
+
+#DEBHELPER#
+
+exit 0

Modified: trunk/usbmount/debian/prerm
===================================================================
--- trunk/usbmount/debian/prerm	2005-04-06 13:25:38 UTC (rev 15)
+++ trunk/usbmount/debian/prerm	2005-04-06 22:16:45 UTC (rev 16)
@@ -1,15 +1,17 @@
 #!/bin/sh
 set -e
 
-# If the package is removed, try to remove the default mountpoints and
-# /var/run/usbmount. Failure to do so is not considered fatal.
+# Actions to perform if the package is removed.
 if test "$1" = remove; then
+    # Try to remove the default mountpoints.  Failure to do so is not
+    # considered fatal.
     rm -f /media/usb 2> /dev/null || :
     for i in 0 1 2 3 4 5 6 7; do
 	rmdir /media/usb$i 2> /dev/null || :
     done
 
-    rm -fr /var/run/usbmount 2> /dev/null || :
+    # Remove contents of /var/run/usbmount.
+    rm -f /var/run/usbmount/*
 fi
 
 #DEBHELPER#

Modified: trunk/usbmount/usbmount
===================================================================
--- trunk/usbmount/usbmount	2005-04-06 13:25:38 UTC (rev 15)
+++ trunk/usbmount/usbmount	2005-04-06 22:16:45 UTC (rev 16)
@@ -69,10 +69,11 @@
 	    # types to mount.
 	    if in_list "$fstype" "$FILESYSTEMS"; then
 		# Acquire lock.
-		log debug "trying to acquire lock"
+		log debug "trying to acquire lock /var/run/usbmount/.mount.lock"
 		lockfile-create --retry 3 /var/run/usbmount/.mount || \
 		    { log error "cannot acquire lock /var/run/usbmount/.mount.lock"; exit 1; }
 		trap '( lockfile-remove /var/run/usbmount/.mount )' 0
+		log debug "acquired lock /var/run/usbmount/.mount.lock"
 
 		# Search an available mountpoint.
 		for v in $MOUNTPOINTS; do
@@ -131,7 +132,6 @@
 
     # A block or partition device has been removed.
     # Test if it is mounted.
-    have_unmounted=no
     while read device mountpoint fstype remainder; do
 	if test "$DEVNAME" = "$device"; then
 	    # If the mountpoint and filesystem type are maintained by
@@ -140,32 +140,19 @@
 		&& in_list "$fstype" "$FILESYSTEMS"; then
 		log info "executing command: umount -l $mountpoint"
 		umount -l "$mountpoint"
-		have_unmounted=yes
+
+		# If a model symlink exists for this device, remove it.
+		ls /var/run/usbmount | while read model; do
+		    if test "`readlink /var/run/usbmount/$model || :`" = "$mountpoint"; then
+			log info "removing /var/run/usbmount/$model"
+			rm -f "/var/run/usbmount/$model"
+		    fi
+		done
 	    fi
 	    break
 	fi
     done < /proc/mounts
 
-    # If a device has been unmounted, clean /var/run/usbmount.
-    if test $have_unmounted = yes && test -d /var/run/usbmount; then
-	ls /var/run/usbmount | while read model; do
-	    mounted=no
-	    while read device mountpoint remainder; do
-		if test "`readlink $model`" = "$mountpoint"; then
-		    mounted=yes
-		    break
-		fi
-	    done < /proc/mounts
-
-	    # If a symlink pointes to a directory which is not mounted,
-	    # remove it.
-	    if test $mounted = no; then
-		log info "removing /var/run/usbmount/$model"
-		rm -f "/var/run/usbmount/$model"
-	    fi
-	done
-    fi
-
 fi
 
 exit 0

Modified: trunk/www/index.html.in
===================================================================
--- trunk/www/index.html.in	2005-04-06 13:25:38 UTC (rev 15)
+++ trunk/www/index.html.in	2005-04-06 22:16:45 UTC (rev 16)
@@ -62,18 +62,18 @@
     <ul>
       <li>Source:
       <ul>
-        <li><a href="package/usbmount_0.0.8.dsc">usbmount_0.0.8.dsc</a></li>
-        <li><a href="package/usbmount_0.0.8.tar.gz">usbmount_0.0.8.tar.gz</a></li>
+        <li><a href="package/usbmount_0.0.9.dsc">usbmount_0.0.9.dsc</a></li>
+        <li><a href="package/usbmount_0.0.9.tar.gz">usbmount_0.0.9.tar.gz</a></li>
       </ul></li>
 
       <li>Binary:
       <ul>
-        <li><a href="package/usbmount_0.0.8_all.deb">usbmount_0.0.8_all.deb</a></li>
+        <li><a href="package/usbmount_0.0.9_all.deb">usbmount_0.0.9_all.deb</a></li>
       </ul></li>
 
       <li>Changes:
       <ul>
-        <li><a href="package/usbmount_0.0.8_amd64.changes">usbmount_0.0.8_amd64.changes</a></li>
+        <li><a href="package/usbmount_0.0.9_amd64.changes">usbmount_0.0.9_amd64.changes</a></li>
       </ul></li>
     </ul>
 
@@ -89,8 +89,20 @@
     <h2><a name="history" class="invlink">History</a></h2>
 
     <ul>
-      <li>Version 0.0.8 (03-Apr-2005, latest release):
+      <li>Version 0.0.9 (06-Apr-2005, latest release):
       <ul>
+         <li>When a device is removed, only the corresponding model symlink in
+	 <span class="filename">/var/run/usbmount</span> is removed.</li>
+	 <li>The directory <span class="filename">/var/run/usbmount</span> is no longer created by the
+	 <span class="filename">postinst</span> script; it is now included in the package.</li>
+	 <li>The creation of the mount points in <span class="filename">/media</span> has been moved
+	 from <span class="command">postinst configure</span> to <span class="command">preinst install</span>.
+	 This ensures that the mount points are created if the package is removed (but not purged) and then
+	 reinstalled.</li>
+      </ul></li>
+
+      <li>Version 0.0.8 (03-Apr-2005):
+      <ul>
         <li>Filesystem type specific mount options can be specified.</li>
 	<li>Locking is used to serialize concurrent mount attempts. This ensures that different mount points
 	are chosen if a device contains more than one mountable partition.</li>

Deleted: trunk/www/package/usbmount_0.0.8.dsc
===================================================================
--- trunk/www/package/usbmount_0.0.8.dsc	2005-04-06 13:25:38 UTC (rev 15)
+++ trunk/www/package/usbmount_0.0.8.dsc	2005-04-06 22:16:45 UTC (rev 16)
@@ -1,11 +0,0 @@
-Format: 1.0
-Source: usbmount
-Version: 0.0.8
-Binary: usbmount
-Maintainer: Martin Dickopp <martin@zero-based.org>
-Architecture: all
-Standards-Version: 3.6.1
-Build-Depends-Indep: cdbs, debhelper (>= 4.1.0)
-Uploaders: Rafael Laboissiere <rafael@debian.org>
-Files: 
- 2c36b063367e8a36efe092f194f356ed 5551 usbmount_0.0.8.tar.gz

Deleted: trunk/www/package/usbmount_0.0.8.tar.gz
===================================================================
(Binary files differ)

Deleted: trunk/www/package/usbmount_0.0.8_all.deb
===================================================================
(Binary files differ)

Deleted: trunk/www/package/usbmount_0.0.8_amd64.changes
===================================================================
--- trunk/www/package/usbmount_0.0.8_amd64.changes	2005-04-06 13:25:38 UTC (rev 15)
+++ trunk/www/package/usbmount_0.0.8_amd64.changes	2005-04-06 22:16:45 UTC (rev 16)
@@ -1,27 +0,0 @@
-Format: 1.7
-Date: Sun,  3 Apr 2005 23:40:25 +0200
-Source: usbmount
-Binary: usbmount
-Architecture: source all
-Version: 0.0.8
-Distribution: unstable
-Urgency: low
-Maintainer: Martin Dickopp <martin@zero-based.org>
-Changed-By: Martin Dickopp <martin@zero-based.org>
-Description: 
- usbmount   - automatically mount and unmount USB mass storage devices
-Closes: 298526
-Changes: 
- usbmount (0.0.8) unstable; urgency=low
- .
-   * Upload sponsored by Rafael Laboissiere (closes: #298526).
-   * Filesystem type specific mount options can be specified.
-   * Use locking to serialize concurrent mount attempts. This ensures that
-     different mount points are chosen if a device contains more than one
-     mountable partition.
-   * Make sure that /var/run/usbmount is removed on package removal.
-   * More detailed package description and README file.
-Files: 
- f35dfc30ee7e2543f20b43d76dffcecd 322 admin extra usbmount_0.0.8.dsc
- 2c36b063367e8a36efe092f194f356ed 5551 admin extra usbmount_0.0.8.tar.gz
- 6bac36a27d296d7148a1c166f6c608b3 7132 admin extra usbmount_0.0.8_all.deb

Added: trunk/www/package/usbmount_0.0.9.dsc
===================================================================
--- trunk/www/package/usbmount_0.0.9.dsc	2005-04-06 13:25:38 UTC (rev 15)
+++ trunk/www/package/usbmount_0.0.9.dsc	2005-04-06 22:16:45 UTC (rev 16)
@@ -0,0 +1,11 @@
+Format: 1.0
+Source: usbmount
+Version: 0.0.9
+Binary: usbmount
+Maintainer: Martin Dickopp <martin@zero-based.org>
+Architecture: all
+Standards-Version: 3.6.1
+Build-Depends-Indep: cdbs, debhelper (>= 4.1.0)
+Uploaders: Rafael Laboissiere <rafael@debian.org>
+Files: 
+ b58b3248d565eee53a0ebf20aa4706b6 5631 usbmount_0.0.9.tar.gz

Added: trunk/www/package/usbmount_0.0.9.tar.gz
===================================================================
(Binary files differ)


Property changes on: trunk/www/package/usbmount_0.0.9.tar.gz
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www/package/usbmount_0.0.9_all.deb
===================================================================
(Binary files differ)


Property changes on: trunk/www/package/usbmount_0.0.9_all.deb
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/www/package/usbmount_0.0.9_amd64.changes
===================================================================
--- trunk/www/package/usbmount_0.0.9_amd64.changes	2005-04-06 13:25:38 UTC (rev 15)
+++ trunk/www/package/usbmount_0.0.9_amd64.changes	2005-04-06 22:16:45 UTC (rev 16)
@@ -0,0 +1,28 @@
+Format: 1.7
+Date: Wed,  6 Apr 2005 23:54:53 +0200
+Source: usbmount
+Binary: usbmount
+Architecture: source all
+Version: 0.0.9
+Distribution: unstable
+Urgency: low
+Maintainer: Martin Dickopp <martin@zero-based.org>
+Changed-By: Martin Dickopp <martin@zero-based.org>
+Description: 
+ usbmount   - automatically mount and unmount USB mass storage devices
+Closes: 303376 303434
+Changes: 
+ usbmount (0.0.9) unstable; urgency=low
+ .
+   * Upload sponsored by Rafael Laboissiere.
+   * When a device is removed, make sure that only the corresponding model
+     symlink in /var/run/usbmount is removed (closes: #303376).
+   * Include directory /var/run/usbmount in package instead of creating it
+     in postinst (closes: #303434).
+   * Move creation of mount points in /media from 'postinst configure' to
+     'preinst install'. This ensures that the mount points are created if
+     the package is removed (but not purged) and then reinstalled.
+Files: 
+ 35502513c53872b79654bf43c6867cdd 322 admin extra usbmount_0.0.9.dsc
+ b58b3248d565eee53a0ebf20aa4706b6 5631 admin extra usbmount_0.0.9.tar.gz
+ 6980f17a517366ff7597a9d0123079f5 7242 admin extra usbmount_0.0.9_all.deb

Modified: trunk/www/style.css
===================================================================
--- trunk/www/style.css	2005-04-06 13:25:38 UTC (rev 15)
+++ trunk/www/style.css	2005-04-06 22:16:45 UTC (rev 16)
@@ -84,6 +84,12 @@
         padding-left:   2em;
 }
 
+span.command {
+        font-family:    monospace;
+        font-style:     normal;
+        font-weight:    normal;
+}
+
 span.filename {
 	font-family:	monospace;
 	font-style:	normal;