David Kalnischkies лет назад: 16
Родитель
Сommit
d328fd1a20
14 измененных файлов с 891 добавлено и 682 удалено
  1. 2 3
      apt-pkg/cdrom.cc
  2. 30 21
      apt-pkg/contrib/cdromutl.cc
  3. 2 1
      apt-pkg/init.cc
  4. 68 3
      cmdline/apt-cdrom.cc
  5. 7 2
      cmdline/apt-mark
  6. 41 8
      debian/changelog
  7. 11 0
      doc/examples/configure-index
  8. 43 58
      doc/po/fr.po
  9. 19 12
      ftparchive/writer.cc
  10. 0 2
      ftparchive/writer.h
  11. 17 17
      methods/cdrom.cc
  12. 207 175
      po/fr.po
  13. 226 196
      po/it.po
  14. 218 184
      po/sk.po

+ 2 - 3
apt-pkg/cdrom.cc

@@ -829,8 +829,6 @@ bool pkgCdrom::Add(pkgCdromStatus *log)					/*{{{*/
       }
    }
 
-   
-
    // Unmount and finish
    if (_config->FindB("APT::CDROM::NoMount",false) == false) {
       log->Update(_("Unmounting CD-ROM...\n"), STEP_LAST);
@@ -921,6 +919,7 @@ pkgUdevCdromDevices::Scan()                                             /*{{{*/
 
 pkgUdevCdromDevices::~pkgUdevCdromDevices()                             /*{{{*/
 { 
-   dlclose(libudev_handle);
+   if (libudev_handle != NULL)
+      dlclose(libudev_handle);
 }
 									/*}}}*/

+ 30 - 21
apt-pkg/contrib/cdromutl.cc

@@ -64,35 +64,44 @@ bool UnmountCdrom(string Path)
 {
    if (IsMounted(Path) == false)
       return true;
-   
-   int Child = ExecFork();
 
-   // The child
-   if (Child == 0)
+   for (int i=0;i<3;i++)
    {
-      // Make all the fds /dev/null
-      for (int I = 0; I != 3; I++)
-	 dup2(open("/dev/null",O_RDWR),I);
+   
+      int Child = ExecFork();
 
-      if (_config->Exists("Acquire::cdrom::"+Path+"::UMount") == true)
+      // The child
+      if (Child == 0)
       {
-	 if (system(_config->Find("Acquire::cdrom::"+Path+"::UMount").c_str()) != 0)
+	 // Make all the fds /dev/null
+	 for (int I = 0; I != 3; I++)
+	    dup2(open("/dev/null",O_RDWR),I);
+
+	 if (_config->Exists("Acquire::cdrom::"+Path+"::UMount") == true)
+	 {
+	    if (system(_config->Find("Acquire::cdrom::"+Path+"::UMount").c_str()) != 0)
+	       _exit(100);
+	    _exit(0);	 	 
+	 }
+	 else
+	 {
+	    const char *Args[10];
+	    Args[0] = "umount";
+	    Args[1] = Path.c_str();
+	    Args[2] = 0;
+	    execvp(Args[0],(char **)Args);      
 	    _exit(100);
-	 _exit(0);	 	 
+	 }      
       }
-      else
-      {
-	 const char *Args[10];
-	 Args[0] = "umount";
-	 Args[1] = Path.c_str();
-	 Args[2] = 0;
-	 execvp(Args[0],(char **)Args);      
-	 _exit(100);
-      }      
+
+      // if it can not be umounted, give it a bit more time
+      // this can happen when auto-mount magic or fs/cdrom prober attack
+      if (ExecWait(Child,"umount",true) == true)
+	 return true;
+      sleep(1);
    }
 
-   // Wait for mount
-   return ExecWait(Child,"umount",true);
+   return false;
 }
 									/*}}}*/
 // MountCdrom - Mount a cdrom						/*{{{*/

+ 2 - 1
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");

+ 68 - 3
cmdline/apt-cdrom.cc

@@ -98,6 +98,42 @@ OpProgress* pkgCdromTextStatus::GetOpProgress()
    return &Progress; 
 };
 									/*}}}*/
