summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/cdromutl.cc13
-rw-r--r--apt-pkg/contrib/cdromutl.h3
2 files changed, 12 insertions, 4 deletions
diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc
index b6524a178..0cf9697ac 100644
--- a/apt-pkg/contrib/cdromutl.cc
+++ b/apt-pkg/contrib/cdromutl.cc
@@ -98,7 +98,7 @@ bool UnmountCdrom(string Path)
// MountCdrom - Mount a cdrom /*{{{*/
// ---------------------------------------------------------------------
/* We fork mount and drop all messages */
-bool MountCdrom(string Path)
+bool MountCdrom(string Path, string DeviceName)
{
if (IsMounted(Path) == true)
return true;
@@ -122,8 +122,15 @@ bool MountCdrom(string Path)
{
const char *Args[10];
Args[0] = "mount";
- Args[1] = Path.c_str();
- Args[2] = 0;
+ if (DeviceName == "")
+ {
+ Args[1] = Path.c_str();
+ Args[2] = 0;
+ } else {
+ Args[1] = DeviceName.c_str();
+ Args[2] = Path.c_str();
+ Args[3] = 0;
+ }
execvp(Args[0],(char **)Args);
_exit(100);
}
diff --git a/apt-pkg/contrib/cdromutl.h b/apt-pkg/contrib/cdromutl.h
index f24bb8c70..9d14249c5 100644
--- a/apt-pkg/contrib/cdromutl.h
+++ b/apt-pkg/contrib/cdromutl.h
@@ -14,7 +14,8 @@
using std::string;
-bool MountCdrom(string Path);
+// mount cdrom, DeviceName (e.g. /dev/sr0) is optional
+bool MountCdrom(string Path, string DeviceName="");
bool UnmountCdrom(string Path);
bool IdentCdrom(string CD,string &Res,unsigned int Version = 2);
bool IsMounted(string &Path);