~ubuntu-branches/ubuntu/lucid/aptitude/lucid-security

« back to all changes in this revision

Viewing changes to debian/patches/0007-preferences-dir.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Rolf Leggewie
  • Date: 2011-10-19 23:45:52 UTC
  • Revision ID: james.westby@ubuntu.com-20111019234552-yo35kmqepwm7kya3
Tags: 0.4.11.11-1ubuntu10lucid1
backport 0007-preferences-dir.patch from natty. (LP: #508545)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 0007-preferences-dir.dpatch by  <Rolf Leggewie <foss@rolf.leggewie.biz>>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: Support preferences.d directory.
 
6
## DP: Author: Tim Retout <diocles@debian.org>
 
7
## DP: Bug-Debian: http://bugs.debian.org/557580
 
8
 
 
9
@DPATCH@
 
10
 
 
11
--- aptitude-0.6.3.orig/src/cmdline/cmdline_do_action.cc
 
12
+++ aptitude-0.6.3/src/cmdline/cmdline_do_action.cc
 
13
@@ -200,6 +200,7 @@ int cmdline_do_action(int argc, char *ar
 
14
 
 
15
   pkgPolicy policy(&(*apt_cache_file)->GetCache());
 
16
   ReadPinFile(policy);
 
17
+  ReadPinDir(policy);
 
18
 
 
19
   pkgset to_upgrade, to_install, to_hold, to_remove, to_purge;
 
20
 
 
21
--- aptitude-0.6.3.orig/src/generic/apt/aptcache.cc
 
22
+++ aptitude-0.6.3/src/generic/apt/aptcache.cc
 
23
@@ -2179,7 +2179,7 @@ bool aptitudeCacheFile::Open(OpProgress
 
24
   Policy=new aptitudePolicy(Cache);
 
25
   if(_error->PendingError())
 
26
     return false;
 
27
-  if(!ReadPinFile(*Policy))
 
28
+  if(ReadPinFile(*Policy) == false || ReadPinDir(*Policy) == false)
 
29
     return false;
 
30
 
 
31
   DCache=new aptitudeDepCache(Cache, Policy);
 
32
--- aptitude-0.6.3.orig/src/generic/apt/dump_packages.cc
 
33
+++ aptitude-0.6.3/src/generic/apt/dump_packages.cc
 
34
@@ -744,6 +744,7 @@ namespace aptitude
 
35
     //   $(Dir::Etc::main)
 
36
     //   $(Dir::Etc::parts)/*
 
37
     //   $(Dir::Etc::preferences)
 
38
+    //   $(Dir::Etc::preferencesparts)/*
 
39
     //
 
40
     // Dir::State::* are truncated copies; the others are copied
 
41
     // literally.
 
42
@@ -837,6 +838,12 @@ namespace aptitude
 
43
          copy_truncated(preferences, outDir + "/" + preferences,
 
44
                         visited_packages);
 
45
       }
 
46
+
 
47
+      {
 
48
+       const std::string preferencesParts = _config->FindDir("Dir::Etc::preferencesparts");
 
49
+       if(!preferencesParts.empty())
 
50
+         recursive_copy_dir(preferencesParts, outDir + "/" + preferencesParts);
 
51
+      }
 
52
     }
 
53
 
 
54
     void dump_truncated_packages(const std::set<pkgCache::PkgIterator> &packages,