return !_error->PendingError();
}
-
+ /*}}}*/
// Score - We compute a 'score' for a path /*{{{*/
// ---------------------------------------------------------------------
/* Paths are scored based on how close they come to what I consider
return Res;
}
-
/*}}}*/
// DropBinaryArch - Dump dirs with a string like /binary-<foo>/ /*{{{*/
// ---------------------------------------------------------------------
return true;
}
-
-
+ /*}}}*/
// DropRepeats - Drop repeated files resulting from symlinks /*{{{*/
// ---------------------------------------------------------------------
/* Here we go and stat every file that we found and strip dup inodes. */
List[J] = string();
}
}
-
+ delete[] Inodes;
+
// Wipe erased entries
for (unsigned int I = 0; I < List.size();)
{
return true;
}
/*}}}*/
-
// ReduceSourceList - Takes the path list and reduces it /*{{{*/
// ---------------------------------------------------------------------
/* This takes the list of source list expressed entires and collects
return true;
}
-
-
-bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log)
+ /*}}}*/
+bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log) /*{{{*/
{
stringstream msg;
return true;
}
-
-
-bool pkgCdrom::Add(pkgCdromStatus *log)
+ /*}}}*/
+bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/
{
stringstream msg;
}
}
-
-
// Unmount and finish
if (_config->FindB("APT::CDROM::NoMount",false) == false) {
log->Update(_("Unmounting CD-ROM...\n"), STEP_LAST);
return true;
}
-
-
-pkgUdevCdromDevices::pkgUdevCdromDevices()
- : libudev_handle(NULL)
+ /*}}}*/
+pkgUdevCdromDevices::pkgUdevCdromDevices() /*{{{*/
+ : libudev_handle(NULL)
{
}
+ /*}}}*/
bool
-pkgUdevCdromDevices::Dlopen()
+pkgUdevCdromDevices::Dlopen() /*{{{*/
{
+ // alread open
+ if(libudev_handle != NULL)
+ return true;
+
// see if we can get libudev
void *h = ::dlopen("libudev.so.0", RTLD_LAZY);
if(h == NULL)
return true;
}
-
+ /*}}}*/
vector<CdromDevice>
-pkgUdevCdromDevices::Scan()
+pkgUdevCdromDevices::Scan() /*{{{*/
{
vector<CdromDevice> cdrom_devices;
struct udev_enumerate *enumerate;
cdrom.DeviceName = string(devnode);
if (mountpath) {
cdrom.MountPath = mountpath;
- cdrom.Mounted = true;
+ string s = string(mountpath);
+ cdrom.Mounted = IsMounted(s);
} else {
cdrom.Mounted = false;
cdrom.MountPath = "";
}
return cdrom_devices;
}
+ /*}}}*/
-
-pkgUdevCdromDevices::~pkgUdevCdromDevices()
+pkgUdevCdromDevices::~pkgUdevCdromDevices() /*{{{*/
{
- dlclose(libudev_handle);
+ if (libudev_handle != NULL)
+ dlclose(libudev_handle);
}
+ /*}}}*/