From 068636516ff7e7686159de478eff7b4e1036f5dc Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 18 Dec 2009 11:30:22 +0100 Subject: * debian/apt.logrotate: - add to logratation * doc/examples/configure-index: - add as example --- doc/examples/configure-index | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/examples') diff --git a/doc/examples/configure-index b/doc/examples/configure-index index f5f996460..eaea6511c 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -307,6 +307,7 @@ Dir "/" // Location of the logfile Log "var/log/apt" { Terminal "term.log"; + History "history.log"; }; }; -- cgit v1.2.3-70-g09d2 From ff1e4b0626d8ce567492ccadbd30dfc32d4c15f1 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 26 Jan 2010 11:27:58 +0100 Subject: add new "Acquire::cdrom::AutoDetect" variable that enables/disables the dlopen of libudev for automatic cdrom detection --- debian/changelog | 2 ++ doc/examples/configure-index | 4 ++++ methods/cdrom.cc | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'doc/examples') diff --git a/debian/changelog b/debian/changelog index b499d7298..7e38cda99 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,8 @@ apt (0.7.25.1) UNRELEASED; urgency=low the umount again * methods/cdrom.cc: - fixes in multi cdrom setup code + - add new "Acquire::cdrom::AutoDetect" variable that enables/disables + the dlopen of libudev for automatic cdrom detection -- Michael Vogt Fri, 18 Dec 2009 16:54:18 +0100 diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 1e9946e1b..317acddf6 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -250,6 +250,10 @@ Acquire cdrom { + // do auto detection of the cdrom mountpoint + AutoDetect "true"; + + // cdrom mountpoint (needs to be defined in fstab if AutoDetect is not used) mount "/cdrom"; // You need the trailing slash! diff --git a/methods/cdrom.cc b/methods/cdrom.cc index 763547013..87794b052 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -218,6 +218,7 @@ bool CDROMMethod::Fetch(FetchItem *Itm) return true; } + bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect", true); CDROM = _config->FindDir("Acquire::cdrom::mount","/cdrom/"); if (Debug) clog << "Looking for CDROM at " << CDROM << endl; @@ -228,7 +229,7 @@ bool CDROMMethod::Fetch(FetchItem *Itm) string NewID; while (CurrentID.empty() == true) { - if (CDROM == "apt-udev-auto/") + if (AutoDetect) AutoDetectAndMount(Get, NewID); if(!IsMounted(CDROM)) -- cgit v1.2.3-70-g09d2 From ffee221b8d1df28768d30762d72a11289ae747dc Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 26 Jan 2010 21:08:41 +0100 Subject: add Dir::Media::MountPath config option --- apt-pkg/init.cc | 3 ++- cmdline/apt-cdrom.cc | 6 +++--- doc/examples/configure-index | 7 +++++++ methods/cdrom.cc | 4 ++-- 4 files changed, 14 insertions(+), 6 deletions(-) (limited to 'doc/examples') diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 2544b8025..6310aff11 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -65,11 +65,12 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.Set("Dir::Etc::vendorlist","vendors.list"); Cnf.Set("Dir::Etc::vendorparts","vendors.list.d"); Cnf.Set("Dir::Etc::main","apt.conf"); - Cnf.Set("Dir::ETc::netrc", "auth.conf"); + Cnf.Set("Dir::Etc::netrc", "auth.conf"); Cnf.Set("Dir::Etc::parts","apt.conf.d"); Cnf.Set("Dir::Etc::preferences","preferences"); Cnf.Set("Dir::Etc::preferencesparts","preferences.d"); Cnf.Set("Dir::Bin::methods","/usr/lib/apt/methods"); + Cnf.Set("Dir::Media::MountPath","/media/apt"); // State Cnf.Set("Dir::Log","var/log/apt"); diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc index 494a7d8df..988a58f20 100644 --- a/cmdline/apt-cdrom.cc +++ b/cmdline/apt-cdrom.cc @@ -120,11 +120,11 @@ bool AutoDetectCdrom(pkgUdevCdromDevices &UdevCdroms, unsigned int &i) _config->Set("Acquire::cdrom::mount", v[i].MountPath); _config->Set("APT::CDROM::NoMount", true); } else { - const char* AptMountPoint = "/media/apt"; + string AptMountPoint = _config->FindDir("Dir::Media::MountPath"); if (!FileExists(AptMountPoint)) - mkdir(AptMountPoint, 0750); + mkdir(AptMountPoint.c_str(), 0750); if(MountCdrom(AptMountPoint, v[i].DeviceName) == false) - _error->Warning(_("Failed to mount '%s' to '%s'"), v[i].DeviceName.c_str(), AptMountPoint); + _error->Warning(_("Failed to mount '%s' to '%s'"), v[i].DeviceName.c_str(), AptMountPoint.c_str()); _config->Set("Acquire::cdrom::mount", AptMountPoint); _config->Set("APT::CDROM::NoMount", true); } diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 317acddf6..0b0025fca 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -331,6 +331,13 @@ Dir "/" Terminal "term.log"; History "history.log"; }; + + // Media + Media + { + // Media AutoDetect mount path + MountPath "/media/apt"; + }; }; // Things that effect the APT dselect method diff --git a/methods/cdrom.cc b/methods/cdrom.cc index c8ec322ee..4bbc01c2c 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -116,9 +116,9 @@ bool CDROMMethod::AutoDetectAndMount(URI Get, string &NewID) return false; // check if we have the mount point - const char* AptMountPoint = "/media/apt"; + string AptMountPoint = _config->FindDir("Dir::Media::MountPath"); if (!FileExists(AptMountPoint)) - mkdir(AptMountPoint, 0750); + mkdir(AptMountPoint.c_str(), 0750); // now try mounting for (unsigned int i=0; i < v.size(); i++) -- cgit v1.2.3-70-g09d2