Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-mono-tools.git;a=commitdiff;h=90c04f10d417db2985c72a29873e7b9f0924db19

commit 90c04f10d417db2985c72a29873e7b9f0924db19
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Mon Aug 30 17:07:18 2010 +0000

*check force option

diff --git a/frugal-mono-tools/PacmanG2.cs b/frugal-mono-tools/PacmanG2.cs
index 5aea036..a7599a0 100644
--- a/frugal-mono-tools/PacmanG2.cs
+++ b/frugal-mono-tools/PacmanG2.cs
@@ -131,7 +131,7 @@ namespace frugalmonotools
package.pkgversion=extractVersionPackage(tmpname);
package.pkgdescription=_getDescription(package.pkgname+"-"+package.pkgversion,repo);
package.pkggroup="";
-                               
package.force=_PackageForce(package.pkgname+"-"+package.pkgversion,repo);
+                               
package.force=ShouldPackageForce(package.pkgname+"-"+package.pkgversion,repo);
//TODO extract group from file desc and extract version from name
packages.Add(package);
}
@@ -142,7 +142,19 @@ namespace frugalmonotools
return _getDescription(Package, repo);

}
-               private bool _PackageForce(string Package,string repo)
+               /// <summary>
+               ///
+               /// </summary>
+               /// <param name="Package">
+               /// A <see cref="PAckage contain version !"/>
+               /// </param>
+               /// <param name="repo">
+               /// A <see cref="System.String"/>
+               /// </param>
+               /// <returns>
+               /// A <see cref="System.Boolean"/>
+               /// </returns>
+               public static bool ShouldPackageForce(string Package,string 
repo)
{
string filedesc = ROOT_PATH+PACMANG2_BDD+"/"+repo+"/"+Package+"/desc";
string content = Outils.ReadFile(filedesc);
diff --git a/frugal-mono-tools/Update.cs b/frugal-mono-tools/Update.cs
index 58ac823..372114b 100644
--- a/frugal-mono-tools/Update.cs
+++ b/frugal-mono-tools/Update.cs
@@ -9,6 +9,7 @@ namespace frugalmonotools
{
public string packagename;
public string packageversion;
+               public string repo;
}

public static class Update
@@ -44,8 +45,13 @@ namespace frugalmonotools

if(pkg.packagename==pkginstall.packagename)
{
-                                               //TODO don't forgot 
options=("force")
-                                               
if(string.Compare(pkginstall.packageversion,pkg.packageversion)<0)
+                                               bool AddIt = false;
+                                               
if(string.Compare(pkginstall.packageversion,pkg.packageversion)<0)
+                                                       AddIt =true;
+                                               //check force read info only 
here for startup more quickly
+                                               if 
(PacmanG2.ShouldPackageForce(pkg.packagename+"-"+pkg.packageversion,pkg.repo))
+                                                       AddIt=true;
+                                               if(AddIt)
{
UpdatePkg.Add(pkg);
}
@@ -100,7 +106,6 @@ namespace frugalmonotools
bool AddIt = true;
foreach (string pkgignore in MainClass.pacmanG2.ignorePkg)
{
-
if(pkgignore==MainClass.pacmanG2.extractNamePackage(package.pkgname)) AddIt 
=false;
if(MainClass.pacmanG2.extractNamePackage(pkgignore)==MainClass.pacmanG2.extractNamePackage(package.pkgname))
 AddIt =false;

@@ -122,6 +127,7 @@ namespace frugalmonotools
packageCheck pkgrepo = new packageCheck();
pkgrepo.packagename=package.pkgname;
pkgrepo.packageversion=package.pkgversion;
+                                               pkgrepo.repo=repo;
pkgs.Add(pkgrepo);
}
}
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to