Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1584494
 поиск   регистрация   авторизация 
 
Группа :: Система/Настройка/Пакеты
Пакет: aptitude

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

Патч: aptitude-0.3.1-alt-cnc-rpm.patch


diff -urN aptitude-0.3.1-orig/configure.ac aptitude-0.3.1/configure.ac
--- aptitude-0.3.1-orig/configure.ac	2005-01-11 03:06:25 +0300
+++ aptitude-0.3.1/configure.ac	2005-01-30 20:29:56 +0300
@@ -23,6 +23,15 @@
 	HAVE_LIBPTHREAD=1
 	, [AC_MSG_WARN([Can't find the POSIX thread libraries -- configuring without threads])])
 
+dnl popt checking
+AC_CHECK_LIB(popt, main,
+      HAVE_POPT=1,
+              AC_MSG_ERROR([Can't find the popt library -- please install popt-devel package]))
+dnl rpm checking
+AC_CHECK_LIB(rpm, main,
+      HAVE_RPM=1,
+              AC_MSG_ERROR([Can't find the rpm library -- please install librpm-devel package]))
+
 ALL_LINGUAS="ar bs ca cs da de el es eu fi fr gl it ja lt nb nl nn pl pt pt_BR ro ru sk tr zh_CN zh_TW"
 AM_GNU_GETTEXT
 
@@ -139,6 +148,24 @@
 	[AC_MSG_WARN([POSIX thread header not installed -- configuring without threading support])])
 fi
 
+if test x$HAVE_RPM = x1
+then
+  AC_CHECK_HEADER(rpm/rpmio.h,
+              CXXFLAGS="$CXXFLAGS -I/usr/include/rpm"
+              LDFLAGS="$LDFLAGS -lrpm"
+              [AC_DEFINE(HAVE_RPM,  , [Define if rpm is available])],
+              [AC_MSG_ERROR([RPM headers not found. Please verify your build system.])])
+fi
+
+if test x$HAVE_POPT = x1
+then
+      AC_CHECK_HEADER(popt.h,
+              CXXFLAGS="$CXXFLAGS"
+              LDFLAGS="$LDFLAGS -lpopt"
+              [AC_DEFINE(HAVE_POPT,  , [Define if popt is available])],
+              [AC_MSG_ERROR([POPT headers not found. Please verify your build system.])])
+fi
+
 WERROR="-Werror"
 
 AC_ARG_ENABLE(werror,
diff -urN aptitude-0.3.1-orig/src/cmdline/cmdline_prompt.cc aptitude-0.3.1/src/cmdline/cmdline_prompt.cc
--- aptitude-0.3.1-orig/src/cmdline/cmdline_prompt.cc	2004-12-04 03:57:11 +0300
+++ aptitude-0.3.1/src/cmdline/cmdline_prompt.cc	2005-01-30 20:29:56 +0300
@@ -18,10 +18,10 @@
 #include <vscreen/vscreen.h>
 
 #include <apt-pkg/algorithms.h>
-#include <apt-pkg/dpkgpm.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/sourcelist.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/pkgsystem.h>
 
 using namespace std;
 
@@ -43,7 +43,7 @@
   if(!l.ReadMainList())
     return _error->Error(_("Couldn't read list of sources"));
 
-  pkgDPkgPM pm(*apt_cache_file);
+  pkgPackageManager &pm = *_system->CreatePM(*apt_cache_file);
   pm.GetArchives(&fetcher, &l, apt_package_records);
 
   f.FetchBytes=fetcher.FetchNeeded();
diff -urN aptitude-0.3.1-orig/src/dep_item.cc aptitude-0.3.1/src/dep_item.cc
--- aptitude-0.3.1-orig/src/dep_item.cc	2004-12-04 03:57:16 +0300
+++ aptitude-0.3.1/src/dep_item.cc	2005-01-30 20:29:56 +0300
@@ -30,7 +30,8 @@
 #include "generic/apt.h"
 #include "generic/config_signal.h"
 
-#include <apt-pkg/version.h>
+#include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/configuration.h>
 
 using namespace std;
 using namespace __gnu_cxx;
diff -urN aptitude-0.3.1-orig/src/desc_parse.cc aptitude-0.3.1/src/desc_parse.cc
--- aptitude-0.3.1-orig/src/desc_parse.cc	2004-12-04 08:13:10 +0300
+++ aptitude-0.3.1/src/desc_parse.cc	2005-01-30 20:30:51 +0300
@@ -16,13 +16,6 @@
   string::size_type loc=0;
   vector<fragment*> fragments;
 
-  // Skip the short description
-  while(loc<desc.size() && desc[loc]!='\n')
-    ++loc;
-
-  if(loc<desc.size()) // Skip the '\n'
-    ++loc;
-
   while(loc<desc.size())
     {
       // We're at the beginning of a line here.
@@ -38,6 +31,7 @@
       switch(desc[loc])
 	{
 	case ' ':
+	case '\t':
 	  // preformatted:
 	  {
 	    ++loc;
@@ -56,6 +50,7 @@
 	    break;
 	  }
 	case '.':
+	case '\n':
 	  // blank.
 	  {
 	    fragments.push_back(newline_fragment());
@@ -97,7 +92,7 @@
 	      // that packages whose descriptions end with '\nX'
 	      // where X!=' ' will be displayed oddly, but such
 	      // descriptions are noncompliant anyway.
-	      if(!(loc+1<desc.size() && desc[loc+1]!=' ' && desc[loc+1]!='.'))
+	      if(!(loc+1<desc.size() && desc[loc+1]!=' ' && desc[loc+1]!='\t' && desc[loc+1]!='.' && desc[loc+1]!='\n'))
 		cont=false;
 	      else
 		++loc;
diff -urN aptitude-0.3.1-orig/src/download.cc aptitude-0.3.1/src/download.cc
--- aptitude-0.3.1-orig/src/download.cc	2005-01-10 10:28:50 +0300
+++ aptitude-0.3.1/src/download.cc	2005-01-30 20:29:56 +0300
@@ -34,7 +34,6 @@
 #include <apt-pkg/init.h>
 #include <apt-pkg/clean.h>
 #include <apt-pkg/error.h>
-#include <apt-pkg/dpkgpm.h>
 #include <apt-pkg/packagemanager.h>
 #include <apt-pkg/sourcelist.h>
 #include <apt-pkg/acquire.h>
@@ -227,7 +226,7 @@
 
   time_t curtime=time(NULL);
   fprintf(f, "Aptitude " VERSION ": %s\n%s\n\n", _("log report"), ctime(&curtime));
-  fprintf(f, _("IMPORTANT: this log only lists intended actions; actions which fail due to\ndpkg problems may not be completed.\n\n"));
+  fprintf(f, _("IMPORTANT: this log only lists intended actions; actions which fail due to\nrpm problems may not be completed.\n\n"));
   fprintf(f, _("Will install %li packages, and remove %li packages.\n"), (*apt_cache_file)->InstCount(), (*apt_cache_file)->DelCount());
   if((*apt_cache_file)->UsrSize()>0)
     fprintf(f, _("%sB of disk space will be used\n"),
@@ -346,7 +345,7 @@
     }
 
   // Make a package manager, get ready to download
-  pkgDPkgPM pm(*apt_cache_file);
+  pkgPackageManager &pm = *_system->CreatePM(*apt_cache_file);
   if(!pm.GetArchives(&fetcher, &list, apt_package_records) || _error->PendingError())
     {
       _error->Error(_("Internal error: couldn't generate list of packages to download"));
@@ -462,9 +461,8 @@
 	{
 	case pkgPackageManager::Failed:
 	  _error->DumpErrors();
-	  cerr<<_("Ack!  Something bad happened while installing packages.  Trying to recover:")<<endl;
+	  cerr<<_("Ack!  Something bad happened while installing packages.")<<endl;
 	  // and this is really a hack:
-	  system("dpkg --configure -a");
 	  _error->Discard();
 	  ok=false;
 
@@ -503,7 +501,7 @@
       if(!apt_cache_file->GainLock())
 	// This really shouldn't happen.
 	{
-	  _error->Error(_("Could not regain the system lock!  (Perhaps another apt or dpkg is running?)"));
+	  _error->Error(_("Could not regain the system lock!  (Perhaps another apt or rpm is running?)"));
 	  ok=false;
 	  break;
 	}
diff -urN aptitude-0.3.1-orig/src/download_item.cc aptitude-0.3.1/src/download_item.cc
--- aptitude-0.3.1-orig/src/download_item.cc	2004-12-04 05:05:32 +0300
+++ aptitude-0.3.1/src/download_item.cc	2005-01-30 20:29:56 +0300
@@ -41,8 +41,11 @@
 	return get_color("DownloadHit");
     case pkgAcquire::Item::StatError:
       return get_color("Error");
+// Not yet implemented in apt 0.5
+#if 0
     case pkgAcquire::Item::StatAuthError:
       return get_color("Error");
+#endif
     default:
       assert(0);
     }
@@ -106,8 +109,11 @@
     case pkgAcquire::Item::StatError:
       output+=item.Owner->ErrorText;
       break;
+// Not yet implemented in apt 0.5
+#if 0
     case pkgAcquire::Item::StatAuthError:
       output+=item.Owner->ErrorText;
+#endif
     }
 
   win->mvaddnstr(y, 0, output.c_str(), width);
diff -urN aptitude-0.3.1-orig/src/generic/apt.cc aptitude-0.3.1/src/generic/apt.cc
--- aptitude-0.3.1-orig/src/generic/apt.cc	2005-01-11 02:52:02 +0300
+++ aptitude-0.3.1/src/generic/apt.cc	2005-01-30 20:29:56 +0300
@@ -474,6 +474,8 @@
 
 bool package_trusted(const pkgCache::VerIterator &ver)
 {
+// Not yet implemented in apt 0.5
+#if 0
   for(pkgCache::VerFileIterator i = ver.FileList(); !i.end(); ++i)
     {
       pkgIndexFile *index;
@@ -481,6 +483,6 @@
       if(apt_source_list->FindIndex(i.File(), index) && !index->IsTrusted())
 	return false;
     }
-
+#endif
   return true;
 }
diff -urN aptitude-0.3.1-orig/src/generic/matchers.cc aptitude-0.3.1/src/generic/matchers.cc
--- aptitude-0.3.1-orig/src/generic/matchers.cc	2004-12-04 05:15:15 +0300
+++ aptitude-0.3.1/src/generic/matchers.cc	2005-01-30 20:29:56 +0300
@@ -40,7 +40,7 @@
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/pkgrecords.h>
 #include <apt-pkg/pkgsystem.h>
-#include <apt-pkg/version.h>
+#define pkgCheckDep _system->checkDep
 
 #include <assert.h>
 #include <ctype.h>
diff -urN aptitude-0.3.1-orig/src/generic/matchers.h aptitude-0.3.1/src/generic/matchers.h
--- aptitude-0.3.1-orig/src/generic/matchers.h	2004-12-04 03:57:13 +0300
+++ aptitude-0.3.1/src/generic/matchers.h	2005-01-30 20:29:56 +0300
@@ -24,6 +24,7 @@
 #define MATCHERS_H
 
 #include <apt-pkg/pkgcache.h>
+#include <apt-pkg/version.h>
 
 class pkg_matcher
 // A closure describing a matching rule.  Note that we match on a particular
diff -urN aptitude-0.3.1-orig/src/generic/tasks.cc aptitude-0.3.1/src/generic/tasks.cc
--- aptitude-0.3.1-orig/src/generic/tasks.cc	2004-12-04 05:15:25 +0300
+++ aptitude-0.3.1/src/generic/tasks.cc	2005-01-30 20:29:57 +0300
@@ -63,49 +63,6 @@
   // This should never be called before load_tasks has initialized the
   // tasks structure.
   assert(tasks_by_package);
-
-  list<string> &lst=tasks_by_package[pkg->ID];
-
-  lst.clear();
-
-  if(apt_package_records)
-    {
-      const char *start,*stop;
-      pkgTagSection sec;
-
-      // Pull out pointers to the underlying record.
-      apt_package_records->Lookup(verfile).GetRec(start, stop);
-
-      // Parse it as a section.
-      sec.Scan(start, stop-start+1);
-
-      string tasks=sec.FindS("Task");
-
-      string::size_type loc=0, firstcomma=0;
-
-      // Strip leading whitespace
-      while(loc<tasks.size() && isspace(tasks[loc]))
-	++loc;
-
-      while( (firstcomma=tasks.find(',', loc))!=tasks.npos)
-	{
-	  // Strip trailing whitespace
-	  string::size_type loc2=firstcomma-1;
-	  while(isspace(tasks[loc2]))
-	    --loc2;
-	  ++loc2;
-
-	  lst.push_back(string(tasks, loc, loc2-loc));
-	  loc=firstcomma+1;
-
-	  // Strip leading whitespace
-	  while(loc<tasks.size() && isspace(tasks[loc]))
-	    ++loc;
-	}
-
-      if(loc!=tasks.size())
-	lst.push_back(string(tasks, loc));
-    }
 }
 
 bool task::keys_present()
diff -urN aptitude-0.3.1-orig/src/pkg_columnizer.cc aptitude-0.3.1/src/pkg_columnizer.cc
--- aptitude-0.3.1-orig/src/pkg_columnizer.cc	2004-12-04 05:32:28 +0300
+++ aptitude-0.3.1/src/pkg_columnizer.cc	2005-01-30 20:29:57 +0300
@@ -34,6 +34,10 @@
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/version.h>
 
+#ifndef HAVE_LIBAPT_PKG3
+#define pkgCheckDep _system->checkDep
+#endif
+
 #include <unistd.h>
 
 column_definition_list *pkg_item::pkg_columnizer::columns=NULL;
diff -urN aptitude-0.3.1-orig/src/pkg_info_screen.cc aptitude-0.3.1/src/pkg_info_screen.cc
--- aptitude-0.3.1-orig/src/pkg_info_screen.cc	2004-12-04 08:24:18 +0300
+++ aptitude-0.3.1/src/pkg_info_screen.cc	2005-01-30 20:29:57 +0300
@@ -81,7 +81,7 @@
       pkgRecords::Parser &rec=apt_package_records->Lookup(ver.FileList());
 
       string desc=apt_package_records->Lookup(ver.FileList()).LongDesc();
-      string shortdesc=string(desc, 0, desc.find('\n'));
+      string shortdesc=apt_package_records->Lookup(ver.FileList()).ShortDesc();
 
       vector<fragment*> frags;
 
diff -urN aptitude-0.3.1-orig/src/pkg_ver_item.cc aptitude-0.3.1/src/pkg_ver_item.cc
--- aptitude-0.3.1-orig/src/pkg_ver_item.cc	2004-12-04 05:29:26 +0300
+++ aptitude-0.3.1/src/pkg_ver_item.cc	2005-01-30 20:29:57 +0300
@@ -47,6 +47,8 @@
 
 using namespace std;
 
+#define pkgCheckDep _system->checkDep
+
 class pkg_ver_columnizer:public pkg_item::pkg_columnizer
 {
   bool show_pkg_name;
diff -urN aptitude-0.3.1-orig/src/pkg_ver_item.h aptitude-0.3.1/src/pkg_ver_item.h
--- aptitude-0.3.1-orig/src/pkg_ver_item.h	2004-12-04 03:57:10 +0300
+++ aptitude-0.3.1/src/pkg_ver_item.h	2005-01-30 20:29:57 +0300
@@ -30,9 +30,13 @@
 #include "pkg_grouppolicy.h"
 #include "pkg_item_with_subtree.h"
 
-#include <apt-pkg/version.h>
 #include <apt-pkg/depcache.h>
 #include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/version.h>
+
+#ifndef HAVE_LIBAPT_PKG3
+#define pkgVersionCompare _system->versionCompare
+#endif
 
 class pkg_ver_item:public pkg_tree_node
 {
diff -urN aptitude-0.3.1-orig/src/vs_progress.cc aptitude-0.3.1/src/vs_progress.cc
--- aptitude-0.3.1-orig/src/vs_progress.cc	2004-12-06 04:35:58 +0300
+++ aptitude-0.3.1/src/vs_progress.cc	2005-01-30 20:29:57 +0300
@@ -31,7 +31,8 @@
 
   if(!Op.empty())
     {
-      assert(Percent>=0 && Percent<=100);
+	  if ( Percent > 100 )
+		  Percent = 100;
       barsize=int(Percent*width/100.0);
 
       snprintf(percent_string, 50, ": %i%%", int(Percent));
 
design & coding: Vladimir Lettiev aka crux © 2004-2005