Advertisement
Guest User

repo_clean_xz_pacman4.patch

a guest
Jan 21st, 2012
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.89 KB | None | 0 0
  1. diff -ur repo-clean-0.1.3.xz/Sconstruct repo-clean-0.1.3/Sconstruct
  2. --- repo-clean-0.1.3.xz/Sconstruct  2012-01-21 17:41:30.000000000 +1100
  3. +++ repo-clean-0.1.3/Sconstruct 2012-01-21 17:19:26.710577264 +1100
  4. @@ -14,7 +14,7 @@
  5.  general_flags = ' -Wall -D\'VERSION=\\\"%s\\\"\' ' % version
  6.  debug_flags=' -g -O0 -DDEBUG '
  7.  release_flags=' -O3 '
  8. -cclibs = ' -lalpm -lboost_filesystem '
  9. +cclibs = ' -lalpm -lboost_filesystem -lboost_system '
  10.  
  11.  ccflags = general_flags
  12.  if int(ARGUMENTS.get('debug', 0)):
  13. diff -ur repo-clean-0.1.3.xz/src/repo-clean.cpp repo-clean-0.1.3/src/repo-clean.cpp
  14. --- repo-clean-0.1.3.xz/src/repo-clean.cpp  2012-01-21 17:41:30.000000000 +1100
  15. +++ repo-clean-0.1.3/src/repo-clean.cpp 2012-01-21 17:19:26.700577264 +1100
  16. @@ -36,6 +36,8 @@
  17.  
  18.  #define _(String) gettext (String)
  19.  #define foreach BOOST_FOREACH
  20. +#define ROOT "/"
  21. +#define DBPATH "/var/lib/pacman/"
  22.  
  23.  struct version_item
  24.  {
  25. @@ -201,13 +203,14 @@
  26.      // build comp_tree
  27.      arch_comparing_tree arch_comp_tree;
  28.      int total = list.size(), err = 0, ign = 0;
  29. -    alpm_initialize();
  30. +    alpm_handle_t *handle;
  31. +    handle = alpm_initialize(ROOT, DBPATH, NULL);
  32.      for (unsigned int i = 0; i < list.size(); i++)
  33.      {
  34.          // load package
  35. -        pmpkg_t *pkg= NULL;
  36. +        alpm_pkg_t *pkg= NULL;
  37.          std::string path = list[i];
  38. -        if (alpm_pkg_load(path.c_str(), 0, &pkg) == 0)
  39. +        if (alpm_pkg_load(handle, path.c_str(), 0, ALPM_SIG_USE_DEFAULT, &pkg) == 0)
  40.          {
  41.              std::string pkg_name = alpm_pkg_get_name(pkg);
  42.              std::string pkg_version = alpm_pkg_get_version(pkg);
  43. @@ -233,7 +236,7 @@
  44.          }
  45.      }
  46.      VERBOSE_PRINTF(_("%cTotal: %d  Ignored: %d  Corrupted: %d\n"), '\r', total, ign, err);
  47. -    alpm_release();
  48. +    alpm_release(handle);
  49.  
  50.      // check if comp_tree contain multiversion packages
  51.      bool found_multiversions = false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement