Browse Source

accept ../ on the cmdline as start for a deb file as well

Regression of 14341a7ee1ca3dbcdcdbe10ad19b947ce23d972d.

Reported-By: Julian Andres Klode <jak@debian.org>
David Kalnischkies 10 years ago
parent
commit
3dd64b9c53
2 changed files with 6 additions and 2 deletions
  1. 1 1
      apt-pkg/sourcelist.cc
  2. 5 1
      test/integration/test-apt-get-install-deb

+ 1 - 1
apt-pkg/sourcelist.cc

@@ -558,7 +558,7 @@ bool pkgSourceList::AddVolatileFile(std::string const &File)		/*{{{*/
 void pkgSourceList::AddVolatileFiles(CommandLine &CmdL, std::vector<const char*> * const VolatileCmdL)/*{{{*/
 {
    std::remove_if(CmdL.FileList + 1, CmdL.FileList + 1 + CmdL.FileSize(), [&](char const * const I) {
-      if (I != nullptr && (I[0] == '/' || (I[0] == '.' && I[1] == '/')))
+      if (I != nullptr && (I[0] == '/' || (I[0] == '.' && ((I[1] == '.' && I[2] == '/') || I[1] == '/'))))
       {
 	 if (AddVolatileFile(I))
 	 {

+ 5 - 1
test/integration/test-apt-get-install-deb

@@ -40,9 +40,13 @@ The following packages have unmet dependencies:
  foo : Conflicts: foo:i386 but 1.0 is to be installed
 E: Unable to correct problems, you have held broken packages." aptget install ./incoming/foo_1.0_i386.deb ./incoming/foo_1.0_amd64.deb -s
 
-testdpkgnotinstalled 'foo'
+testdpkgnotinstalled 'foo' 'foo:i386'
 testsuccess aptget install ./incoming/foo_1.0_i386.deb -o Debug::pkgCacheGen=1
 testdpkginstalled 'foo:i386'
+cd downloaded
+testsuccess aptget install "$(readlink -f ../incoming/foo_1.0_i386.deb)" -o Debug::pkgCacheGen=1 -y --allow-downgrades
+testsuccess aptget install ../incoming/foo_1.0_i386.deb -o Debug::pkgCacheGen=1 -y --allow-downgrades
+cd ..
 
 testsuccessequal "Reading package lists...
 Building dependency tree...