Hello community,
here is the log from the commit of package libzypp-zmd-backend
checked in at Wed Apr 5 17:32:26 CEST 2006.
--------
--- libzypp-zmd-backend/libzypp-zmd-backend.changes 2006-04-04 17:38:20.000000000 +0200
+++ libzypp-zmd-backend/libzypp-zmd-backend.changes 2006-04-05 16:53:52.000000000 +0200
@@ -1,0 +2,14 @@
+Wed Apr 5 16:50:48 CEST 2006 - kkaempf@suse.de
+
+- finally set package_url/package_filename right.
+- rev 2943
+
+-------------------------------------------------------------------
+Wed Apr 5 10:38:49 CEST 2006 - kkaempf@suse.de
+
+- change version to 7.1.1.0 so it matches zmd.
+- log exit code for all helpers.
+- check url parameter to parse-metadata.
+- rev 2930
+
+-------------------------------------------------------------------
Old:
----
zmd-backend-7.1.1.tar.bz2
New:
----
zmd-backend-7.1.1.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libzypp-zmd-backend.spec ++++++
--- /var/tmp/diff_new_pack.fjGkth/_old 2006-04-05 17:32:06.000000000 +0200
+++ /var/tmp/diff_new_pack.fjGkth/_new 2006-04-05 17:32:06.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package libzypp-zmd-backend (Version 7.1.1)
+# spec file for package libzypp-zmd-backend (Version 7.1.1.0)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -21,8 +21,8 @@
Provides: zmd-librc-backend
Obsoletes: zmd-librc-backend
Summary: ZMD backend for Package, Patch, Pattern, and Product Management
-Version: 7.1.1
-Release: 30
+Version: 7.1.1.0
+Release: 1
Source: zmd-backend-%{version}.tar.bz2
Prefix: /usr
@@ -37,7 +37,7 @@
Klaus Kaempf
%prep
-%setup -q -n zmd-backend-7.1.1
+%setup -q -n zmd-backend-7.1.1.0
%build
mv configure.ac x
@@ -68,6 +68,14 @@
/etc/logrotate.d/zmd-backend
%changelog -n libzypp-zmd-backend
+* Wed Apr 05 2006 - kkaempf@suse.de
+- finally set package_url/package_filename right.
+- rev 2943
+* Wed Apr 05 2006 - kkaempf@suse.de
+- change version to 7.1.1.0 so it matches zmd.
+- log exit code for all helpers.
+- check url parameter to parse-metadata.
+- rev 2930
* Tue Apr 04 2006 - kkaempf@suse.de
- add 'service-delete' helper.
- rev 2912
++++++ zmd-backend-7.1.1.tar.bz2 -> zmd-backend-7.1.1.0.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1/configure new/zmd-backend-7.1.1.0/configure
--- old/zmd-backend-7.1.1/configure 2006-03-23 16:30:31.000000000 +0100
+++ new/zmd-backend-7.1.1.0/configure 2006-04-05 10:40:21.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for zmd-backend 7.1.1.
+# Generated by GNU Autoconf 2.59 for zmd-backend 7.1.1.0.
#
# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
@@ -421,8 +421,8 @@
# Identity of this package.
PACKAGE_NAME='zmd-backend'
PACKAGE_TARNAME='zmd-backend'
-PACKAGE_VERSION='7.1.1'
-PACKAGE_STRING='zmd-backend 7.1.1'
+PACKAGE_VERSION='7.1.1.0'
+PACKAGE_STRING='zmd-backend 7.1.1.0'
PACKAGE_BUGREPORT=''
ac_unique_file="src/Makefile.am"
@@ -973,7 +973,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures zmd-backend 7.1.1 to adapt to many kinds of systems.
+\`configure' configures zmd-backend 7.1.1.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1040,7 +1040,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of zmd-backend 7.1.1:";;
+ short | recursive ) echo "Configuration of zmd-backend 7.1.1.0:";;
esac
cat <<\_ACEOF
@@ -1193,7 +1193,7 @@
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-zmd-backend configure 7.1.1
+zmd-backend configure 7.1.1.0
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1207,7 +1207,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by zmd-backend $as_me 7.1.1, which was
+It was created by zmd-backend $as_me 7.1.1.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1936,7 +1936,7 @@
# Define the identity of the package.
PACKAGE='zmd-backend'
- VERSION='7.1.1'
+ VERSION='7.1.1.0'
cat >>confdefs.h <<_ACEOF
@@ -27685,7 +27685,7 @@
} >&5
cat >&5 <<_CSEOF
-This file was extended by zmd-backend $as_me 7.1.1, which was
+This file was extended by zmd-backend $as_me 7.1.1.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -27748,7 +27748,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-zmd-backend config.status 7.1.1
+zmd-backend config.status 7.1.1.0
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1/configure.ac new/zmd-backend-7.1.1.0/configure.ac
--- old/zmd-backend-7.1.1/configure.ac 2006-03-23 16:30:19.000000000 +0100
+++ new/zmd-backend-7.1.1.0/configure.ac 2006-04-05 10:39:36.000000000 +0200
@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
dnl ==================================================
-AC_INIT(zmd-backend,7.1.1)
+AC_INIT(zmd-backend,7.1.1.0)
AC_CONFIG_SRCDIR(src/Makefile.am)
AC_PREFIX_DEFAULT(/usr)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1/src/dbsource/DbAccess.cc new/zmd-backend-7.1.1.0/src/dbsource/DbAccess.cc
--- old/zmd-backend-7.1.1/src/dbsource/DbAccess.cc 2006-04-03 18:25:08.000000000 +0200
+++ new/zmd-backend-7.1.1.0/src/dbsource/DbAccess.cc 2006-04-05 16:35:52.000000000 +0200
@@ -566,20 +566,24 @@
sqlite3_bind_text( handle, 4, desc2str(pkg->description()).c_str(), -1, SQLITE_STATIC );
Source_Ref src( pkg->source() );
- sqlite3_bind_text( handle, 5, src.url().asString().c_str(), -1, SQLITE_STATIC ); // package_url
+ string surl = src.url().asString();
+ const char *location = pkg->location().asString().c_str();
+ if (location[0] == '.' && location[1] == '/') location += 2; // strip leading "./"
if (force_remote
|| src.remote())
{
- DBG << "Source " << src << " is remote";
- sqlite3_bind_text( handle, 6, NULL, -1, SQLITE_STATIC ); // zmd knows how to get the package
+// DBG << "Source " << src << ", url " << src.url() << " is remote" << endl;
+ surl += "/";
+ surl += location;
+ location = NULL; // zmd knows how to get the package
}
else {
- const char *location = pkg->location().asString().c_str();
- if (location[0] == '.' && location[1] == '/') location += 2; // strip leading "./"
- DBG << "Source " << src << " is local, location " << location << endl;
- sqlite3_bind_text( handle, 6, location, -1, SQLITE_STATIC ); // zypp knows how to get the package
+// DBG << "Source " << src << ", url " << src.url() << " is local, location " << location << endl;
}
+ sqlite3_bind_text( handle, 5, surl.c_str(), -1, SQLITE_STATIC );
+ sqlite3_bind_text( handle, 6, location, -1, SQLITE_STATIC );
+
sqlite3_bind_text( handle, 7, NULL, -1, SQLITE_STATIC ); // signature_filename
sqlite3_bind_int( handle, 8, pkg->size() );
sqlite3_bind_int( handle, 9, pkg->installOnly() ? 1 : 0 );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1/src/find-file.cc new/zmd-backend-7.1.1.0/src/find-file.cc
--- old/zmd-backend-7.1.1/src/find-file.cc 2006-03-31 16:23:17.000000000 +0200
+++ new/zmd-backend-7.1.1.0/src/find-file.cc 2006-04-05 11:08:20.000000000 +0200
@@ -93,7 +93,7 @@
dbacc.closeDb();
- MIL << "END find-file" << endl;
+ MIL << "END find-file, result " << res << endl;
return res;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1/src/package-files.cc new/zmd-backend-7.1.1.0/src/package-files.cc
--- old/zmd-backend-7.1.1/src/package-files.cc 2006-03-31 16:23:22.000000000 +0200
+++ new/zmd-backend-7.1.1.0/src/package-files.cc 2006-04-05 11:08:35.000000000 +0200
@@ -242,7 +242,7 @@
db.closeDb();
- MIL << "END package-files" << endl;
+ MIL << "END package-files, result " << result << endl;
return result;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1/src/parse-metadata.cc new/zmd-backend-7.1.1.0/src/parse-metadata.cc
--- old/zmd-backend-7.1.1/src/parse-metadata.cc 2006-04-02 14:55:33.000000000 +0200
+++ new/zmd-backend-7.1.1.0/src/parse-metadata.cc 2006-04-05 15:14:15.000000000 +0200
@@ -100,6 +100,7 @@
//Tell yast that we are done storing the updated source. This is
//necessary because when "rug sa" is called by yast, it calls us
//asyncronously
+
static void
tell_yast()
{
@@ -125,9 +126,9 @@
// upload all zypp sources as catalogs to the database
static void
-sync_source( DbAccess & db, Source_Ref source, string catalog, bool is_remote = false )
+sync_source( DbAccess & db, Source_Ref source, const string & catalog, const Url & url, bool is_remote = false )
{
- DBG << "sync_source, catalog '" << catalog << "', alias '" << source.alias() << "', remote? " << is_remote << endl;
+ DBG << "sync_source, catalog '" << catalog << "', url '" << url << "', alias '" << source.alias() << "', remote? " << is_remote << endl;
#if 0 // ZMD does this
if (db.haveCatalog( catalog ) ) {
@@ -151,6 +152,10 @@
#endif
ResStore store = source.resolvables();
+ if (!url.getScheme().empty()) {
+ MIL << "Setting source URL to " << url << endl;
+ source.setUrl( url );
+ }
DBG << "Source provides " << store.size() << " resolvables" << endl;
@@ -163,39 +168,6 @@
}
-//
-// find matching source and write its resolvables to the catalog
-//
-
-static void
-sync_catalog( DbAccess & db, const string & path, const string & catalog )
-{
- MIL << "sync_catalog(..., " << path << ", " << catalog << ")" << endl;
-
- listSourceManager::SourceId sources = manager->allSources();
- MIL << "Found " << sources.size() << " sources" << endl;
-
- // we could use SourceManager::findSource(const std::string & alias_r)
- // but for the /installation case we need this
- for (listSourceManager::SourceId::const_iterator it = sources.begin(); it != sources.end(); ++it) {
- Source_Ref source = manager->findSource( *it );
- if (!source) {
- ERR << "SourceManager can't find source " << *it << endl;
- continue;
- }
- if (!source.enabled())
- continue;
-
- if ((path == "/installation") // just sync the first source
- || (catalog == source.alias())) // or the matching one
- {
- sync_source( db, source, catalog );
- break;
- }
- }
- return;
-}
-
//----------------------------------------------------------------------------
// metadata types
@@ -208,7 +180,7 @@
atexit (tell_yast);
if (argc != 5) {
- cerr << "usage: " << argv[0] << " <database> <type> <path> <catalog id>" << endl;
+ cerr << "usage: " << argv[0] << " <database> <type> <uri> <catalog id>" << endl;
return 1;
}
@@ -219,7 +191,7 @@
zypp::base::LogControl::instance().logfile( ZMD_BACKEND_LOG );
MIL << "-------------------------------------" << endl;
- // database type path/uri catalog/alias
+ // database type uri catalog
MIL << "START parse-metadata " << argv[1] << " " << argv[2] << " " << argv[3] << " " << argv[4] << endl;
ZYpp::Ptr God = backend::getZYpp( );
@@ -228,7 +200,7 @@
if (! restore_sources ())
return 1;
- DbAccess db(argv[1]);
+ DbAccess db( argv[1] );
if (!db.openDb( true )) // open for writing
{
@@ -236,29 +208,63 @@
return 1;
}
- if (strcmp( argv[2], ZYPP) == 0) {
- MIL << "Doing a catalog sync" << endl;
+ string type( argv[2] );
+ Url uri;
+ try {
+ uri = Url ( ((argv[3][0] == '/') ? string("file:"):string("")) + argv[3] );
+ }
+ catch ( const Exception & excpt_r ) {
+ ZYPP_CAUGHT( excpt_r );
+ cerr << excpt_r.asUserString() << endl;
+ return 1;
+ }
+
+ string catalog( argv[4] );
+
+ int result = 0;
+
+ if (type == ZYPP)
+ {
+
+ MIL << "Doing a zypp->zmd sync" << endl;
// the source already exists in the catalog, no need to add it
- sync_catalog( db, argv[3], argv[4] );
+
+ //
+ // find matching source and write its resolvables to the catalog
+ //
+
+ SourceManager::Source_const_iterator it;
+ for (it = manager->Source_begin(); it != manager->Source_end(); ++it) {
+ string src_uri = it->url().asString() + "?alias=" + it->alias();
+ MIL << "Uri " << src_uri << endl;
+ if (src_uri == uri.asString()) {
+ sync_source( db, *it, catalog, Url() );
+ break;
+ }
+ }
+ if (it == manager->Source_end()) {
+ WAR << "Source not found" << endl;
+ result = 1;
+ }
}
- else if (strcmp( argv[2], YUM) == 0) {
- MIL << "Doing a cached source sync" << endl;
- Pathname p;
- Url url( string("file:") + argv[3] );
- string alias( argv[4] );
- Locale lang( "en" );
+ else if (strcmp( argv[2], YUM ) == 0)
+ {
+
+ MIL << "Doing a zmd->zypp sync" << endl;
Pathname cache_dir("");
try {
bool is_remote = true;
- Source_Ref source( SourceFactory().createFrom(url, p, alias, cache_dir) );
+ Source_Ref source( SourceFactory().createFrom( uri, Pathname(), catalog, cache_dir ) );
- // try to create a Url using the alias, this is typically
+ // try to create a Url using the catalog (as alias), this is typically
// the original location of the source, not the local cache
+ Url url;
try {
- Url url( alias );
+#warning Need real URL, not catalog
+ url = Url( catalog );
string scheme = url.getScheme();
if (scheme != "ftp"
&& scheme != "http"
@@ -266,39 +272,35 @@
{
is_remote = false;
}
-#if 0 // don't re-create real source, this will re-load all metadata (#162735)
- MIL << "Creating remote source for libzypp" << endl;
- Source_Ref source_remote( SourceFactory().createFrom(url, p, alias, cache_dir) );
- add_source_if_new (source_remote, alias);
-#endif
} catch ( const Exception & excpt_r )
{
ZYPP_CAUGHT( excpt_r );
-#if 0
- add_source_if_new (source, alias);
-#endif
}
-
- sync_source( db, source, alias, is_remote );
+
+ sync_source( db, source, catalog, url, is_remote );
+
}
catch( const Exception & excpt_r )
{
cerr << "3|Cant access repository data at " << argv[3] << endl;
ZYPP_CAUGHT( excpt_r );
ERR << "Can't access repository at " << argv[3] << endl;
- return 1;
+ result = 1;
};
}
- else {
+ else
+ {
ERR << "Invalid option " << argv[2] << ", expecting '" << ZYPP << "' or '" << YUM << "'" << endl;
+ result = 1;
}
db.closeDb();
- store_sources (); // no checking, we're finished anyway
+ if (result == 0)
+ store_sources (); // no checking, we're finished anyway
- MIL << "END parse-metadata" << endl;
+ MIL << "END parse-metadata, result " << result << endl;
- return 0;
+ return result;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1/src/query-files.cc new/zmd-backend-7.1.1.0/src/query-files.cc
--- old/zmd-backend-7.1.1/src/query-files.cc 2006-04-02 11:53:16.000000000 +0200
+++ new/zmd-backend-7.1.1.0/src/query-files.cc 2006-04-05 11:09:07.000000000 +0200
@@ -407,7 +407,7 @@
DbAccess db(argv[1]);
if (!db.openDb( true )) // open for writing
- return false;
+ return 1;
backend::initTarget( God );
@@ -428,7 +428,7 @@
db.closeDb();
- MIL << "END query-files" << endl;
+ MIL << "END query-files, result 0" << endl;
return 0;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1/src/query-pool.cc new/zmd-backend-7.1.1.0/src/query-pool.cc
--- old/zmd-backend-7.1.1/src/query-pool.cc 2006-03-31 16:22:01.000000000 +0200
+++ new/zmd-backend-7.1.1.0/src/query-pool.cc 2006-04-05 11:09:21.000000000 +0200
@@ -148,7 +148,7 @@
query_pool( Z, filter, catalog );
- MIL << "END query-pool" << endl;
+ MIL << "END query-pool, result 0" << endl;
return 0;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1/src/query-system.cc new/zmd-backend-7.1.1.0/src/query-system.cc
--- old/zmd-backend-7.1.1/src/query-system.cc 2006-03-31 16:22:06.000000000 +0200
+++ new/zmd-backend-7.1.1.0/src/query-system.cc 2006-04-05 11:09:29.000000000 +0200
@@ -169,7 +169,7 @@
db.closeDb();
- MIL << "END query-system" << endl;
+ MIL << "END query-system, result 0" << endl;
return 0;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1/src/resolve-dependencies.cc new/zmd-backend-7.1.1.0/src/resolve-dependencies.cc
--- old/zmd-backend-7.1.1/src/resolve-dependencies.cc 2006-03-31 16:22:14.000000000 +0200
+++ new/zmd-backend-7.1.1.0/src/resolve-dependencies.cc 2006-04-05 11:09:48.000000000 +0200
@@ -135,7 +135,7 @@
db.closeDb();
- MIL << "END resolve-dependencies" << endl;
+ MIL << "END resolve-dependencies, result " << (success ? 0 : 1) << endl;
return (success ? 0 : 1);
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1/src/service-delete.cc new/zmd-backend-7.1.1.0/src/service-delete.cc
--- old/zmd-backend-7.1.1/src/service-delete.cc 2006-04-04 17:36:26.000000000 +0200
+++ new/zmd-backend-7.1.1.0/src/service-delete.cc 2006-04-05 11:10:36.000000000 +0200
@@ -70,21 +70,21 @@
zypp::base::LogControl::instance().logfile( ZMD_BACKEND_LOG );
MIL << "-------------------------------------" << endl;
- string alias;
- if (argc < 2) {
- cerr << "Usage: service-delete <uri>" << endl;
+ if (argc < 3) {
+ cerr << "Usage: service-delete <db> <uri>" << endl;
exit( 1 );
}
- alias = argv[1];
+ string db( argv[1] );
+ string alias( argv[2] );
- MIL << "START service-delete " << alias << endl;
+ MIL << "START service-delete " << db << " " << alias << endl;
ZYpp::Ptr Z = backend::getZYpp( true );
Target_Ptr target = backend::initTarget( Z, false );
int result = service_delete( Z, alias );
- MIL << "END service-delete" << endl;
+ MIL << "END service-delete, result " << result << endl;
return result;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zmd-backend-7.1.1/src/transact.cc new/zmd-backend-7.1.1.0/src/transact.cc
--- old/zmd-backend-7.1.1/src/transact.cc 2006-03-31 12:45:21.000000000 +0200
+++ new/zmd-backend-7.1.1.0/src/transact.cc 2006-04-05 11:04:41.000000000 +0200
@@ -167,7 +167,7 @@
db.closeDb();
- MIL << "END transact" << endl;
+ MIL << "END transact, result " << result << endl;
return result;
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...