Deprecate the use of the CD_DRIVE, CDPLAY, DISC and MUSIC_CD environment
variables in favour of CDROM. Discussed on: stable@FreeBSD.org
This commit is contained in:
parent
ffefd50ada
commit
bb44f0089b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=71122
@ -20,14 +20,7 @@ as
|
||||
or
|
||||
.Pa mcd0 .
|
||||
.Pp
|
||||
If the device not specified, the environment variables
|
||||
.Ev MUSIC_CD ,
|
||||
.Ev CD_DRIVE ,
|
||||
.Ev DISC
|
||||
and
|
||||
.Ev CDPLAY
|
||||
will be used (in this order) to find the cd device.
|
||||
.Pp
|
||||
|
||||
If no command is given, then
|
||||
.Nm
|
||||
enters an interactive mode, reading commands from the standard input.
|
||||
@ -157,6 +150,9 @@ The following environment variables affect the execution of
|
||||
The cd device to use if one isn't specified with the
|
||||
.Fl f
|
||||
flag.
|
||||
.It Ev CD_DRIVE Ev CDPLAY Ev DISC Ev MUSIC_CD
|
||||
These variables have been deprecated in favour of
|
||||
.Ev CDROM .
|
||||
.El
|
||||
.Sh FILES
|
||||
.Bl -tag -width /dev/mcd0c -compact
|
||||
|
@ -159,18 +159,30 @@ void usage ()
|
||||
exit (1);
|
||||
}
|
||||
|
||||
char *use_cdrom_instead(char *old_envvar)
|
||||
{
|
||||
char *device;
|
||||
|
||||
device = getenv(old_envvar);
|
||||
if (device)
|
||||
warnx("%s environment variable deprecated, "
|
||||
"please use CDROM in the future.", old_envvar);
|
||||
return device;
|
||||
}
|
||||
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
int cmd;
|
||||
char *arg;
|
||||
|
||||
cdname = getenv ("MUSIC_CD");
|
||||
cdname = use_cdrom_instead("MUSIC_CD");
|
||||
if (! cdname)
|
||||
cdname = getenv ("CD_DRIVE");
|
||||
cdname = use_cdrom_instead("CD_DRIVE");
|
||||
if (! cdname)
|
||||
cdname = getenv ("DISC");
|
||||
cdname = use_cdrom_instead("DISC");
|
||||
if (! cdname)
|
||||
cdname = getenv ("CDPLAY");
|
||||
cdname = use_cdrom_instead("CDPLAY");
|
||||
|
||||
for (;;) {
|
||||
switch (getopt (argc, argv, "svhf:")) {
|
||||
|
Loading…
Reference in New Issue
Block a user