Mailinglist Archive: zypp-commit (325 mails)

< Previous Next >
[zypp-commit] r7128 - in /trunk/libzypp/devel/devel.shaas/src: Makefile Makefile.PL Makefile.no PdbToZypp.i install.pl pdbtozypp.cc pdbtozypp.h
  • From: haass@xxxxxxxxxxxxxxxx
  • Date: Thu, 06 Sep 2007 15:00:17 -0000
  • Message-id: <20070906150017.A67D9267FB@xxxxxxxxxxxxxxxx>
Author: haass
Date: Thu Sep  6 17:00:17 2007
New Revision: 7128

URL: http://svn.opensuse.org/viewcvs/zypp?rev=7128&view=rev
Log:
added swig-file + several changes

Added:
    trunk/libzypp/devel/devel.shaas/src/Makefile.PL
    trunk/libzypp/devel/devel.shaas/src/Makefile.no
    trunk/libzypp/devel/devel.shaas/src/PdbToZypp.i
    trunk/libzypp/devel/devel.shaas/src/install.pl
Removed:
    trunk/libzypp/devel/devel.shaas/src/Makefile
Modified:
    trunk/libzypp/devel/devel.shaas/src/pdbtozypp.cc
    trunk/libzypp/devel/devel.shaas/src/pdbtozypp.h

Added: trunk/libzypp/devel/devel.shaas/src/Makefile.PL
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.shaas/src/Makefile.PL?rev=7128&view=auto
==============================================================================
--- trunk/libzypp/devel/devel.shaas/src/Makefile.PL (added)
+++ trunk/libzypp/devel/devel.shaas/src/Makefile.PL Thu Sep  6 17:00:17 2007
@@ -0,0 +1,7 @@
+# File : Makefile.PL
+use ExtUtils::MakeMaker;
+WriteMakefile(
+   'NAME'    => 'rpdbtozypp',                # Name of package
+   'LIBS'    => '-lm -lzypp -lpdbtozypp',                    # Name of custom libraries
+   'OBJECT'  => 'PdbToZypp_wrap.o /usr/lib/perl5/5.8.8/i586-linux-thread-multi/zypp.so'  # Object files
+);

Added: trunk/libzypp/devel/devel.shaas/src/Makefile.no
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.shaas/src/Makefile.no?rev=7128&view=auto
==============================================================================
--- trunk/libzypp/devel/devel.shaas/src/Makefile.no (added)
+++ trunk/libzypp/devel/devel.shaas/src/Makefile.no Thu Sep  6 17:00:17 2007
@@ -0,0 +1,59 @@
+####### Compiler, tools and options
+
+CC            = gcc
+CXX           = g++
+DEFINES       =  
+CFLAGS        = -pipe -O2 -Wall -W -fpic -D_REENTRANT  $(DEFINES)
+CXXFLAGS      = -pipe -O2 -Wall -W -fpic -D_REENTRANT  $(DEFINES)
+INCPATH       = -I/usr/include -I. -I. -I.
+LINK          = g++
+LFLAGS        = -shared -lmysqlclient
+LIBS          = $(SUBLIBS)  -L/usr/lib
+
+####### Output directory
+
+OBJECTS_DIR   = ./
+
+####### Files
+
+SOURCES       = db.cc resolvable.h pdbtozypp.cc 
+OBJECTS       = db.o pdbtozypp.o
+OBJCOMP                  = /usr/lib/libzypp.so 
+DESTDIR       = 
+TARGET        = libpdbtozypp.so
+
+first: all
+####### Implicit rules
+
+.SUFFIXES: .o .c .cpp .cc .cxx .C
+
+.cpp.o:
+       $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.cc.o:
+       $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.cxx.o:
+       $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.C.o:
+       $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.c.o:
+       $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
+
+####### Build rules
+
+all: Makefile.no $(TARGET)
+
+$(TARGET):  $(OBJECTS)  
+       $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
+
+swig:
+       swig -c++ -perl5 PdbToZypp.i
+
+install: 
+       install --mode=644 db.h /usr/include/pdbtozypp/
+       install --mode=644 resolvable.h /usr/include/pdbtozypp/
+       install --mode=644 pdbtozypp.h /usr/include/pdbtozypp/
+       install --mode=555 libpdbtozypp.so /usr/lib/

Added: trunk/libzypp/devel/devel.shaas/src/PdbToZypp.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.shaas/src/PdbToZypp.i?rev=7128&view=auto
==============================================================================
--- trunk/libzypp/devel/devel.shaas/src/PdbToZypp.i (added)
+++ trunk/libzypp/devel/devel.shaas/src/PdbToZypp.i Thu Sep  6 17:00:17 2007
@@ -0,0 +1,18 @@
+%module rpdbtozypp
+%{
+#undef NORMAL
+#include "pdbtozypp.h"
+using namespace zypp;
+%}
+
+class PdbToZypp{
+       public:
+      //typedef zypp::ResStore ResStore;
+               //PdbToZypp(zypp::ResStore  & _store);
+               PdbToZypp();
+      ~PdbToZypp();
+      void readOut();
+      ResStore getStore();
+   private:
+      ResStore store;
+};

