Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37514315
en ru br
Репозитории ALT
S:0.5.15lorg2-alt86
5.1: 0.5.15lorg2-alt33.M50P.1
4.1: 0.5.15lorg2-alt20.M41.1
4.0: 0.5.15lorg2-alt18.M40.1
+updates:0.5.15lorg2-alt18
3.0: 0.5.15cnc6-alt16
www.altlinux.org/Changes

Группа :: Система/Настройка/Пакеты
Пакет: apt

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

Патч: apt-0.5.15cnc6-alt-rpm-fancypercent.patch
Скачать


2004-01-16  Dmitry V. Levin <ldv@altlinux.org>
	* apt-pkg/rpm/rpmpm.cc(pkgRPMPM::ExecRPM,pkgRPMLibPM::Process):
	Honor "quiet" config option.
	Pass "fancypercent" option.
--- apt-0.5.15cnc5/apt-pkg/rpm/rpmpm.cc.orig	2004-05-11 15:08:07 +0400
+++ apt-0.5.15cnc5/apt-pkg/rpm/rpmpm.cc	2004-05-11 15:19:12 +0400
@@ -390,6 +390,7 @@
    const char *operation;
    unsigned int n = 0;
    bool Interactive = _config->FindB("RPM::Interactive",true);
+   int quiet = _config->FindI("quiet",0);
    
    Args[n++] = _config->Find("Dir::Bin::rpm","rpm").c_str();
 
@@ -398,18 +399,12 @@
    switch (op)
    {
       case Item::RPMInstall:
-	 if (Interactive)
-	    operation = "-ivh";
-	 else
-	    operation = "-iv";
+	 operation = "-i";
 	 nodeps = true;
 	 break;
 
       case Item::RPMUpgrade:
-	 if (Interactive)
-	    operation = "-Uvh";
-	 else
-	    operation = "-Uv";
+	 operation = "-U";
 	 break;
 
       case Item::RPMErase:
@@ -421,8 +416,22 @@
    }
    Args[n++] = operation;
 
-   if (Interactive == false && op != Item::RPMErase)
-      Args[n++] = "--percent";
+	if (quiet <= 2 && op != Item::RPMErase)
+	{
+		Args[n++] = "-v";
+		if (quiet <= 1)
+		{
+			if (Interactive)
+			{
+				Args[n++] = "-h";
+				if (quiet <= 0)
+					Args[n++] = "--fancypercent";
+			} else
+			{
+				Args[n++] = "--percent";
+			}
+		}
+	}
     
    string rootdir = _config->Find("RPM::RootDir", "");
    if (!rootdir.empty()) 
@@ -551,6 +560,7 @@
       return true;
    }
 
+   if (quiet <= 2)
    cout << _("Executing RPM (")<<cmd<<")..." << endl;
 
    cout << flush;
@@ -631,7 +641,7 @@
       return _error->Error(_("Sub-process %s exited unexpectedly"),Args[0]);
    }
 
-   if (Interactive == true)
+   if (quiet <= 2)
       cout << _("Done.") << endl;
 
    return true;
@@ -749,6 +759,7 @@
    bool Success = false;
    bool Interactive = _config->FindB("RPM::Interactive",true);
    string Dir = _config->Find("RPM::RootDir");
+   int quiet = _config->FindI("quiet",0);
    rpmReadConfigFiles(NULL, NULL);
 
    int probFilter = 0;
@@ -795,10 +806,21 @@
       probFilter |= RPMPROB_FILTER_REPLACENEWFILES;
    }
 
-   if (Interactive == true)
-       notifyFlags |= INSTALL_LABEL | INSTALL_HASH;
-   else
-       notifyFlags |= INSTALL_LABEL | INSTALL_PERCENT;
+    if (quiet <= 2)
+	notifyFlags |= INSTALL_LABEL;
+
+    if (quiet <= 1)
+    {
+	if (Interactive == true)
+	{
+	    notifyFlags |= INSTALL_HASH;
+	    extern int fancyPercents;
+	    fancyPercents = (quiet <= 0) ? 1 : 0;
+	} else
+	{
+		notifyFlags |= INSTALL_PERCENT;
+	}
+    }
 
    if (uninstall.empty() == false)
        AddToTransaction(Item::RPMErase, uninstall);
@@ -854,6 +877,7 @@
       goto exit;
    }
 
+   if (quiet <= 2)
    cout << _("Committing changes...") << endl << flush;
 
 #if RPM_VERSION >= 0x040100
@@ -877,7 +901,7 @@
       Success = true;
       if (rc < 0)
 	 _error->Warning(_("Some errors occurred while running transaction"));
-      else if (Interactive == true)
+      else if (quiet <= 2)
 	 cout << _("Done.") << endl;
    }
    rpmpsFree(probs);
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin