Package: apt-cacher-ng
Version: 0.1.13-1
Severity: normal
Tags: patch

If there are symlinks in the /var/cache/apt-cacher-ng/_import directory, they 
are not imported, failing with a messages stating they could not be copied or 
linked.  The following trivial patch fixes that.

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable'), (1, 'experimental'), (1, 
'unstable'), (1, 'testing'), (1, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
diff -Naur apt-cacher-ng_0.1.13-1/debian/changelog apt-cacher-ng-0.1.13/debian/changelog
--- apt-cacher-ng_0.1.13-1/debian/changelog	2008-06-06 04:00:26.000000000 -0400
+++ apt-cacher-ng-0.1.13/debian/changelog	2008-06-06 05:05:56.000000000 -0400
@@ -1,3 +1,9 @@
+apt-cacher-ng (0.1.13-2dfd1) unstabled; urgency=low
+
+  * Fixed failure to import symlinks in _import
+
+ -- Daniel Dickinson <[EMAIL PROTECTED]>  Fri, 06 Jun 2008 06:05:55 -0500
+
 apt-cacher-ng (0.1.13-1) unstable; urgency=low
 
   * New upstream release
diff -Naur apt-cacher-ng_0.1.13-1/source/pkgimport.cc apt-cacher-ng-0.1.13/source/pkgimport.cc
--- apt-cacher-ng_0.1.13-1/source/pkgimport.cc	2008-06-06 04:00:26.000000000 -0400
+++ apt-cacher-ng-0.1.13/source/pkgimport.cc	2008-06-06 05:07:02.000000000 -0400
@@ -30,6 +30,7 @@
 void pkgimport::ProcessOther(const string &sPath, const struct stat &stinfo) 
 {
 	// NOOP;
+
 }
 void pkgimport::ProcessRegular(const string &sPath, const struct stat &stinfo) 
 {
@@ -167,17 +168,19 @@
 	{
 		char buf[PATH_MAX+1];
 		buf[PATH_MAX]=0x0;
-		
-		readlink(from.c_str(), buf, PATH_MAX);
-		if (buf[0]!=*SZPATHSEP) // not absolute, crap...
-		{
+
+		// readlink and check for absolute is bogus given later use 
+		// of realpath		
+		//		readlink(from.c_str(), buf, PATH_MAX);
+		//		if (buf[0]!=*SZPATHSEP) // not absolute, crap...
+		//		{
 			// stupid stuff inside, resolve it, hope that's ok
-			if (!realpath(from.c_str(), buf))
+         		if (!realpath(from.c_str(), buf))
 				return false;
 			if(0==symlink(buf, to.c_str()))
 				return true;
 			
-		}
+			    //		}
 	}
 	else
 	{

Reply via email to