Added: trunk/libzypp/devel/devel.shaas/src/install.pl
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.shaas/src/install.pl?rev=7128&view=auto
==============================================================================
--- trunk/libzypp/devel/devel.shaas/src/install.pl (added)
+++ trunk/libzypp/devel/devel.shaas/src/install.pl Thu Sep  6 17:00:17 2007
@@ -0,0 +1,12 @@
+print "Build libpdbtozypp.so\n";
+`make -f Makefile.no`;
+print "Install libpdbtozypp.so\n";
+`make -f Makefile.no install`;
+print "Build swig-binding\n";
+`make -f Makefile.no swig`;
+print "Build Makefile for perl-module with MakeMaker\n";
+`perl Makefile.PL`;
+print "Build perl-module\n";
+`make`;
+print "Install perl-module\n";
+`make install`;

Modified: trunk/libzypp/devel/devel.shaas/src/pdbtozypp.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.shaas/src/pdbtozypp.cc?rev=7128&r1=7127&r2=7128&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.shaas/src/pdbtozypp.cc (original)
+++ trunk/libzypp/devel/devel.shaas/src/pdbtozypp.cc Thu Sep  6 17:00:17 2007
@@ -5,11 +5,19 @@
 
 //Constructor
 PdbToZypp::PdbToZypp(){
+   //store = _store;
+}
+
+PdbToZypp::~PdbToZypp(){
+
+}
+
+void PdbToZypp::readOut(){
 
-   store = new ResStore;
+   //store = new ResStore;
 
-       database *dbDeps = new database("lorien.suse.de", "rpmread", "***", "rpm");
-       database *dbPackages = new database("lorien.suse.de", "rpmread", "***", "package");
+       database *dbDeps = new database("lorien.suse.de", "rpmread", "rrrrrrr", "rpm");
+       database *dbPackages = new database("lorien.suse.de", "rpmread", "rrrrrrr", "package");
 
        if(dbPackages->connect() != 1){
                //std::cout << "NO DB CONNECTION!!!\n";
@@ -21,7 +29,8 @@
                //return 1;
        }
 
-       dbPackages->sqlexecute("SELECT PackID, PackNameShort, PackStatus FROM Packages WHERE CDReleaseID = 10 AND PackStatus IN (0, 6, 7, 8) AND BasedOnID IS NULL");
+       //dbPackages->sqlexecute("SELECT PackID, PackNameShort, PackStatus FROM Packages WHERE CDReleaseID = 10 AND PackStatus IN (0, 6, 7, 8) AND BasedOnID IS NULL");
+       dbPackages->sqlexecute("SELECT PackID, PackNameShort, PackStatus FROM Packages WHERE CDReleaseID IN (10, 64) AND PackStatus IN (0, 6, 7, 8) OR PackStatus IS NULL AND BasedOnID IS NULL");
 
        std::vector< std::vector<string> > packIDs = dbPackages->getResult();
 
@@ -74,7 +83,22 @@
                                for(unsigned int l = 0; l < tempVec.size(); l++)
                                        packDeps.push_back(tempVec.at(l));
 
+            sqlcom = "SELECT name, DirID FROM PackFilelist WHERE DirID IN(1, 22, 24, 96, 178, 756, 1981) AND BinPackID=";
+            sqlcom.append(binPack[k].at(0));
+            dbDeps->sqlexecute(sqlcom);
+            tempVec = dbDeps->getResult();
+
+            for(unsigned int m = 0; m < tempVec.size(); m++){
+               sqlcom = "SELECT dir FROM PackFileDirs WHERE DirID=";
+               sqlcom.append(tempVec[m].at(1));
+               dbDeps->sqlexecute(sqlcom);
+               std::vector< std::vector<string> > tempVec2 = dbDeps->getResult();
+               for(unsigned int n = 0; n < tempVec2.size(); n++){
+                  string fileprov = tempVec2[n].at(0) + "/" + tempVec[m].at(0);
+                  prov.insert(factory.parse(kind, fileprov, Rel::ANY, Edition("")));
+               }
 
+            }
                        }
 
                        for(unsigned int y = 0; y < packDeps.size(); y++){
@@ -168,7 +192,7 @@
                        }
                }*/
 
-               store->insert(p);
+               store.insert(p);
        }
 
        dbDeps->close();
@@ -176,6 +200,6 @@
 
 }
 
-ResStore& PdbToZypp::getStore(){
-       return *store;
+ResStore PdbToZypp::getStore(){
+       return store;
 }

Modified: trunk/libzypp/devel/devel.shaas/src/pdbtozypp.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.shaas/src/pdbtozypp.h?rev=7128&r1=7127&r2=7128&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.shaas/src/pdbtozypp.h (original)
+++ trunk/libzypp/devel/devel.shaas/src/pdbtozypp.h Thu Sep  6 17:00:17 2007
@@ -11,9 +11,12 @@
 
 class PdbToZypp{
        public:
-      typedef zypp::ResStore ResStore;
+      //typedef zypp::ResStore ResStore;
+               //PdbToZypp(zypp::ResStore  & _store);
                PdbToZypp();
-               ResStore& getStore();
+      ~PdbToZypp();
+      void readOut();
+      zypp::ResStore getStore();
    private:
-      ResStore *store;
+      zypp::ResStore store;
 };

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages