~ubuntu-branches/debian/squeeze/aptitude/squeeze

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Tim Retout
  • Date: 2010-10-12 21:11:54 UTC
  • Revision ID: james.westby@ubuntu.com-20101012211154-wrbam3ck3oenykjc
Tags: 0.6.3-3.2
* Non-maintainer upload.
* 0007-preferences-dir.patch: Patch to support /etc/apt/preferences.d/
  directory. (Closes: #557580)
* debian/rules: Fix clean rule.  Patch by Stéphane Glondu.
  (Closes: #594505)

Show diffs side-by-side

added added

removed removed

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