Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37400297
en ru br
Репозитории ALT
S:2.1.41-alt23
5.1: 2.1.41-alt9
4.1: 2.1.41-alt3.M41.1
4.0: 2.1.35-alt5
3.0: 2.1.25-alt3
+backports:2.1.29-alt4.0.M30
www.altlinux.org/Changes

Группа :: Система/Основа
Пакет: menu

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

Патч: menu-2.1.14-rpm.patch
Скачать


diff -uNrp menu-2.1.14.old/update-menus/common.h menu-2.1.14/update-menus/common.h
--- menu-2.1.14.old/update-menus/common.h	2004-05-17 20:43:35 +0400
+++ menu-2.1.14/update-menus/common.h	2004-06-18 17:53:32 +0400
@@ -37,7 +37,7 @@ const int MAX_LINE = 10240;
 #define USERMETHODS     ".menu-methods/"
 
 #define UPMEN_LOCKFILE  "/var/run/update-menus.pid"
-#define DPKG_LOCKFILE   "/var/lib/dpkg/lock"
+#define RPM_LOCKFILE   "/var/lib/rpm/Packages"
 #define TRANSLATE_FILE  "/etc/menu-methods/translate_menus"
 #define USERTRANSLATE   ".menu-methods/translate_menus"
 #define CONFIG_FILE     "/etc/menu-methods/menu.config"
diff -uNrp menu-2.1.14.old/update-menus/update-menus.cc menu-2.1.14/update-menus/update-menus.cc
--- menu-2.1.14.old/update-menus/update-menus.cc	2004-05-24 16:38:44 +0400
+++ menu-2.1.14/update-menus/update-menus.cc	2004-06-18 17:53:32 +0400
@@ -427,7 +427,7 @@ void read_pkginfo()
 {
   // Here we get the list of *installed* packages from dpkg, using sed to
   // retrieve the package name.
-  char *pkgs = "dpkg-query --show --showformat='${status} ${package}\\n' | sed -n -e 's/.*installed *//p'";
+  char *pkgs = "rpm -qa --provides --queryformat '%{NAME}\n'";
   FILE *status = popen(pkgs, "r");
 
   if (!status)
@@ -719,11 +719,11 @@ int check_dpkglock()
     config.report(_("Update-menus is run by user."), configinfo::report_verbose);
     return 0;
   }
-  fl.l_type = F_WRLCK;
+  fl.l_type = F_RDLCK;
   fl.l_whence = SEEK_SET;
   fl.l_start = 0;
   fl.l_len = 0;
-  fd = open(DPKG_LOCKFILE, O_RDWR|O_CREAT|O_TRUNC, 0660);
+  fd = open(RPM_LOCKFILE,O_RDONLY, 0644);
   if (fd == -1)
     /* Probably /var/lib/dpkg does not exist.
      * Most probably dpkg is not running.
@@ -800,8 +800,8 @@ void wait_dpkg(string &stdoutfile)
       r = create_lock();
       if (r) {
         stdoutfile = string("/tmp/update-menus.")+itostring(getpid());
-        config.report(String::compose(_("Waiting for dpkg to finish (forking to background).\n"
-            "(checking %1)"), DPKG_LOCKFILE),
+        config.report(String::compose(_("Waiting for rpm to finish (forking to background).\n"
+            "(checking %1)"), RPM_LOCKFILE),
             configinfo::report_normal);
         config.report(String::compose(_("Further output (if any) will appear in %1."), stdoutfile),
             configinfo::report_normal);
@@ -812,8 +812,17 @@ void wait_dpkg(string &stdoutfile)
         }
         kill(parentpid, SIGUSR2);
 
-        while(check_dpkglock())
-            sleep(2);
+	int n_unlocks = 0;
+        while(true)
+	{
+	    if( check_dpkglock() )
+		n_unlocks = 0;
+	    else
+		n_unlocks++;
+	    if( n_unlocks > 5 )
+		break;
+            sleep(1);
+	}
       } else {
         // Exit without doing anything. Kill parent too!
         kill(parentpid,SIGUSR2);
@@ -825,7 +834,7 @@ void wait_dpkg(string &stdoutfile)
     if (!r)
         exit(1);
 
-    config.report(_("Dpkg is not locking dpkg status area, good."),
+    config.report(_("RPM is not locking rpm status area, good."),
         configinfo::report_verbose);
   }
 }
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin