Преглед изворни кода

Use symlinks for source
Author: jgg
Date: 1999-08-28 03:22:34 GMT
Use symlinks for source

Arch Librarian пре 22 година
родитељ
комит
917ae8051c
3 измењених фајлова са 20 додато и 5 уклоњено
  1. 14 4
      apt-pkg/acquire-item.cc
  2. 4 0
      doc/apt.conf.5.yo
  3. 2 1
      doc/examples/apt.conf

+ 14 - 4
apt-pkg/acquire-item.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: acquire-item.cc,v 1.35 1999/08/03 05:19:41 jgg Exp $
+// $Id: acquire-item.cc,v 1.36 1999/08/28 03:22:34 jgg Exp $
 /* ######################################################################
 
    Acquire Item - Item to acquire
@@ -617,9 +617,19 @@ void pkgAcqFile::Done(string Message,unsigned long Size,string MD5)
    if (FileName != DestFile)
    {
       Local = true;
-      Desc.URI = "copy:" + FileName;
-      QueueURI(Desc);
-      return;
+      if (_config->FindB("Acquire::Source-Symlinks",true) == false)
+      {
+	 Desc.URI = "copy:" + FileName;
+	 QueueURI(Desc);
+	 return;
+      }
+      
+      if (symlink(FileName.c_str(),DestFile.c_str()) != 0)
+      {
+	 ErrorText = "Link to " + DestFile + "failure ";
+	 Status = StatError;
+	 Complete = false;
+      }      
    }
 }
 									/*}}}*/

+ 4 - 0
doc/apt.conf.5.yo

@@ -99,6 +99,10 @@ dit(bf(Retries))
 Number of retries to perform. If this is non-zero apt will retry failed 
 files the given number of times.
 
+dit(bf(Acquire::Source-Symlinks))
+Use symlinks for source archives. If set to true then source archives will
+be symlinked when possible instead of copying. True is the default
+
 dit(bf(http))
 HTTP URIs; http::Proxy is the default http proxy to use. It is in the standard
 form of em(http://[[user][:pass]@]host[:port]/). Per host proxies can also

+ 2 - 1
doc/examples/apt.conf

@@ -1,4 +1,4 @@
-// $Id: apt.conf,v 1.36 1999/08/12 05:59:47 jgg Exp $
+// $Id: apt.conf,v 1.37 1999/08/28 03:22:45 jgg Exp $
 /* This file is an index of all APT configuration directives. It should
    NOT actually be used as a real config file, though it is a completely
    valid file.
@@ -62,6 +62,7 @@ Acquire
 {
   Queue-Mode "host";       // host|access
   Retries "0";
+  Source-Symlinks "true";
   
   // HTTP method configuration
   http