+// SetupAutoDetect       						/*{{{*/
+bool AutoDetectCdrom(pkgUdevCdromDevices &UdevCdroms, unsigned int &i)
+{
+   bool Debug =  _config->FindB("Debug::Acquire::cdrom", false);
+
+   vector<struct CdromDevice> v = UdevCdroms.Scan();
+   if (i >= v.size())
+      return false;
+
+   if (Debug)
+      clog << "Looking at devce " << i
+	   << " DeviveName: " << v[i].DeviceName 
+	   << " IsMounted: '" << v[i].Mounted << "'"
+	   << " MountPoint: '" << v[i].MountPath << "'"
+	   << endl;
+
+   if (v[i].Mounted)
+   {
+      // set the right options
+      _config->Set("Acquire::cdrom::mount", v[i].MountPath);
+      _config->Set("APT::CDROM::NoMount", true);
+   } else {
+      string AptMountPoint = _config->FindDir("Dir::Media::MountPath");
+      if (!FileExists(AptMountPoint))
+	 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.c_str());
+      _config->Set("Acquire::cdrom::mount", AptMountPoint);
+      _config->Set("APT::CDROM::NoMount", true);
+   }
+   i++;
+
+   return true;
+}
+									/*}}}*/
+
 // DoAdd - Add a new CDROM						/*{{{*/
 // ---------------------------------------------------------------------
 /* This does the main add bit.. We show some status and things. The
@@ -106,12 +142,25 @@ OpProgress* pkgCdromTextStatus::GetOpProgress()
    verify them. Then rewrite the database files */
 bool DoAdd(CommandLine &)
 {
-   bool res = false;
+   pkgUdevCdromDevices UdevCdroms;
    pkgCdromTextStatus log;
    pkgCdrom cdrom;
-   res = cdrom.Add(&log);
+   bool res = true;
+
+   bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect");
+   unsigned int count = 0;
+   
+   if (AutoDetect && UdevCdroms.Dlopen())
+   {
+      while (AutoDetectCdrom(UdevCdroms, count))
+	 res &= cdrom.Add(&log);
+   } else {
+      res = cdrom.Add(&log);
+   }
+
    if(res)
       cout << _("Repeat this process for the rest of the CDs in your set.") << endl;
+
    return res;
 }
 									/*}}}*/
@@ -120,10 +169,24 @@ bool DoAdd(CommandLine &)
 /* */
 bool DoIdent(CommandLine &)
 {
+   pkgUdevCdromDevices UdevCdroms;
    string ident;
    pkgCdromTextStatus log;
    pkgCdrom cdrom;
-   return cdrom.Ident(ident, &log);
+   bool res = true;
+
+   bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect");
+   unsigned int count = 0;
+   
+   if (AutoDetect && UdevCdroms.Dlopen())
+   {
+      while (AutoDetectCdrom(UdevCdroms, count))
+	 res &= cdrom.Ident(ident, &log);
+   } else {
+      return cdrom.Ident(ident, &log);
+   }
+ 
+   return res;
 }
 									/*}}}*/
 // ShowHelp - Show the help screen					/*{{{*/
@@ -154,6 +217,7 @@ int ShowHelp()
       "  -m   No mounting\n"
       "  -f   Fast mode, don't check package files\n"
       "  -a   Thorough scan mode\n"
+      "  --auto-detect Auto detect drive and mount point\n"
       "  -c=? Read this configuration file\n"
       "  -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n"
       "See fstab(5)\n";
@@ -164,6 +228,7 @@ int main(int argc,const char *argv[])					/*{{{*/
 {
    CommandLine::Args Args[] = {
       {'h',"help","help",0},
+      {  0,"auto-detect","Acquire::cdrom::AutoDetect",0},
       {'v',"version","version",0},
       {'d',"cdrom","Acquire::cdrom::mount",CommandLine::HasArg},
       {'r',"rename","APT::CDROM::Rename",0},

+ 7 - 2
cmdline/apt-mark

@@ -46,11 +46,16 @@ def mark_unmark_automatic(filename, action, pkgs):
                     print "changing %s to %s" % (pkgname,action)
                 newsec = apt_pkg.RewriteSection(tagfile.Section,
                                        [],
-                                       [ ("Auto-Installed",str(action)) ]
-                                       )
+                                       [ ("Auto-Installed",str(action)) ])
+                pkgs.remove(pkgname)
                 outfile.write(newsec+"\n")
             else:
                 outfile.write(str(tagfile.Section)+"\n")
+        if action == 1:
+            for pkgname in pkgs:
+                if options.verbose:
+                    print "changing %s to %s" % (pkgname,action)
+                outfile.write("Package: %s\nAuto-Installed: %d\n\n" % (pkgname, action))
         # all done, rename the tmpfile
         os.chmod(outfile.name, 0644)
         os.rename(outfile.name, STATE_FILE)

+ 41 - 8
debian/changelog

@@ -1,5 +1,6 @@
 apt (0.7.26) UNRELEASED; urgency=low
 
+  [ David Kalnischkies ]
   * [BREAK] add possibility to download and use multiply
     Translation files, configurable with Acquire::Translation
     (Closes: #444222, #448216, #550564)
@@ -18,13 +19,20 @@ apt (0.7.26) UNRELEASED; urgency=low
       caching if versions are build multiply times (not recommend)
       Patch by Christoph Goehre, thanks! (Closes: #463260)
 
- -- Michael Vogt <mvo@debian.org>  Thu, 10 Dec 2009 22:02:38 +0100
+  [ Ivan Masár ]
+  * Slovak translation update. Closes: #568294
+
+ -- David Kalnischkies <kalnischkies@gmail.com>  Sat, 13 Feb 2010 01:42:50 +0100
 
-apt (0.7.25.3) UNRELEASED; urgency=low
+apt (0.7.25.3) unstable; urgency=low
 
+  [ Christian Perrier ]
+  * Italian translation update. Closes: #567532
+
+  [ David Kalnischkies ]
   * apt-pkg/contrib/macros.h:
-    - move the header system.h with a new name to the public domain,
-      to be able to use it in other headers (Closes: #567662)
+    - install the header system.h with a new name to be able to use 
+      it in other headers (Closes: #567662)
   * cmdline/acqprogress.cc:
     - Set Mode to Medium so that the correct prefix is used.
       Thanks Stefan Haller for the patch! (Closes: #567304 LP: #275243)
@@ -32,11 +40,34 @@ apt (0.7.25.3) UNRELEASED; urgency=low
     - generate sha1 and sha256 checksums for dsc (Closes: #567343)
   * cmdline/apt-get.cc:
     - don't mark as manually if in download only (Closes: #468180)
-
- -- David Kalnischkies <kalnischkies@gmail.com>  Sat, 30 Jan 2010 22:13:48 +0100
+  
+ -- Michael Vogt <mvo@debian.org>  Mon, 01 Feb 2010 18:41:15 +0100
 
 apt (0.7.25.2) unstable; urgency=low
 
+  [ Michael Vogt ]
+  * apt-pkg/contrib/cdromutl.cc:
+    - fix UnmountCdrom() fails, give it a bit more time and try
+      the umount again
+  * apt-pkg/cdrom.cc:
+    - fix crash in pkgUdevCdromDevices
+  * methods/cdrom.cc:
+    - fixes in multi cdrom setup code (closes: #549312)
+    - add new "Acquire::cdrom::AutoDetect" config that enables/disables
+      the dlopen of libudev for automatic cdrom detection. Off by default
+      currently, feedback/testing welcome
+  * cmdline/apt-cdrom.cc:
+    - add new --auto-detect option that uses libudev to figure out
+      the cdrom/mount-point
+  * cmdline/apt-mark:
+    - merge fix from Gene Cash that supports markauto for
+      packages that are not in the extended_states file yet
+      (closes: #534920)
+  * ftparchive/writer.{cc,h}:
+    - merge crash fix for apt-ftparchive on hurd, thanks to 
+      Samuel Thibault for the patch (closes: #566664)
+
+  [ David Kalnischkies ]
   * apt-pkg/contrib/fileutl.cc:
     - Fix the newly introduced method GetListOfFilesInDir to not
       accept every file if no extension is enforced
@@ -61,13 +92,15 @@ apt (0.7.25.2) unstable; urgency=low
     - fix malloc asseration fail with ja_JP.eucJP locale in
       apt-cache search. Thanks Kusanagi Kouichi! (Closes: #548884)
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Sat, 16 Jan 2010 21:06:38 +0100
+  [ Christian Perrier ]
+  * French translation update
+
+ -- Michael Vogt <mvo@debian.org>  Wed, 27 Jan 2010 16:16:10 +0100
 
 apt (0.7.25.1) unstable; urgency=low
 
   [ Christian Perrier ]
   * French manpage translation update
-  * French translation update
   * Russian translation update by Yuri Kozlov
     Closes: #564171
   

+ 11 - 0
doc/examples/configure-index

@@ -248,6 +248,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!
@@ -335,6 +339,13 @@ Dir "/"
   Log "var/log/apt" {
 	Terminal "term.log";
   };
+
+  // Media 
+  Media 
+  {
+	// Media AutoDetect mount path
+	MountPath "/media/apt";
+  };
 };
 
 // Things that effect the APT dselect method

+ 43 - 58
doc/po/fr.po

@@ -10,7 +10,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: \n"
 "POT-Creation-Date: 2010-01-20 12:18+0100\n"
-"PO-Revision-Date: 2010-01-15 18:53+0100\n"
+"PO-Revision-Date: 2010-01-29 19:58+0100\n"
 "Last-Translator: Christian Perrier <bubulle@debian.org>\n"
 "Language-Team: French <debian-l10n-french@lists.debian.org>\n"
 "MIME-Version: 1.0\n"
@@ -1058,7 +1058,7 @@ msgstr ""
 
 #. type: Plain text
 #: apt.ent:362
-#, fuzzy, no-wrap
+#, no-wrap
 #| msgid ""
 #| "<!ENTITY file-sourceslist \"\n"
 #| "     <varlistentry><term><filename>/etc/apt/sources.list</filename></term>\n"
@@ -1072,10 +1072,10 @@ msgid ""
 "     Configuration Item: <literal>Dir::Etc::Trusted</literal>.</para></listitem>\n"
 "     </varlistentry>\n"
 msgstr ""
-"<!ENTITY file-sourceslist \"\n"
-"     <varlistentry><term><filename>/etc/apt/sources.list</filename></term>\n"
-"     <listitem><para>Emplacement pour la récupération des paquets.\n"
-"     Élément de configuration : <literal>Dir::Etc::SourceList</literal>.</para></listitem>\n"
+"<!ENTITY file-trustedgpg \"\n"
+"     <varlistentry><term><filename>/etc/apt/trusted.gpg</filename></term>\n"
+"     <listitem><para>Porte-clés des clés de confiance locales. Les nouvelles clés y seront ajoutées.\n"
+"     Élément de configuration: <literal>Dir::Etc::Trusted</literal>.</para></listitem>\n"
 "     </varlistentry>\n"
 
 #. type: Plain text
@@ -1105,7 +1105,6 @@ msgstr ""
 #: apt.ent:371
 msgid "<!ENTITY translation-title \"TRANSLATION\">"
 msgstr "<!ENTITY translation-title \"Traducteurs\">"
-""
 
 #. type: Plain text
 #: apt.ent:380
@@ -1137,8 +1136,13 @@ msgid ""
 "     translation is lagging behind the original content.\n"
 "\">\n"
 msgstr ""
+"<!ENTITY translation-english \"\n"
+"     Veuillez noter que cette traduction peut contenir des parties non traduites\n"
+"     Cela est volontaire, pour éviter de perdre du contenu quand la\n"
+"     traduction est légèrement en retard sur le contenu d'origine.\n"
+"\">\n"
 
-#.  The last update date 
+#.  The last update date
 #. type: Content of: <refentry><refentryinfo>
 #: apt-cache.8.xml:13 apt-config.8.xml:13 apt-extracttemplates.1.xml:13
 #: apt-sortpkgs.1.xml:13 sources.list.5.xml:13
@@ -2514,7 +2518,7 @@ msgstr ""
 "<command>apt-extracttemplates</command> retourne zéro si tout se passe bien, "
 "le nombre 100 en cas d'erreur."
 
-#.  The last update date 
+#.  The last update date
 #. type: Content of: <refentry><refentryinfo>
 #: apt-ftparchive.1.xml:13
 msgid ""
@@ -2638,8 +2642,7 @@ msgstr ""
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt-ftparchive.1.xml:82 apt-ftparchive.1.xml:106
-msgid ""
-"The option <option>--db</option> can be used to specify a binary caching DB."
+msgid "The option <option>--db</option> can be used to specify a binary caching DB."
 msgstr ""
 "On peut se servir de l'option <option>--db</option> pour demander un cache "
 "binaire."
@@ -2794,10 +2797,8 @@ msgstr ""
 
 #. type: Content of: <refentry><refsect1><para>
 #: apt-ftparchive.1.xml:155
-msgid ""
-"The generate configuration has 4 separate sections, each described below."
-msgstr ""
-"Ce fichier de configuration possède quatre sections, décrites ci-dessous."
+msgid "The generate configuration has 4 separate sections, each described below."
+msgstr "Ce fichier de configuration possède quatre sections, décrites ci-dessous."
 
 #. type: Content of: <refentry><refsect1><refsect2><title>
 #: apt-ftparchive.1.xml:157
@@ -3094,7 +3095,6 @@ msgstr "Sources"
 
 #. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><listitem><para>
 #: apt-ftparchive.1.xml:288
-#, fuzzy
 #| msgid ""
 #| "Sets the output Packages file. Defaults to <filename>$(DIST)/$(SECTION)/"
 #| "source/Sources</filename>"
@@ -3102,7 +3102,7 @@ msgid ""
 "Sets the output Sources file. Defaults to <filename>$(DIST)/$(SECTION)/"
 "source/Sources</filename>"
 msgstr ""
-"Indique le fichier « Packages » crée. Par défaut, c'est <filename>$(DIST)/"
+"Indique le fichier « Sources » créé. Par défaut, c'est <filename>$(DIST)/"
 "$(SECTION)/source/Sources</filename>."
 
 #. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
@@ -3242,7 +3242,7 @@ msgstr ""
 
 #. type: Content of: <refentry><refsect1><refsect2><para><programlisting>
 #: apt-ftparchive.1.xml:354
-#, fuzzy, no-wrap
+#, no-wrap
 #| msgid ""
 #| "for i in Sections do \n"
 #| "   for j in Architectures do\n"
@@ -3256,10 +3256,10 @@ msgstr ""
 "for i in Sections do \n"
 "   for j in Architectures do\n"
 "      Generate for DIST=scope SECTION=i ARCH=j\n"
+"     "
 
 #. type: Content of: <refentry><refsect1><refsect2><para>
 #: apt-ftparchive.1.xml:351
-#, fuzzy
 #| msgid ""
 #| "When processing a <literal>Tree</literal> section <command>apt-"
 #| "ftparchive</command> performs an operation similar to:"
@@ -3269,7 +3269,8 @@ msgid ""
 "\" id=\"0\"/>"
 msgstr ""
 "Quand il exécute la section <literal>Tree</literal>, <command>apt-"
-"ftparchive</command> agit ainsi :"
+"ftparchive</command> effectue une opération analogue à : <placeholder type=\"programlisting"
+"\" id=\"0\"/>"
 
 #. type: Content of: <refentry><refsect1><refsect2><variablelist><varlistentry><term>
 #: apt-ftparchive.1.xml:360
@@ -3695,7 +3696,7 @@ msgstr ""
 "<command>apt-ftparchive</command> retourne zéro si tout se passe bien, le "
 "nombre 100 en cas d'erreur."
 
-#.  The last update date 
+#.  The last update date
 #. type: Content of: <refentry><refentryinfo>
 #: apt-get.8.xml:13
 msgid ""
@@ -3713,8 +3714,7 @@ msgstr "apt-get"
 #. type: Content of: <refentry><refnamediv><refpurpose>
 #: apt-get.8.xml:30
 msgid "APT package handling utility -- command-line interface"
-msgstr ""
-"Utilitaire APT pour la gestion des paquets -- interface en ligne de commande."
+msgstr "Utilitaire APT pour la gestion des paquets -- interface en ligne de commande."
 
 #. type: Content of: <refentry><refsynopsisdiv><cmdsynopsis>
 #: apt-get.8.xml:36
@@ -5072,10 +5072,8 @@ msgstr "Trousseau des clés fiables de l'archive Debian."
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
 #: apt-key.8.xml:166
-msgid ""
-"<filename>/usr/share/keyrings/debian-archive-removed-keys.gpg</filename>"
-msgstr ""
-"<filename>/usr/share/keyrings/debian-archive-removed-keys.gpg</filename>"
+msgid "<filename>/usr/share/keyrings/debian-archive-removed-keys.gpg</filename>"
+msgstr "<filename>/usr/share/keyrings/debian-archive-removed-keys.gpg</filename>"
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt-key.8.xml:167
@@ -5087,7 +5085,7 @@ msgstr "Trousseau des clés fiables supprimées de l'archive Debian."
 msgid "&apt-get;, &apt-secure;"
 msgstr "&apt-get;, &apt-secure;"
 
-#.  The last update date 
+#.  The last update date
 #. type: Content of: <refentry><refentryinfo>
 #: apt-mark.8.xml:13
 msgid ""
@@ -5197,10 +5195,8 @@ msgstr ""
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
 #: apt-mark.8.xml:93
-msgid ""
-"<option>-f=<filename><replaceable>FILENAME</replaceable></filename></option>"
-msgstr ""
-"<option>-f=<filename><replaceable>FICHIER</replaceable></filename></option>"
+msgid "<option>-f=<filename><replaceable>FILENAME</replaceable></filename></option>"
+msgstr "<option>-f=<filename><replaceable>FICHIER</replaceable></filename></option>"
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
 #: apt-mark.8.xml:94
@@ -5660,7 +5656,7 @@ msgstr ""
 "<command>apt-sortpkgs</command> retourne zéro si tout se passe bien ou 100 "
 "en cas d'erreur."
 
-#.  The last update date 
+#.  The last update date
 #. type: Content of: <refentry><refentryinfo>
 #: apt.conf.5.xml:13
 #, fuzzy
@@ -5733,8 +5729,7 @@ msgstr ""
 #| msgid ""
 #| "APT configuration file.  Configuration Item: <literal>Dir::Etc::Main</"
 #| "literal>."
-msgid ""
-"the main configuration file specified by <literal>Dir::Etc::main</literal>"
+msgid "the main configuration file specified by <literal>Dir::Etc::main</literal>"
 msgstr ""
 "Fichier de configuration d'APT. Élément de configuration : <literal>Dir::"
 "Etc::Main</literal>."
@@ -7483,7 +7478,7 @@ msgstr ""
 
 #.  TODO: provide a
 #. 	   motivating example, except I haven't a clue why you'd want
-#. 	   to do this. 
+#. 	   to do this.
 #. type: Content of: <refentry><refsect1><para><itemizedlist><listitem><para>
 #: apt.conf.5.xml:692
 msgid ""
@@ -7505,8 +7500,7 @@ msgstr "<literal>Debug::Acquire::cdrom</literal>"
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt.conf.5.xml:711
-msgid ""
-"Print information related to accessing <literal>cdrom://</literal> sources."
+msgid "Print information related to accessing <literal>cdrom://</literal> sources."
 msgstr ""
 "Affiche les informations concernant les sources de type <literal>cdrom://</"
 "literal>"
@@ -7519,8 +7513,7 @@ msgstr "<literal>Debug::Acquire::ftp</literal>"
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt.conf.5.xml:722
 msgid "Print information related to downloading packages using FTP."
-msgstr ""
-"Affiche les informations concernant le téléchargement de paquets par FTP."
+msgstr "Affiche les informations concernant le téléchargement de paquets par FTP."
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
 #: apt.conf.5.xml:729
@@ -7530,8 +7523,7 @@ msgstr "<literal>Debug::Acquire::http</literal>"
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt.conf.5.xml:733
 msgid "Print information related to downloading packages using HTTP."
-msgstr ""
-"Affiche les informations concernant le téléchargement de paquets par HTTP."
+msgstr "Affiche les informations concernant le téléchargement de paquets par HTTP."
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
 #: apt.conf.5.xml:740
@@ -7692,8 +7684,7 @@ msgstr "<literal>Debug::pkgAcquire::Worker</literal>"
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt.conf.5.xml:862
-msgid ""
-"Log all interactions with the sub-processes that actually perform downloads."
+msgid "Log all interactions with the sub-processes that actually perform downloads."
 msgstr ""
 "Affiche toutes les interactions avec les processus enfants qui se chargent "
 "effectivement des téléchargements."
@@ -7834,8 +7825,7 @@ msgstr "<literal>Debug::pkgPackageManager</literal>"
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para>
 #: apt.conf.5.xml:963
-msgid ""
-"Output status messages tracing the steps performed when invoking &dpkg;."
+msgid "Output status messages tracing the steps performed when invoking &dpkg;."
 msgstr "Affiche le détail des opérations liées à l'invocation de &dpkg;."
 
 #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term>
@@ -7906,13 +7896,13 @@ msgstr ""
 msgid "&file-aptconf;"
 msgstr "&file-aptconf;"
 
-#.  ? reading apt.conf 
+#.  ? reading apt.conf
 #. type: Content of: <refentry><refsect1><para>
 #: apt.conf.5.xml:1042
 msgid "&apt-cache;, &apt-config;, &apt-preferences;."
 msgstr "&apt-cache;, &apt-config;, &apt-preferences;."
 
-#.  The last update date 
+#.  The last update date
 #. type: Content of: <refentry><refentryinfo>
 #: apt_preferences.5.xml:13
 msgid "&apt-author.team; &apt-email; &apt-product; <date>04 May 2009</date>"
@@ -8062,8 +8052,7 @@ msgstr "une priorité égale à 990"
 
 #. type: Content of: <refentry><refsect1><refsect2><para><variablelist><varlistentry><listitem><simpara>
 #: apt_preferences.5.xml:101
-msgid ""
-"to the versions that are not installed and belong to the target release."
+msgid "to the versions that are not installed and belong to the target release."
 msgstr ""
 "est affectée aux versions qui ne sont pas installées et qui appartiennent à "
 "la distribution par défaut."
@@ -8548,8 +8537,7 @@ msgstr ""
 #. type: Content of: <refentry><refsect1><refsect2><title>
 #: apt_preferences.5.xml:313
 msgid "Determination of Package Version and Distribution Properties"
-msgstr ""
-"Détermination de la version des paquets et des propriétés des distributions"
+msgstr "Détermination de la version des paquets et des propriétés des distributions"
 
 #. type: Content of: <refentry><refsect1><refsect2><para>
 #: apt_preferences.5.xml:315
@@ -9642,8 +9630,7 @@ msgstr "$Id: guide.sgml,v 1.7 2003/04/26 23:26:13 doogie Exp $"
 
 #. type: <abstract></abstract>
 #: guide.sgml:11
-msgid ""
-"This document provides an overview of how to use the the APT package manager."
+msgid "This document provides an overview of how to use the the APT package manager."
 msgstr ""
 "Ce document fournit un aperçu des méthode d'utilisation du gestionnaire de "
 "paquets APT."
@@ -10574,10 +10561,8 @@ msgstr "Résumé final"
 
 #. type: <p></p>
 #: guide.sgml:447
-msgid ""
-"Finally, APT will print out a summary of all the changes that will occur."
-msgstr ""
-"Anfin, APT affichera un résumé de toutes les opérations qui prendront place."
+msgid "Finally, APT will print out a summary of all the changes that will occur."
+msgstr "Anfin, APT affichera un résumé de toutes les opérations qui prendront place."
 
 #. type: <example></example>
 #: guide.sgml:452

+ 19 - 12
ftparchive/writer.cc

@@ -58,10 +58,6 @@ FTWScanner::FTWScanner()
 {
    ErrorPrinted = false;
    NoLinkAct = !_config->FindB("APT::FTPArchive::DeLinkAct",true);
-   RealPath = 0;
-   long PMax = pathconf(".",_PC_PATH_MAX);
-   if (PMax > 0)
-      RealPath = new char[PMax];
 }
 									/*}}}*/
 // FTWScanner::Scanner - FTW Scanner					/*{{{*/
@@ -92,6 +88,8 @@ int FTWScanner::ScannerFTW(const char *File,const struct stat *sb,int Flag)
 int FTWScanner::ScannerFile(const char *File, bool const &ReadLink)
 {
    const char *LastComponent = strrchr(File, '/');
+   char *RealPath = NULL;
+
    if (LastComponent == NULL)
       LastComponent = File;
    else
@@ -111,10 +109,13 @@ int FTWScanner::ScannerFile(const char *File, bool const &ReadLink)
       given are not links themselves. */
    char Jnk[2];
    Owner->OriginalPath = File;
-   if (ReadLink && Owner->RealPath != 0 &&
+   if (ReadLink &&
        readlink(File,Jnk,sizeof(Jnk)) != -1 &&
-       realpath(File,Owner->RealPath) != 0)
-      Owner->DoPackage(Owner->RealPath);
+       (RealPath = realpath(File,NULL)) != 0)
+   {
+      Owner->DoPackage(RealPath);
+      free(RealPath);
+   }
    else
       Owner->DoPackage(File);
    
@@ -150,13 +151,15 @@ int FTWScanner::ScannerFile(const char *File, bool const &ReadLink)
 /* */
 bool FTWScanner::RecursiveScan(string const &Dir)
 {
+   char *RealPath = NULL;
    /* If noprefix is set then jam the scan root in, so we don't generate
       link followed paths out of control */
    if (InternalPrefix.empty() == true)
    {
-      if (realpath(Dir.c_str(),RealPath) == 0)
+      if ((RealPath = realpath(Dir.c_str(),NULL)) == 0)
 	 return _error->Errno("realpath",_("Failed to resolve %s"),Dir.c_str());
-      InternalPrefix = RealPath;      
+      InternalPrefix = RealPath;
+      free(RealPath);
    }
    
    // Do recursive directory searching
@@ -180,13 +183,15 @@ bool FTWScanner::RecursiveScan(string const &Dir)
    of files from another file. */
 bool FTWScanner::LoadFileList(string const &Dir, string const &File)
 {
+   char *RealPath = NULL;
    /* If noprefix is set then jam the scan root in, so we don't generate
       link followed paths out of control */
    if (InternalPrefix.empty() == true)
    {
-      if (realpath(Dir.c_str(),RealPath) == 0)
+      if ((RealPath = realpath(Dir.c_str(),NULL)) == 0)
 	 return _error->Errno("realpath",_("Failed to resolve %s"),Dir.c_str());
       InternalPrefix = RealPath;      
+      free(RealPath);
    }
    
    Owner = this;
@@ -687,6 +692,7 @@ bool SourcesWriter::DoPackage(string FileName)
    // Perform the delinking operation over all of the files
    string ParseJnk;
    const char *C = Files;
+   char *RealPath = NULL;
    for (;isspace(*C); C++);
    while (*C != 0)
    {   
@@ -698,10 +704,11 @@ bool SourcesWriter::DoPackage(string FileName)
       
       char Jnk[2];
       string OriginalPath = Directory + ParseJnk;
-      if (RealPath != 0 && readlink(OriginalPath.c_str(),Jnk,sizeof(Jnk)) != -1 &&
-	  realpath(OriginalPath.c_str(),RealPath) != 0)
+      if (readlink(OriginalPath.c_str(),Jnk,sizeof(Jnk)) != -1 &&
+	  (RealPath = realpath(OriginalPath.c_str(),NULL)) != 0)
       {
 	 string RP = RealPath;
+	 free(RealPath);
 	 if (Delink(RP,OriginalPath.c_str(),Stats.DeLinkBytes,St.st_size) == false)
 	    return false;
       }

+ 0 - 2
ftparchive/writer.h

@@ -35,7 +35,6 @@ class FTWScanner
    protected:
    vector<string> Patterns;
    const char *OriginalPath;
-   char *RealPath;
    bool ErrorPrinted;
    
    // Stuff for the delinker
@@ -70,7 +69,6 @@ class FTWScanner
    bool SetExts(string const &Vals);
       
    FTWScanner();
-   virtual ~FTWScanner() {delete [] RealPath;};
 };
 
 class PackagesWriter : public FTWScanner

+ 17 - 17
methods/cdrom.cc

@@ -37,8 +37,8 @@ class CDROMMethod : public pkgAcqMethod
    bool MountedByApt;
    pkgUdevCdromDevices UdevCdroms;
  
-   bool IsCorrectCD(URI want, string MountPath);
-   bool AutoDetectAndMount(URI);
+   bool IsCorrectCD(URI want, string MountPath, string& NewID);
+   bool AutoDetectAndMount(const URI, string &NewID);
    virtual bool Fetch(FetchItem *Itm);
    string GetID(string Name);
    virtual void Exit();
@@ -92,7 +92,7 @@ string CDROMMethod::GetID(string Name)
 // CDROMMethod::AutoDetectAndMount                                      /*{{{*/
 // ---------------------------------------------------------------------
 /* Modifies class varaiable CDROM to the mountpoint */
-bool CDROMMethod::AutoDetectAndMount(URI Get)
+bool CDROMMethod::AutoDetectAndMount(const URI Get, string &NewID)
 {
    vector<struct CdromDevice> v = UdevCdroms.Scan();
 
@@ -103,7 +103,7 @@ bool CDROMMethod::AutoDetectAndMount(URI Get)
       {
 	 if (Debug)
 	    clog << "Checking mounted cdrom device " << v[i].DeviceName << endl;
-	 if (IsCorrectCD(Get, v[i].MountPath))
+	 if (IsCorrectCD(Get, v[i].MountPath, NewID))
 	 {
 	    CDROM = v[i].MountPath;
 	    return true;
@@ -116,23 +116,24 @@ bool CDROMMethod::AutoDetectAndMount(URI Get)
       return false;
 
    // check if we have the mount point
-   if (!FileExists("/media/apt"))
-      mkdir("/media/apt", 0755);
+   string AptMountPoint = _config->FindDir("Dir::Media::MountPath");
+   if (!FileExists(AptMountPoint))
+      mkdir(AptMountPoint.c_str(), 0750);
 
    // now try mounting
    for (unsigned int i=0; i < v.size(); i++)
    {
       if (!v[i].Mounted)
       {
-	 if(MountCdrom("/media/apt", v[i].DeviceName)) 
+	 if(MountCdrom(AptMountPoint, v[i].DeviceName)) 
 	 {
-	    if (IsCorrectCD(Get, "/media/apt"))
+	    if (IsCorrectCD(Get, AptMountPoint, NewID))
 	    {
 	       MountedByApt = true;
-	       CDROM = "/media/apt";
+	       CDROM = AptMountPoint;
 	       return true;
 	    } else {
-	       UnmountCdrom("/media/apt");
+	       UnmountCdrom(AptMountPoint);
 	    }
 	 }
       }
@@ -144,10 +145,8 @@ bool CDROMMethod::AutoDetectAndMount(URI Get)
 // CDROMMethod::IsCorrectCD                                             /*{{{*/
 // ---------------------------------------------------------------------
 /* */
-bool CDROMMethod::IsCorrectCD(URI want, string MountPath)
+bool CDROMMethod::IsCorrectCD(URI want, string MountPath, string& NewID)
 {
-   string NewID;
-
    for (unsigned int Version = 2; Version != 0; Version--)
    {
       if (IdentCdrom(MountPath,NewID,Version) == false)
@@ -220,23 +219,24 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
       return true;
    }
 
+   bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect", false);
    CDROM = _config->FindDir("Acquire::cdrom::mount","/cdrom/");
    if (Debug)
       clog << "Looking for CDROM at " << CDROM << endl;
 
    if (CDROM[0] == '.')
       CDROM= SafeGetCWD() + '/' + CDROM;
-   string NewID;
 
+   string NewID;
    while (CurrentID.empty() == true)
    {
-      if (CDROM == "apt-udev-auto/") 
-	 AutoDetectAndMount(Get);
+      if (AutoDetect)
+	 AutoDetectAndMount(Get, NewID);
 
       if(!IsMounted(CDROM))
 	 MountedByApt = MountCdrom(CDROM);
       
-      if (IsCorrectCD(Get, CDROM))
+      if (IsCorrectCD(Get, CDROM, NewID))
 	 break;
 	 
       // I suppose this should prompt somehow?

Разница между файлами не показана из-за своего большого размера
+ 207 - 175
po/fr.po


Разница между файлами не показана из-за своего большого размера
+ 226 - 196
po/it.po


Разница между файлами не показана из-за своего большого размера
+ 218 - 184
po/sk.po