if (DebugMarker == true)
std::clog << OutputInDepth(Depth) << "MarkInstall " << Pkg << " FU=" << FromUser << std::endl;
+ bool MoveAutoBitToDependencies = false;
VerIterator const PV = P.InstVerIter(*this);
if (unlikely(PV.end() == true))
return false;
+ else if (PV->Section != 0 && (P.Flags & Flag::Auto) != Flag::Auto)
+ {
+ VerIterator const CurVer = Pkg.CurrentVer();
+ if (CurVer.end() == false && CurVer->Section != 0 && strcmp(CurVer.Section(), PV.Section()) != 0)
+ {
+ bool const CurVerInMoveSection = ConfigValueInSubTree("APT::Move-Autobit-Sections", CurVer.Section());
+ bool const InstVerInMoveSection = ConfigValueInSubTree("APT::Move-Autobit-Sections", PV.Section());
+ MoveAutoBitToDependencies = (CurVerInMoveSection == false && InstVerInMoveSection == true);
+ if (MoveAutoBitToDependencies == true)
+ {
+ if(DebugAutoInstall == true)
+ std::clog << OutputInDepth(Depth) << "Setting " << Pkg.FullName(false) << " as auto-installed, moving manual to its dependencies" << std::endl;
+ MarkAuto(Pkg, true);
+ }
+ }
+ }
DepIterator Dep = PV.DependsList();
for (; Dep.end() != true;)
verlist.erase(InstVer);
continue;
}
+
+ // now check if we should consider it a automatic dependency or not
+ if(InstPkg->CurrentVer == 0 && MoveAutoBitToDependencies)
+ {
+ if(DebugAutoInstall == true)
+ std::clog << OutputInDepth(Depth) << "Setting " << InstPkg.FullName(false) << " NOT as auto-installed (direct "
+ << Start.DepType() << " of " << Pkg.FullName(false) << " which is manual and in APT::Move-Autobit-Sections)" << std::endl;
+ MarkAuto(InstPkg, false);
+ }
+
+
break;
} while(true);
continue;
--- /dev/null
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64'
+
+aptconfig dump --no-empty --format '%v%n' APT::Move-Autobit-Sections > move-autobit.sections
+testsuccess grep '^oldlibs$' move-autobit.sections
+
+buildsimplenativepackage 'libabc' 'amd64' '1' 'stable' '' '' 'libs'
+buildsimplenativepackage 'libabc' 'amd64' '2' 'unstable' 'Depends: libdef' '' 'oldlibs'
+buildsimplenativepackage 'libdef' 'amd64' '1' 'unstable' '' '' 'libs'
+setupaptarchive
+
+testmarkedauto
+testmarkedmanual
+
+testsuccess aptget install libabc/stable -y
+testdpkginstalled 'libabc'
+testdpkgnotinstalled 'libdef'
+
+testmarkedmanual 'libabc'
+testmarkedauto
+
+testsuccess aptget dist-upgrade -y
+testdpkginstalled 'libabc' 'libdef'
+
+testmarkedauto 'libabc'
+testmarkedmanual 'libdef'