[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#188867: marked as done (cdtool: patch adds cdclose as companion to cdeject)



Your message dated Thu, 18 Mar 2004 22:17:04 -0500
with message-id <E1B4AVM-0000eG-00@newraff.debian.org>
and subject line Bug#188867: fixed in cdtool 2.1.5-7
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 13 Apr 2003 16:56:03 +0000
>From uzs33d@uni-bonn.de Sun Apr 13 11:56:01 2003
Return-path: <uzs33d@uni-bonn.de>
Received: from mail.stw-bonn.de [131.220.99.37] 
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 194klo-0003PU-00; Sun, 13 Apr 2003 11:55:56 -0500
Received: from localhost (localhost [127.0.0.1])
	by mail.stw-bonn.de (Postfix) with ESMTP id 0D10661A65
	for <submit@bugs.debian.org>; Sun, 13 Apr 2003 18:55:24 +0200 (CEST)
Received: from uni-bonn.de (port-192-168-82-198.dhcp.stw-bonn.de [192.168.82.198])
	by mail.stw-bonn.de (Postfix) with ESMTP id 3A9D260E78
	for <submit@bugs.debian.org>; Sun, 13 Apr 2003 16:55:23 +0000 (/etc/localtime)
Message-ID: <3E99967B.5060001@uni-bonn.de>
Date: Sun, 13 Apr 2003 18:55:23 +0200
From: Josh Buhl <uzs33d@uni-bonn.de>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030327 Debian/1.3-4
X-Accept-Language: en
MIME-Version: 1.0
To: submit@bugs.debian.org
Subject: cdtool: patch adds cdclose as companion to cdeject
Content-Type: multipart/mixed;
 boundary="------------090207060404070409010301"
X-Virus-Scanned: by AMaViS
Delivered-To: submit@bugs.debian.org
X-Spam-Status: No, hits=-2.4 required=4.0
	tests=HAS_PACKAGE,PATCH_UNIFIED_DIFF,SPAM_PHRASE_00_01,
	      USER_AGENT,USER_AGENT_MOZILLA_UA,X_ACCEPT_LANG
	version=2.44
X-Spam-Level: 

This is a multi-part message in MIME format.
--------------090207060404070409010301
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Package: cdtool
Version: 2.1.5-4.1
Severity: Wishlist
Tags: patch

here's a small patch for cdtool which adds the cdclose command as a
logical companion to the cdeject command.

I've included two patches: one is against the original cdtool 2.1.5 
source and the other is against the debian source of cdtool 2.1.5, 
debian version 2.1.5-4.1.

Upstream said they'll apply the patch whenever they release another 
version, but that might not be for a long time. Upstream did post the 
patch on their website.

I hope that the debian maintainer will consider applying the patch, so 
long upstream doesn't get around to rereleasing (if they ever do.)


Thanks for providing cdtool.


Josh Buhl


-- 
'When you wake up in the morning, Pooh,' said Piglet at last,
'what's the first thing you say to yourself?'

'What's for breakfast?' said Pooh.  'What do you say, Piglet?'

'I say, "I wonder what's going to happen exciting today?"' said Piglet.

Pooh nodded thoughtfully.  'It's the same thing,' he said.

	-- A.A. Milne

-----------------------------------------------------
http://www.nyfairuse.org/

WTO + WIPO = DMCA http://www.anti-dmca.org

Innovation vs Patent Inflation http://swpat.ffii.org/

120000 voices and 400 Firms against logic patents
http://www.noepatents.org/
-----------------------------------------------------


--------------090207060404070409010301
Content-Type: text/plain;
 name="cdtool_close_debian.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="cdtool_close_debian.diff"

diff -u -r cdtool-2.1.5-debian-orig/Makefile cdtool-2.1.5-debian-close/Makefile
--- cdtool-2.1.5-debian-orig/Makefile	Sat Feb 22 12:05:48 2003
+++ cdtool-2.1.5-debian-close/Makefile	Sat Feb 22 12:09:20 2003
@@ -59,7 +59,7 @@
 # Note, the cdp package includes a program, /usr/bin/cdplay which
 # would interfere with the usage here.
 #
-LINKS = cdplay cdpause cdstop cdeject cdir cdinfo cdreset cdvolume cdshuffle
+LINKS = cdplay cdpause cdstop cdclose cdeject cdir cdinfo cdreset cdvolume cdshuffle
 #LINKS = cdstart cdpause cdstop cdeject cdir cdinfo cdreset cdshuffle
 
 # We seem to need GCC
@@ -126,7 +126,7 @@
 cdadd: cdadd.sh
 	sed s,@BINDIR@,$(REALBINDIR),g < $< > $@
 	chmod a+x $@
-	
+
 links:
 	@for i in $(LINKS); do \
 	    if test -L $$i; then true; else rm -f $$i; ln -s cdtool $$i; fi; \
diff -u -r cdtool-2.1.5-debian-orig/README cdtool-2.1.5-debian-close/README
--- cdtool-2.1.5-debian-orig/README	Thu Jul 16 04:07:48 1998
+++ cdtool-2.1.5-debian-close/README	Sat Feb 22 13:14:20 2003
@@ -135,6 +135,9 @@
 Change 14 was by Byron Ellacott.  Addition of a PID file and additonal
 cleanup by Lin Zhe Min.
 
+CHANGES SINCE 2.1.5 RELEASE ----------------------------------------------
+(1) Add cdclose command to close the CDROM tray. 
+    Added by Josh Buhl (jbuhl@gmx.net)
 
 CHANGES SINCE BETA RELEASE ---------------------------------------------
 
Only in cdtool-2.1.5-debian-close/: build
Only in cdtool-2.1.5-debian-orig/: cdadd
diff -u -r cdtool-2.1.5-debian-orig/cdctrl.1 cdtool-2.1.5-debian-close/cdctrl.1
--- cdtool-2.1.5-debian-orig/cdctrl.1	Mon Jun 22 19:07:26 1998
+++ cdtool-2.1.5-debian-close/cdctrl.1	Mon Feb 24 11:37:52 2003
@@ -55,6 +55,8 @@
 Resume playing.
 .IP \fBe\fR
 Eject CDROM.
+.IP \fBc\fR
+Close CDROM tray.
 .IP \fBi\fR
 Display info string.
 .IP \fBd\fR
diff -u -r cdtool-2.1.5-debian-orig/cdctrl.c cdtool-2.1.5-debian-close/cdctrl.c
--- cdtool-2.1.5-debian-orig/cdctrl.c	Sat Feb 22 12:05:48 2003
+++ cdtool-2.1.5-debian-close/cdctrl.c	Sat Feb 22 11:39:27 2003
@@ -129,6 +129,8 @@
     DoCr(docr);
     printf ("e    eject");
     DoCr(docr);
+    printf ("c    close");
+    DoCr(docr);
     printf ("i    info");
     DoCr(docr);
     printf ("d    dir");
@@ -233,6 +235,12 @@
 	    do_eject(progname, cdfile, FALSE);
 	    sleep (3);
 	    pszCmd = "eject";
+	    break;
+
+	case 'c':
+	    do_close(progname, cdfile, FALSE);
+	    sleep (3);
+	    pszCmd = "close";
 	    break;
 	  
 	case 'i':
diff -u -r cdtool-2.1.5-debian-orig/cdtool-2.1.5-1.spec cdtool-2.1.5-debian-close/cdtool-2.1.5-1.spec
--- cdtool-2.1.5-debian-orig/cdtool-2.1.5-1.spec	Thu Jul 16 15:57:57 1998
+++ cdtool-2.1.5-debian-close/cdtool-2.1.5-1.spec	Mon Feb 24 11:40:29 2003
@@ -8,10 +8,11 @@
 %description
 A package of command-line utilities to play and
 catalog audio CD-ROMs.  This package includes 
-cdstart, cdpause, cdstop, cdeject, and cdshuffle.
-Also, cdctrl may be used as a CD-ROM control daemon.
-Cdown allows querying of the cddb database to build a 
-local database of discs usable by cdinfo, etc.
+cdstart, cdpause, cdstop, cdeject, cdclose, and
+cdshuffle. Also, cdctrl may be used as a CD-ROM
+control daemon. Cdown allows querying of the cddb
+database to build a local database of discs usable
+by cdinfo, etc.
 
 %prep
 
@@ -23,7 +24,7 @@
 %install
 BINDIR=/usr/local/bin
 MANDIR=/usr/local/man
-LINKS="cdstart cdpause cdstop cdeject cdir cdinfo cdreset cdshuffle"
+LINKS="cdstart cdpause cdstop cdeject cdclose cdir cdinfo cdreset cdshuffle"
 
 install -d     $BINDIR -o root -m 0755
 install cdctrl $BINDIR -s -o root
@@ -51,6 +52,7 @@
 
 /usr/local/bin/cdtool
 /usr/local/bin/cdeject
+/usr/local/bin/cdclose
 /usr/local/bin/cdinfo
 /usr/local/bin/cdir
 /usr/local/bin/cdpause
@@ -64,6 +66,7 @@
 /usr/local/bin/cdloop
 /usr/local/man/man1/cdtool.1
 /usr/local/man/man1/cdeject.1
+/usr/local/man/man1/cdclose.1
 /usr/local/man/man1/cdinfo.1
 /usr/local/man/man1/cdir.1
 /usr/local/man/man1/cdpause.1
diff -u -r cdtool-2.1.5-debian-orig/cdtool-2.1.5.lsm cdtool-2.1.5-debian-close/cdtool-2.1.5.lsm
--- cdtool-2.1.5-debian-orig/cdtool-2.1.5.lsm	Tue Jul 14 14:46:50 1998
+++ cdtool-2.1.5-debian-close/cdtool-2.1.5.lsm	Mon Feb 24 11:41:06 2003
@@ -4,7 +4,7 @@
 Entered-date:   16JUL98
 Description:    A package of command-line utilities to play and
                 catalog audio CD-ROMs.  cdplay, cdpause, cdstop, 
-                and cdeject do what they say.  cdir lists the 
+                cdeject and cdclose do what they say.  cdir lists the 
                 tracks and their lengths, and will reference a 
 	        database of cd names, artists, and track names.  
                 cdinfo gives you various data on the disc like
diff -u -r cdtool-2.1.5-debian-orig/cdtool.1 cdtool-2.1.5-debian-close/cdtool.1
--- cdtool-2.1.5-debian-orig/cdtool.1	Sat Feb 22 12:05:48 2003
+++ cdtool-2.1.5-debian-close/cdtool.1	Mon Feb 24 11:47:29 2003
@@ -9,12 +9,13 @@
 .nf
 \fBcdadd\fR     [-[0..9]|-d device]
 \fBcdeject\fR   [-[0..9]|-d device]  [-V|-?|-h]
+\fBcdclose\fR   [-[0..9]|-d device]  [-V|-?|-h]
 \fBcdir\fR -n   [-[0..9]|-d device]  [-r|-s|-t|-V|-?|-h]
 \fBcdinfo\fR    [-[0..9]|-d device]  [-a|-r|-s|-t|-v|-V|-?|-h]
 \fBcdpause\fR   [-[0..9]|-d device]  [-V|-?|-h]
 \fBcdplay\fR    [-[0..9]|-d device]  [\fIstart\fR [\fIstop\fR]
 \fBcdplay\fR    [-[0..9]|-d device]  [\fI+|-\fR \fInumber\fR]
-\fBcdplay\fR    [-[0..9]|-d device]  [start|stop|resume|eject|info|dir] 
+\fBcdplay\fR    [-[0..9]|-d device]  [start|stop|resume|eject|close|info|dir] 
 \fBcdplay\fR    [-[0..9]|-d device]  [-V|-?|-h]
 \fBcdstop\fR    [-[0..9]|-d device]  [-V|-?|-h]
 \fBcdvolume\fR  [-[0..9]|-d device]  [-V|-?|-h|\fIlevel\fR]
@@ -34,6 +35,10 @@
 The 
 .I cdeject
 command ejects the current compact disc.
+.PP
+The 
+.I cdclose
+command closes the CDROM tray.
 .PP
 The
 .I cdir
diff -u -r cdtool-2.1.5-debian-orig/commands.c cdtool-2.1.5-debian-close/commands.c
--- cdtool-2.1.5-debian-orig/commands.c	Sat Feb 22 12:05:48 2003
+++ cdtool-2.1.5-debian-close/commands.c	Sat Feb 22 10:50:36 2003
@@ -310,6 +310,33 @@
 }
 
 /************************************************************************/
+/* Procedure:  do_close
+ * Purpose:    to close the CD-ROM 
+ * 
+ * Inputs:     program name, CD file des.
+ * Outputs:    to CD-ROM, debug output
+ * Returns:    n/a
+ * Notes:  
+ *   1.
+ */
+/************************************************************************/
+void do_close(char *progname, int cdfile, int iVerbose)
+{
+#ifdef DEBUG
+fprintf (stderr,"do_close:  called, name=%s, cdfile=%d,\n",
+	 progname, cdfile);
+#endif
+  if ( ioctl(cdfile, CDROMCLOSETRAY) == -1 ) 
+    {
+      fprintf(stderr, "%s: ioctl cdromclose\n", progname);
+      EXIT(1);
+    }
+
+    if (iVerbose == TRUE)
+	printf ("Closing CD-ROM tray\n");
+}
+
+/************************************************************************/
 /* Procedure:  do_reset
  * Purpose:    to reset the CD-ROM
  * 
diff -u -r cdtool-2.1.5-debian-orig/commands.h cdtool-2.1.5-debian-close/commands.h
--- cdtool-2.1.5-debian-orig/commands.h	Sat Feb 22 12:05:48 2003
+++ cdtool-2.1.5-debian-close/commands.h	Sat Feb 22 10:56:58 2003
@@ -29,6 +29,7 @@
 void do_pause(char *progname, int cdfile, int iVerbose);
 void do_stop(char *progname, int cdfile, int iCDNum, int iVerbose);
 void do_eject(char *progname, int cdfile, int iVerbose);
+void do_close(char *progname, int cdfile, int iVerbose);
 void do_reset(char *progname, int cdfile, int iVerbose);
 int  do_volume(char *progname, int cdfile, int volume, int iVerbose);
 /*
diff -u -r cdtool-2.1.5-debian-orig/main.c cdtool-2.1.5-debian-close/main.c
--- cdtool-2.1.5-debian-orig/main.c	Sat Feb 22 12:05:48 2003
+++ cdtool-2.1.5-debian-close/main.c	Mon Feb 24 11:07:16 2003
@@ -324,6 +324,15 @@
 	    close(cdfile);
 	    exit(0);
         }
+	if (strcmp(argv[optind],"close") == 0) {
+#ifdef DEBUG
+fprintf (stderr,"main:     called as \"%s\", close\n",
+	 progname);
+#endif
+            do_close(progname, cdfile, iVerbose);
+	    close(cdfile);
+	    exit(0);
+        }
 	if (strcmp(argv[optind],"info") == 0) {
 #ifdef DEBUG
 fprintf (stderr,"main:     called as \"%s\", info\n",
@@ -386,6 +395,8 @@
     do_stop(progname, cdfile, iCDNum, iVerbose);
   else if ( strcmp(progname, "cdeject") == 0 )
     do_eject(progname, cdfile, iVerbose);
+  else if ( strcmp(progname, "cdclose") == 0 )
+    do_close(progname, cdfile, iVerbose);
   else if ( strcmp(progname, "cdreset") == 0 )
     do_reset(progname, cdfile, iVerbose);
   else if ( strcmp(progname, "cdpause") == 0 )
@@ -446,6 +457,7 @@
     fprintf(stderr, " stop          stop playing\n");
     fprintf(stderr, " resume        resume playing\n");
     fprintf(stderr, " eject         eject CD-ROM\n");
+    fprintf(stderr, " close         close CD-ROM tray\n");
     fprintf(stderr, " info          display info\n");
     fprintf(stderr, " dir           display directory\n");
     fprintf(stderr, " shuffle       shuffle play\n");
@@ -464,6 +476,8 @@
     fprintf(stderr, "usage: cdstop  [options]\n");
   else if ( strcmp(progname, "cdeject") == 0 )
     fprintf(stderr, "usage: cdeject  [options]\n");
+  else if ( strcmp(progname, "cdclose") == 0 )
+    fprintf(stderr, "usage: cdclose  [options]\n");
   else if ( strcmp(progname, "cdvolume") == 0 ) 
       fprintf(stderr, "usage: cdvolume [0-255]\n");
   else if ( strcmp(progname, "cdpause") == 0 )
@@ -489,7 +503,7 @@
       fprintf(stderr, " -v            print status, track, absolute, relative\n");
     }
   else 
-    fprintf(stderr, "Please call as cdplay/cdstart, cdstop, cdeject, \n\
+    fprintf(stderr, "Please call as cdplay/cdstart, cdstop, cdeject, cdclose,\n\
 cdvolume, cdpause, cdir, cdinfo, or cdshuffle\n");
 
   /* standard options below here: */

--------------090207060404070409010301
Content-Type: text/plain;
 name="cdtool_close.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="cdtool_close.diff"

diff -u -r cdtool-2.1.5/Makefile cdtool-2.1.5-close/Makefile
--- cdtool-2.1.5/Makefile	Thu Jul 16 16:00:14 1998
+++ cdtool-2.1.5-close/Makefile	Sat Feb 22 13:27:06 2003
@@ -58,7 +58,7 @@
 # would interfere with the usage here.
 #
 #LINKS = cdplay cdpause cdstop cdeject cdir cdinfo cdreset
-LINKS = cdstart cdpause cdstop cdeject cdir cdinfo cdreset cdshuffle
+LINKS = cdstart cdpause cdstop cdclose cdeject cdir cdinfo cdreset cdshuffle
 
 # We seem to need GCC
 CC = gcc $(DEBUG_FLAGS)
@@ -124,7 +124,7 @@
 cdadd: cdadd.sh
 	sed s,@BINDIR@,$(BINDIR),g < $< > $@
 	chmod a+x $@
-	
+
 links:
 	@for i in $(LINKS); do \
 	    if test -L $$i; then true; else rm -f $$i; ln -s cdtool $$i; fi; \
diff -u -r cdtool-2.1.5/README cdtool-2.1.5-close/README
--- cdtool-2.1.5/README	Thu Jul 16 04:07:48 1998
+++ cdtool-2.1.5-close/README	Mon Feb 24 10:55:33 2003
@@ -15,6 +15,7 @@
     cdpause   -- pause play.
     cdstop    -- stop play.
     cdeject   -- eject the CDROM, if supported.
+    cdclose   -- close the CDROM tray, if supported.
     cdir      -- list tracks on the CDROM.
     cdinfo    -- display information on the CDROM.
     cdreset   -- reset the CDROM device (2.1 experimental).
@@ -134,6 +135,11 @@
 2.1.4-2.1.5 changes #7-11 by Daniel Risacher (magnus@mit.edu).
 Change 14 was by Byron Ellacott.  Addition of a PID file and additonal
 cleanup by Lin Zhe Min.
+
+
+CHANGES SINCE 2.1.5 RELEASE ----------------------------------------------
+(1) Add cdclose command to close the CDROM tray. 
+    Added by Josh Buhl (jbuhl@gmx.net)
 
 
 CHANGES SINCE BETA RELEASE ---------------------------------------------
Only in cdtool-2.1.5/: cdadd
diff -u -r cdtool-2.1.5/cdctrl.1 cdtool-2.1.5-close/cdctrl.1
--- cdtool-2.1.5/cdctrl.1	Mon Jun 22 19:07:26 1998
+++ cdtool-2.1.5-close/cdctrl.1	Mon Feb 24 11:36:16 2003
@@ -55,6 +55,8 @@
 Resume playing.
 .IP \fBe\fR
 Eject CDROM.
+.IP \fBc\fR
+Close CDROM tray.
 .IP \fBi\fR
 Display info string.
 .IP \fBd\fR
diff -u -r cdtool-2.1.5/cdctrl.c cdtool-2.1.5-close/cdctrl.c
--- cdtool-2.1.5/cdctrl.c	Thu Jul 16 04:00:08 1998
+++ cdtool-2.1.5-close/cdctrl.c	Mon Feb 24 10:56:53 2003
@@ -129,6 +129,8 @@
     DoCr(docr);
     printf ("e    eject");
     DoCr(docr);
+    printf ("c    close");
+    DoCr(docr);
     printf ("i    info");
     DoCr(docr);
     printf ("d    dir");
@@ -233,6 +235,12 @@
 	    do_eject(progname, cdfile, FALSE);
 	    sleep (3);
 	    pszCmd = "eject";
+	    break;
+	  
+	case 'c':
+	    do_close(progname, cdfile, FALSE);
+	    sleep (3);
+	    pszCmd = "close";
 	    break;
 	  
 	case 'i':
diff -u -r cdtool-2.1.5/cdtool-2.1.5-1.spec cdtool-2.1.5-close/cdtool-2.1.5-1.spec
--- cdtool-2.1.5/cdtool-2.1.5-1.spec	Thu Jul 16 15:57:57 1998
+++ cdtool-2.1.5-close/cdtool-2.1.5-1.spec	Mon Feb 24 11:33:02 2003
@@ -8,10 +8,11 @@
 %description
 A package of command-line utilities to play and
 catalog audio CD-ROMs.  This package includes 
-cdstart, cdpause, cdstop, cdeject, and cdshuffle.
-Also, cdctrl may be used as a CD-ROM control daemon.
-Cdown allows querying of the cddb database to build a 
-local database of discs usable by cdinfo, etc.
+cdstart, cdpause, cdstop, cdeject, cdclose, and
+cdshuffle. Also, cdctrl may be used as a CD-ROM
+control daemon. Cdown allows querying of the cddb
+database to build a local database of discs usable
+by cdinfo, etc.
 
 %prep
 
@@ -23,7 +24,7 @@
 %install
 BINDIR=/usr/local/bin
 MANDIR=/usr/local/man
-LINKS="cdstart cdpause cdstop cdeject cdir cdinfo cdreset cdshuffle"
+LINKS="cdstart cdpause cdstop cdeject cdclose cdir cdinfo cdreset cdshuffle"
 
 install -d     $BINDIR -o root -m 0755
 install cdctrl $BINDIR -s -o root
@@ -51,6 +52,7 @@
 
 /usr/local/bin/cdtool
 /usr/local/bin/cdeject
+/usr/local/bin/cdclose
 /usr/local/bin/cdinfo
 /usr/local/bin/cdir
 /usr/local/bin/cdpause
@@ -64,6 +66,7 @@
 /usr/local/bin/cdloop
 /usr/local/man/man1/cdtool.1
 /usr/local/man/man1/cdeject.1
+/usr/local/man/man1/cdclose.1
 /usr/local/man/man1/cdinfo.1
 /usr/local/man/man1/cdir.1
 /usr/local/man/man1/cdpause.1
diff -u -r cdtool-2.1.5/cdtool-2.1.5.lsm cdtool-2.1.5-close/cdtool-2.1.5.lsm
--- cdtool-2.1.5/cdtool-2.1.5.lsm	Tue Jul 14 14:46:50 1998
+++ cdtool-2.1.5-close/cdtool-2.1.5.lsm	Mon Feb 24 11:28:21 2003
@@ -4,7 +4,7 @@
 Entered-date:   16JUL98
 Description:    A package of command-line utilities to play and
                 catalog audio CD-ROMs.  cdplay, cdpause, cdstop, 
-                and cdeject do what they say.  cdir lists the 
+                cdeject and cdclose do what they say.  cdir lists the 
                 tracks and their lengths, and will reference a 
 	        database of cd names, artists, and track names.  
                 cdinfo gives you various data on the disc like
diff -u -r cdtool-2.1.5/cdtool.1 cdtool-2.1.5-close/cdtool.1
--- cdtool-2.1.5/cdtool.1	Tue Jul 14 14:48:46 1998
+++ cdtool-2.1.5-close/cdtool.1	Mon Feb 24 11:48:21 2003
@@ -9,12 +9,13 @@
 .nf
 \fBcdadd\fR     [-[0..9]|-d device]
 \fBcdeject\fR   [-[0..9]|-d device]  [-V|-?|-h]
+\fBcdclose\fR   [-[0..9]|-d device]  [-V|-?|-h]
 \fBcdir\fR -n   [-[0..9]|-d device]  [-r|-s|-t|-V|-?|-h]
 \fBcdinfo\fR    [-[0..9]|-d device]  [-a|-r|-s|-t|-v|-V|-?|-h]
 \fBcdpause\fR   [-[0..9]|-d device]  [-V|-?|-h]
 \fBcdplay\fR    [-[0..9]|-d device]  [\fIstart\fR [\fIstop\fR]
 \fBcdplay\fR    [-[0..9]|-d device]  [\fI+|-\fR \fInumber\fR]
-\fBcdplay\fR    [-[0..9]|-d device]  [start|stop|resume|eject|info|dir] 
+\fBcdplay\fR    [-[0..9]|-d device]  [start|stop|resume|eject|close|info|dir] 
 \fBcdplay\fR    [-[0..9]|-d device]  [-V|-?|-h]
 \fBcdstop\fR    [-[0..9]|-d device]  [-V|-?|-h]
 \fBcdshuffle\fR [-[0..9]|-d device]  [-V|-?|-h]
@@ -33,6 +34,10 @@
 The 
 .I cdeject
 command ejects the current compact disc.
+.PP
+The 
+.I cdclose
+command closes the CDROM tray.
 .PP
 The
 .I cdir
diff -u -r cdtool-2.1.5/commands.c cdtool-2.1.5-close/commands.c
--- cdtool-2.1.5/commands.c	Wed Jul 15 16:21:14 1998
+++ cdtool-2.1.5-close/commands.c	Mon Feb 24 11:16:39 2003
@@ -303,6 +303,33 @@
 }
 
 /************************************************************************/
+/* Procedure:  do_close
+ * Purpose:    to close the CD-ROM 
+ * 
+ * Inputs:     program name, CD file des.
+ * Outputs:    to CD-ROM, debug output
+ * Returns:    n/a
+ * Notes:  
+ *   1.
+ */
+/************************************************************************/
+void do_close(char *progname, int cdfile, int iVerbose)
+{
+#ifdef DEBUG
+fprintf (stderr,"do_close:  called, name=%s, cdfile=%d,\n",
+	 progname, cdfile);
+#endif
+  if ( ioctl(cdfile, CDROMCLOSETRAY) == -1 ) 
+    {
+      fprintf(stderr, "%s: ioctl cdromclose\n", progname);
+      EXIT(1);
+    }
+
+    if (iVerbose == TRUE)
+	printf ("Closing CD-ROM tray\n");
+}
+
+/************************************************************************/
 /* Procedure:  do_reset
  * Purpose:    to reset the CD-ROM
  * 
diff -u -r cdtool-2.1.5/commands.h cdtool-2.1.5-close/commands.h
--- cdtool-2.1.5/commands.h	Wed Jul 15 16:17:35 1998
+++ cdtool-2.1.5-close/commands.h	Mon Feb 24 10:58:32 2003
@@ -29,6 +29,7 @@
 void do_pause(char *progname, int cdfile, int iVerbose);
 void do_stop(char *progname, int cdfile, int iCDNum, int iVerbose);
 void do_eject(char *progname, int cdfile, int iVerbose);
+void do_close(char *progname, int cdfile, int iVerbose);
 void do_reset(char *progname, int cdfile, int iVerbose);
 /*
  * Copyright (C) 1997, 1998 Wade Hampton
diff -u -r cdtool-2.1.5/main.c cdtool-2.1.5-close/main.c
--- cdtool-2.1.5/main.c	Wed Jul 15 16:19:02 1998
+++ cdtool-2.1.5-close/main.c	Mon Feb 24 11:02:04 2003
@@ -323,6 +323,15 @@
 	    close(cdfile);
 	    exit(0);
         }
+	if (strcmp(argv[optind],"close") == 0) {
+#ifdef DEBUG
+fprintf (stderr,"main:     called as \"%s\", close\n",
+	 progname);
+#endif
+            do_close(progname, cdfile, iVerbose);
+	    close(cdfile);
+	    exit(0);
+        }
 	if (strcmp(argv[optind],"info") == 0) {
 #ifdef DEBUG
 fprintf (stderr,"main:     called as \"%s\", info\n",
@@ -375,6 +384,8 @@
     do_stop(progname, cdfile, iCDNum, iVerbose);
   else if ( strcmp(progname, "cdeject") == 0 )
     do_eject(progname, cdfile, iVerbose);
+  else if ( strcmp(progname, "cdclose") == 0 )
+    do_close(progname, cdfile, iVerbose);
   else if ( strcmp(progname, "cdreset") == 0 )
     do_reset(progname, cdfile, iVerbose);
   else if ( strcmp(progname, "cdpause") == 0 )
@@ -427,6 +438,7 @@
     fprintf(stderr, " stop          stop playing\n");
     fprintf(stderr, " resume        resume playing\n");
     fprintf(stderr, " eject         eject CD-ROM\n");
+    fprintf(stderr, " close         close CD-ROM tray\n");
     fprintf(stderr, " info          display info\n");
     fprintf(stderr, " dir           display directory\n");
     fprintf(stderr, " shuffle       shuffle play\n");
@@ -445,6 +457,8 @@
     fprintf(stderr, "usage: cdstop  [options]\n");
   else if ( strcmp(progname, "cdeject") == 0 )
     fprintf(stderr, "usage: cdeject  [options]\n");
+  else if ( strcmp(progname, "cdclose") == 0 )
+    fprintf(stderr, "usage: cdclose  [options]\n");
   else if ( strcmp(progname, "cdpause") == 0 )
     {
       fprintf(stderr, "usage: cdpause  [options]\n");
@@ -468,7 +482,7 @@
       fprintf(stderr, " -v            print status, track, absolute, relative\n");
     }
   else 
-    fprintf(stderr, "Please call as cdplay/cdstart, cdstop, cdeject, \n\
+    fprintf(stderr, "Please call as cdplay/cdstart, cdstop, cdeject, cdclose \n\
 cdpause, cdir, cdinfo, or cdshuffle\n");
 
   /* standard options below here: */

--------------090207060404070409010301--


---------------------------------------
Received: (at 188867-close) by bugs.debian.org; 19 Mar 2004 03:23:04 +0000
>From katie@ftp-master.debian.org Thu Mar 18 19:23:04 2004
Return-path: <katie@ftp-master.debian.org>
Received: from newraff.debian.org [208.185.25.31] (mail)
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1B4AbA-0006eV-00; Thu, 18 Mar 2004 19:23:04 -0800
Received: from katie by newraff.debian.org with local (Exim 3.35 1 (Debian))
	id 1B4AVM-0000eG-00; Thu, 18 Mar 2004 22:17:04 -0500
From: Max Vozeler <max@hinterhof.net>
To: 188867-close@bugs.debian.org
X-Katie: $Revision: 1.45 $
Subject: Bug#188867: fixed in cdtool 2.1.5-7
Message-Id: <E1B4AVM-0000eG-00@newraff.debian.org>
Sender: Archive Administrator <katie@ftp-master.debian.org>
Date: Thu, 18 Mar 2004 22:17:04 -0500
Delivered-To: 188867-close@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_12 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-5.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2004_03_12
X-Spam-Level: 

Source: cdtool
Source-Version: 2.1.5-7

We believe that the bug you reported is fixed in the latest version of
cdtool, which is due to be installed in the Debian FTP archive:

cdtool_2.1.5-7.diff.gz
  to pool/main/c/cdtool/cdtool_2.1.5-7.diff.gz
cdtool_2.1.5-7.dsc
  to pool/main/c/cdtool/cdtool_2.1.5-7.dsc
cdtool_2.1.5-7_powerpc.deb
  to pool/main/c/cdtool/cdtool_2.1.5-7_powerpc.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 188867@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Max Vozeler <max@hinterhof.net> (supplier of updated cdtool package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Thu, 11 Mar 2004 22:25:17 +0100
Source: cdtool
Binary: cdtool
Architecture: source powerpc
Version: 2.1.5-7
Distribution: unstable
Urgency: low
Maintainer: Max Vozeler <max@hinterhof.net>
Changed-By: Max Vozeler <max@hinterhof.net>
Description: 
 cdtool     - text-based audio CD player and CD-ROM control commands
Closes: 188867 198131
Changes: 
 cdtool (2.1.5-7) unstable; urgency=low
 .
   * New maintainer
   * Added utility 'cdclose' by Josh Buhl. (closes: #188867)
   * Converted the package to use po-debconf
     - Added Build-Depends on po-debconf
     - Added a translation into German
     - Made debian/rules merge translations using po2debconf
   * Reworded the package descriptions and debconf templates
   * Dont create the /dev/cdrom symlink on devfs systems
   * Respects the debconf seen flag now
   * Update debian/copyright
   * Remove commands.c.orig
   * Added -Wall to CFLAGS, which turned up a few bugs:
       shuffle.c:
         - Include string.h for strlen()
         - Fix use of uninitialized pointer when there is no CD inserted.
           (Closes: #198131)
       hardware.c:
         - Fix missing strerror in error fprintf arguments
         - Removed excess comma between format string literals
   * Updated French debconf translation by Christian Perrier.
Files: 
 5b9720f26e581d7a92bb64d69fa8595a 883 sound optional cdtool_2.1.5-7.dsc
 5885cfbab41bad46f5c093d4e28482a6 19389 sound optional cdtool_2.1.5-7.diff.gz
 681bbe24ba3e1c02ff6aead1aaa716d0 44510 sound optional cdtool_2.1.5-7_powerpc.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: http://decoy.wox.org/~bob/public.asc

iQEVAwUBQFpj2y6fnYH5E4SWAQKx6gf9GAjz/Wnf1HAf9saMQoTysf2tabf4uMkH
FKWQW/iYjrYDMdh5GXUU3qlmVHK742fTtTb4rfZ3/zjzj3iJ0qbIdfsO3V9tuq0J
aAO5F9jHzfOcW+IIYphLVvdkF93Oe6ColIHl4e8P+tlrkTY3QShcSNOjxLsbDlKp
baqP0yHAiGKSftBoUbhuyh8shWjVQlg83vd0BeZRTbPH8uRS8b211Cmym9+uWh70
GPhBX9pd7EfL8fPC46M5744F6/3HdvLDctPEjXzxpBs5k8SnNBxZMrwz+R+qd8u7
lyWcaHsJaXGCLWFLLjvhPEZk46Gmp5V+clBRhbNn4jjfRoHZt7ivEw==
=nxUr
-----END PGP SIGNATURE-----



Reply to: