]> git.saurik.com Git - apt.git/commitdiff
use a configurable location for apport report storage
authorDavid Kalnischkies <david@kalnischkies.de>
Thu, 21 Jul 2016 13:54:22 +0000 (15:54 +0200)
committerDavid Kalnischkies <david@kalnischkies.de>
Fri, 22 Jul 2016 14:05:10 +0000 (16:05 +0200)
Hardcoding /var/crash means we can't test it properly and it isn't
really our style.

apt-pkg/deb/dpkgpm.cc
test/integration/framework
test/integration/test-apt-progress-fd-error

index 6556f232eee7641c8264d17208f635be0895e372..0c61a5e3679b0df524dcb569b5f88d4ddb57b2a8 100644 (file)
@@ -1741,7 +1741,8 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
    //    we overwrite it. This is the same behaviour as apport
    // - if we have a report with the same pkgversion already
    //   then we skip it
    //    we overwrite it. This is the same behaviour as apport
    // - if we have a report with the same pkgversion already
    //   then we skip it
-   reportfile = flCombine("/var/crash",pkgname+".0.crash");
+   _config->CndSet("Dir::Apport", "var/crash");
+   reportfile = flCombine(_config->FindDir("Dir::Apport", "var/crash"), pkgname+".0.crash");
    if(FileExists(reportfile))
    {
       struct stat buf;
    if(FileExists(reportfile))
    {
       struct stat buf;
index 17de023aa8dfa8b3a973274b59ce9520e3818ab0..7a6b044aa7cdc4f9e45d1583d926a59acc7d7a8d 100644 (file)
@@ -298,7 +298,7 @@ setupenvironment() {
        mkdir rootdir aptarchive keys
        cd rootdir
        mkdir -p etc/apt/apt.conf.d etc/apt/sources.list.d etc/apt/trusted.gpg.d etc/apt/preferences.d
        mkdir rootdir aptarchive keys
        cd rootdir
        mkdir -p etc/apt/apt.conf.d etc/apt/sources.list.d etc/apt/trusted.gpg.d etc/apt/preferences.d
-       mkdir -p usr/bin var/cache var/lib var/log tmp
+       mkdir -p usr/bin var/cache var/lib var/log var/crash tmp
        mkdir -p var/lib/dpkg/info var/lib/dpkg/updates var/lib/dpkg/triggers
        mkdir -p usr/lib/apt/solvers usr/lib/apt/planners
        touch var/lib/dpkg/available
        mkdir -p var/lib/dpkg/info var/lib/dpkg/updates var/lib/dpkg/triggers
        mkdir -p usr/lib/apt/solvers usr/lib/apt/planners
        touch var/lib/dpkg/available
index 131e502565b99dcb385e3ffd61396fcfeb5732ee..e66210304249de62ef6fe03f7ec322ec38401558 100755 (executable)
@@ -12,6 +12,7 @@ touch usr/bin/file-conflict
 
 buildsimplenativepackage 'foo1' 'native' '0.8.15' 'stable' '' 'pkg with file conflicts' '' '' 'usr/'
 buildsimplenativepackage 'foo2' 'native' '0.8.15' 'stable' '' 'pkg with file conflicts' '' '' 'usr/'
 
 buildsimplenativepackage 'foo1' 'native' '0.8.15' 'stable' '' 'pkg with file conflicts' '' '' 'usr/'
 buildsimplenativepackage 'foo2' 'native' '0.8.15' 'stable' '' 'pkg with file conflicts' '' '' 'usr/'
+insertinstalledpackage 'apport' 'native' '1'
 
 setupaptarchive
 
 
 setupaptarchive
 
@@ -19,3 +20,6 @@ exec 3> apt-progress.log
 testfailure aptget install foo1 foo2 -y -o APT::Status-Fd=3
 msgtest 'Ensure correct error message'
 testsuccess --nomsg grep "aptarchive/pool/foo2_0.8.15_[^.]\+.deb:36.3636:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log
 testfailure aptget install foo1 foo2 -y -o APT::Status-Fd=3
 msgtest 'Ensure correct error message'
 testsuccess --nomsg grep "aptarchive/pool/foo2_0.8.15_[^.]\+.deb:36.3636:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log
+
+testsuccess test -s rootdir/var/crash/foo2.0.crash
+testsuccess grep '^Package: foo2 0.8.15$' rootdir/var/crash/foo2.0.crash