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

commit 8ab696fe7db94a8759cd34dc6368cf6980dfe5c2
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Mon Aug 30 09:03:58 2010 +0000

*some cleanup

diff --git a/frugal-mono-tools/PacmanG2.cs b/frugal-mono-tools/PacmanG2.cs
index 48e3643..52f97bd 100644
--- a/frugal-mono-tools/PacmanG2.cs
+++ b/frugal-mono-tools/PacmanG2.cs
@@ -36,87 +36,23 @@ namespace frugalmonotools
}
public class PacmanG2
{
-               //don't use c# binding generated by swig
-               const int PM_LOG_DEBUG=0x01;
-               const int PM_OPT_LOGCB = 1;
-               const int PM_OPT_LOGMASK =2;
-               const int PM_OPT_USESYSLOG=3;
-               const int PM_OPT_ROOT=4;
-               const int PM_OPT_DBPATH=5;
-               const int PM_OPT_CACHEDIR=6;
-               const int PM_OPT_LOGFILE=7;
-               const int PM_OPT_LOCALDB=8;
-               const int PM_OPT_SYNCDB=9;
-               const int PM_OPT_NOUPGRADE=10;
-               const int PM_OPT_NOEXTRACT=11;
-               const int PM_OPT_IGNOREPKG=12;
-               const int PM_OPT_UPGRADEDELAY=13;
-               /* Download */
-               const int PM_OPT_PROXYHOST=14;
-               const int PM_OPT_PROXYPORT=15;
-               const int PM_OPT_XFERCOMMAND=16;
-               const int PM_OPT_NOPASSIVEFTP=17;
-               const int PM_OPT_DLCB=18;
-               const int PM_OPT_DLFNM=19;
-               const int PM_OPT_DLOFFSET=20;
-               const int PM_OPT_DLT0=21;
-               const int PM_OPT_DLT=22;
-               const int PM_OPT_DLRATE=23;
-               const int PM_OPT_DLXFERED1=24;
-               const int PM_OPT_DLETA_H=25;
-               const int PM_OPT_DLETA_M=26;
-               const int PM_OPT_DLETA_S=27;
-               /* End of download */
-               const int PM_OPT_HOLDPKG=28;
-               const int PM_OPT_CHOMP=29;
-               const int PM_OPT_NEEDLES=30;
-               const int PM_OPT_MAXTRIES=31;
-               const int PM_OPT_OLDDELAY=32;
-               const int PM_OPT_DLREMAIN=33;
-               const int PM_OPT_DLHOWMANY=34;
-               const int PM_OPT_HOOKSDIR=35;
//const
private const string ROOT_PATH="/";
private const string PACMANG2_BDD="var/lib/pacman-g2/";
-               private const string PACMAN_LOCAL="local/";
+               private const string PACMANG2_LOCAL="local/";
private const int pm_errno = -1;
private const string cch_pacmanconf ="/etc/pacman-g2.conf";

//long maxPathLen = Syscall.pathconf("/", PathconfName._PC_PATH_MAX);

-               [StructLayout(LayoutKind.Sequential)]
-               public struct _pmlist_t
-               {
-                       object data;
-                       int prev;
-               int next;
-               int last;
-               }
-               [StructLayout(LayoutKind.Sequential)]
-               public struct _pmdb_t
-               {
-                       string path;
-                       [ MarshalAs( UnmanagedType.ByValTStr,
-               SizeConst=128 )]
-                       String treename;
-               }
-
[DllImport("libpacman.so")]
private static extern int pacman_initialize(string root);
[DllImport("libpacman.so")]
private static extern int pacman_parse_config(string file, EnumRepoProcDelegate 
callback,string this_section);
private delegate void EnumRepoProcDelegate(string section, string lParam);
[DllImport("libpacman.so")]
-               private static extern _pmdb_t pacman_db_register(string 
treename);
-               /*
-               [DllImport("libpacman.so")]
-               private static extern int pacman_set_option(int parm, string 
data);
-               [DllImport("libpacman.so")]
-               private static extern _pmlist_t pacman_db_search(_pmdb_t 
pmdb_t);
-               */
-
-               _pmdb_t pmdb_t;
-
+               private static extern void pacman_db_register(string treename);
+
//public
public string repoSelected="";
public List<string> fwRepo = new List<string>();
@@ -145,7 +81,6 @@ namespace frugalmonotools
public void SelectRepo(string repo)
{
if (repo==repoInstalled) repo ="local";
-                       //pmdb_t=pacman_db_register(repo);
repoSelected=repo;
}

@@ -202,7 +137,7 @@ namespace frugalmonotools

public bool IsInstalled(string strSearch)
{
-                       string dirpkg=ROOT_PATH+PACMANG2_BDD+PACMAN_LOCAL+"/";
+                       string dirpkg=ROOT_PATH+PACMANG2_BDD+PACMANG2_LOCAL+"/";
string[] dirs= Directory.GetDirectories(dirpkg,strSearch+"-*");
if (dirs.Length==0) return false;
bool Find = false;
@@ -211,7 +146,7 @@ namespace frugalmonotools
try
{
string tmp=dir;
-                                       
tmp=dir.Replace(ROOT_PATH+PACMANG2_BDD+PACMAN_LOCAL+strSearch,"");
+                                       
tmp=dir.Replace(ROOT_PATH+PACMANG2_BDD+PACMANG2_LOCAL+strSearch,"");
//tmp contain -1.1.19-1, should find only 2 - for be the same package
int count = Regex.Matches(tmp, "-").Count;
if (count==2)
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to