Link ZYPP with RPM target implementation
authorJiri Srain <jsrain@suse.cz>
Thu, 5 Jan 2006 11:58:40 +0000 (11:58 +0000)
committerJiri Srain <jsrain@suse.cz>
Thu, 5 Jan 2006 11:58:40 +0000 (11:58 +0000)
configure.ac
devel/devel.jsrain/Makefile.am
devel/devel.jsrain/Msg.cc
devel/devel.jsrain/RpmTarget.cc [new file with mode: 0644]
zypp/Makefile.am
zypp/media/MediaCurl.cc
zypp/target/Makefile.am [new file with mode: 0644]

index add3eae..840b7a7 100644 (file)
@@ -178,6 +178,8 @@ AC_OUTPUT(  \
        zypp/media/Makefile             \
        zypp/media/proxyinfo/Makefile   \
        zypp/url/Makefile               \
+       zypp/target/Makefile            \
+       zypp/target/rpm/Makefile
 
 )
 dnl ==================================================
index d2bf2d4..b320399 100644 (file)
@@ -3,7 +3,7 @@
 
 SUBDIRS = yum
 
-noinst_PROGRAMS =      Msg Msg.debug Patch Patch.debug Script Script.debug PatchSelect PatchSelect.debug PatchRead PatchRead.debug SourceRead SourceRead.debug
+noinst_PROGRAMS =      Msg Msg.debug Patch Patch.debug Script Script.debug PatchSelect PatchSelect.debug PatchRead PatchRead.debug SourceRead SourceRead.debug RpmTarget RpmTarget.debug
 
 
 ## ##################################################
@@ -48,6 +48,11 @@ SourceRead_SOURCES =                 SourceRead.cc
 SourceRead_debug_SOURCES =     $(SourceRead_SOURCES)
 SourceRead_debug_LDFLAGS =     -static
 
+RpmTarget_SOURCES =            RpmTarget.cc
+
+RpmTarget_debug_SOURCES =      $(RpmTarget_SOURCES)
+RpmTarget_debug_LDFLAGS =      -static
+
 
 ## ##################################################
 
index bc49bf6..b0ba9ba 100644 (file)
@@ -32,7 +32,7 @@ int main( int argc, char * argv[] )
   std::string _name( "msg1" );
   Edition _edition( "1.0", "42" );
   Arch    _arch( "noarch" );
-  base::shared_ptr<detail::MessageImpl> mp1(new MyMessageImpl(text));
+  shared_ptr<detail::MessageImpl> mp1(new MyMessageImpl(text));
   Message::Ptr m( detail::makeResolvableFromImpl( _name, _edition, _arch, mp1));
 
   DBG << *m << endl;
diff --git a/devel/devel.jsrain/RpmTarget.cc b/devel/devel.jsrain/RpmTarget.cc
new file mode 100644 (file)
index 0000000..c3956ba
--- /dev/null
@@ -0,0 +1,40 @@
+#include <iostream>
+#include "zypp/base/Logger.h"
+#include "zypp/target/rpm/RpmDb.h"
+
+
+using namespace std;
+using namespace zypp;
+using namespace zypp::target::rpm;
+
+/******************************************************************
+**
+**
+**     FUNCTION NAME : main
+**     FUNCTION TYPE : int
+**
+**     DESCRIPTION :
+*/
+int main( int argc, char * argv[] )
+{
+  INT << "===[START]==========================================" << endl;
+
+  RpmDb db;
+
+  DBG << "===[DB OBJECT CREATED]==============================" << endl;
+
+  db.initDatabase();
+
+  DBG << "===[DATABASE INITIALIZED]===========================" << endl;
+
+  std::list<Package::Ptr> packages = db.getPackages();
+  for (std::list<Package::Ptr>::const_iterator it = packages.begin();
+       it != packages.end();
+       it++)
+  {
+    DBG << **it << endl;
+  }
+
+  INT << "===[END]============================================" << endl;
+  return 0;
+}
index 73b28e7..422a4ce 100644 (file)
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 ## ##################################################
 
-SUBDIRS = base parser capability solver source detail media url
+SUBDIRS = base parser capability solver source detail media url target
 
 ## ##################################################
 
@@ -87,6 +87,7 @@ lib@PACKAGE@_la_LIBADD =        base/lib@PACKAGE@_base.la     \
                                media/lib@PACKAGE@_media.la     \
                                url/lib@PACKAGE@_url.la         \
                                \
+                               target/lib@PACKAGE@_target.la   \
                                -lutil
 
 ## ##################################################
index 5a3f0e4..c9d9b92 100644 (file)
@@ -378,7 +378,7 @@ void MediaCurl::doGetFileCopy( const Pathname & filename , const Pathname & targ
     url.setPathName( escapedPath(path) );
 
     Pathname dest = target.absolutename();
-    string destNew = target.asString() + ".new.yast.37456";
+    string destNew = target.asString() + ".new.zypp.37456";
 
     DBG << "dest: " << dest << endl;
     DBG << "destNew: " << destNew << endl;
diff --git a/zypp/target/Makefile.am b/zypp/target/Makefile.am
new file mode 100644 (file)
index 0000000..f3acb26
--- /dev/null
@@ -0,0 +1,22 @@
+## Process this file with automake to produce Makefile.in
+## ##################################################
+
+SUBDIRS = rpm
+
+## ##################################################
+
+include_HEADERS =
+
+## ##################################################
+
+lib_LTLIBRARIES =      lib@PACKAGE@_target.la
+
+## ##################################################
+
+lib@PACKAGE@_target_la_SOURCES =
+
+lib@PACKAGE@_target_la_LDFLAGS =       @LIB_VERSION_INFO@
+
+lib@PACKAGE@_target_la_LIBADD =        rpm/lib@PACKAGE@_target_rpm.la
+
+## ##################################################