[Frugalware-git] frugal-mono-tools: *read description

bouleetbil bouleetbil at frogdev.info
Mon Aug 30 11:44:15 CEST 2010


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

commit f433d3e0f8fbce75b7bc155ffc18738fbb4c74cb
Author: bouleetbil <bouleetbil at frogdev.info>
Date:   Mon Aug 30 12:07:58 2010 +0000

*read description

diff --git a/frugal-mono-tools/PacmanG2.cs b/frugal-mono-tools/PacmanG2.cs
index 52f97bd..d11d61e 100644
--- a/frugal-mono-tools/PacmanG2.cs
+++ b/frugal-mono-tools/PacmanG2.cs
@@ -32,6 +32,7 @@ namespace frugalmonotools
public string pkgversion;
public string pkggroup;
public string pkgdescription;
+			public bool force;

}
public class PacmanG2
@@ -100,15 +101,37 @@ namespace frugalmonotools

string tmpname=dir.Replace(dirpkg,"");
package.pkgname=extractNamePackage(tmpname);
-				package.pkgdescription="";
-				package.pkggroup="";
package.pkgversion=extractVersionPackage(tmpname);
-                //TODO extract description/group from file desc and extract version from name
+				package.pkgdescription=_getDescription(package.pkgname+"-"+package.pkgversion,repo);
+				package.pkggroup="";
+				package.force=false;
+                //TODO extract group from file desc and extract version from name
packages.Add(package);
}
return packages;
}

+		private string _getDescription(string Package,string repo)
+		{
+			string filedesc = ROOT_PATH+PACMANG2_BDD+"/"+repo+"/"+Package+"/desc";
+			string content = Outils.ReadFile(filedesc);
+			string[] lines = content.Split('\n');
+			bool FindDescr = false;
+            foreach (string line in lines)
+            {
+				if(FindDescr)
+				{
+					content=line;
+					break;
+				}
+				if (line=="%DESC%")
+					FindDescr=true;
+
+			}
+			return content;
+
+		}
+
public string extractNamePackage(string file)
{
string[] words = file.Split('-');


More information about the Frugalware-git mailing list