- adapt to coding style
authorMichael Schroeder <mls@suse.de>
Thu, 30 Oct 2008 10:49:56 +0000 (10:49 +0000)
committerMichael Schroeder <mls@suse.de>
Thu, 30 Oct 2008 10:49:56 +0000 (10:49 +0000)
- log solver execution time
- replace some fprintf calls with sat_debug

16 files changed:
package/libsatsolver.spec.in
src/pool.c
src/poolid.c
src/repo.h
src/repo_helix.c
src/repo_solv.c
src/repodata.h
src/repopage.c
src/solver.c
src/strpool.c
src/util.c
src/util.h
tools/repo_content.c
tools/repo_deltainfoxml.c
tools/repo_products.c
tools/repo_susetags.c

index 98fc09c..c64b827 100644 (file)
@@ -144,6 +144,11 @@ rm -rf "$RPM_BUILD_ROOT"
 #%doc swig/python/examples/*.py
 %{py_sitedir}/_satsolver.so
 %{py_sitedir}/satsolver.py
+#see http://fedoraproject.org/wiki/Packaging/Python
+%if 0%{?fedora_version}
+%exclude %{py_sitedir}/satsolver.pyc
+%exclude %{py_sitedir}/satsolver.pyo
+%endif
 
 %files -n perl-satsolver
 %defattr(-,root,root,-)
index d18974d..cbe67ba 100644 (file)
@@ -261,7 +261,9 @@ pool_createwhatprovides(Pool *pool)
   Offset *whatprovides;
   Id *whatprovidesdata, *d;
   Repo *installed = pool->installed;
+  unsigned int now;
 
+  now = sat_timems(0);
   POOL_DEBUG(SAT_DEBUG_STATS, "number of solvables: %d\n", pool->nsolvables);
   POOL_DEBUG(SAT_DEBUG_STATS, "number of ids: %d + %d\n", pool->ss.nstrings, pool->nrels);
 
@@ -354,6 +356,7 @@ pool_createwhatprovides(Pool *pool)
   pool->whatprovidesdataoff = off;
   pool->whatprovidesdataleft = extra;
   pool_shrink_whatprovides(pool);
+  POOL_DEBUG(SAT_DEBUG_STATS, "createwhatprovides took %d ms\n", sat_timems(now));
 }
 
 /*
index 044b248..cd5f4d7 100644 (file)
@@ -27,7 +27,7 @@ Id
 str2id(Pool *pool, const char *str, int create)
 {
   int oldnstrings = pool->ss.nstrings;
-  Id id = stringpool_str2id (&pool->ss, str, create);
+  Id id = stringpool_str2id(&pool->ss, str, create);
   if (create && pool->whatprovides && oldnstrings != pool->ss.nstrings && (id & WHATPROVIDES_BLOCK) == 0)
     {
       /* grow whatprovides array */
@@ -41,7 +41,7 @@ Id
 strn2id(Pool *pool, const char *str, unsigned int len, int create)
 {
   int oldnstrings = pool->ss.nstrings;
-  Id id = stringpool_strn2id (&pool->ss, str, len, create);
+  Id id = stringpool_strn2id(&pool->ss, str, len, create);
   if (create && pool->whatprovides && oldnstrings != pool->ss.nstrings && (id & WHATPROVIDES_BLOCK) == 0)
     {
       /* grow whatprovides array */
index e1df5f6..7f81d27 100644 (file)
 #include "pool.h"
 #include "repodata.h"
 
-typedef struct _Repokey {
-  Id name;
-  Id type;              /* REPOKEY_TYPE_xxx */
-  unsigned int size;
-  unsigned int storage; /* KEY_STORAGE_xxx */
-} Repokey;
-
-#define KEY_STORAGE_DROPPED             0
-#define KEY_STORAGE_SOLVABLE           1
-#define KEY_STORAGE_INCORE             2
-#define KEY_STORAGE_VERTICAL_OFFSET    3
 
 
 typedef struct _Repo {
@@ -197,31 +186,6 @@ Id repo_lookup_id(Repo *repo, Id entry, Id keyid);
 int repo_lookup_void(Repo *repo, Id entry, Id keyid);
 const unsigned char *repo_lookup_bin_checksum(Repo *repo, Id entry, Id keyid, Id *typep);
 
-
-#if 0
-typedef struct _Dataiterator
-{
-  Repodata *data;
-  Id *keyp;
-  unsigned char *nextkeydp;
-  unsigned char *dp;
-  Repokey *key;
-  Repo *repo;
-  Id *idp;
-  const char *match;
-  Id solvid;
-  Id keyname;
-  unsigned flags;
-  unsigned state;
-  KeyValue kv;
-  regex_t regex;
-  int regex_err;
-  Id *subkeyp;
-  int subnum;
-  Id subschema;
-} Dataiterator;
-#else
-
 typedef struct _Datamatcher {
   int flags;
   void *match;
@@ -268,8 +232,6 @@ typedef struct _Dataiterator
 
 } Dataiterator;
 
-#endif
-
 int datamatcher_init(Datamatcher *ma, const char *match, int flags);
 void datamatcher_free(Datamatcher *ma);
 int datamatcher_match(Datamatcher *ma, const char *str);
index 2184a31..e4754c5 100644 (file)
@@ -860,7 +860,7 @@ repo_add_helix(Repo *repo, FILE *fp, int flags)
       l = fread(buf, 1, sizeof(buf), fp);
       if (XML_Parse(parser, buf, l, l == 0) == XML_STATUS_ERROR)
        {
-         fprintf(stderr, "%s at line %u\n", XML_ErrorString(XML_GetErrorCode(parser)), (unsigned int)XML_GetCurrentLineNumber(parser));
+         pool_debug(pool, SAT_FATAL, "%s at line %u\n", XML_ErrorString(XML_GetErrorCode(parser)), (unsigned int)XML_GetCurrentLineNumber(parser));
          exit(1);
        }
       if (l == 0)
index 98808fd..8b1f517 100644 (file)
@@ -955,10 +955,10 @@ repo_add_solv_parent(Repo *repo, FILE *fp, Repodata *parent)
       schemadatap = read_idarray(&data, numid, 0, schemadatap, schemadataend);
 #if 0
       Id *sp = schemadata + schemata[i];
-      fprintf (stderr, "schema %d:", i);
+      fprintf(stderr, "schema %d:", i);
       for (; *sp; sp++)
-        fprintf (stderr, " %d", *sp);
-      fprintf (stderr, "\n");
+        fprintf(stderr, " %d", *sp);
+      fprintf(stderr, "\n");
 #endif
     }
   data.schemata = schemata;
index 0c49953..9cce312 100644 (file)
 #define SIZEOF_SHA256  32
 
 struct _Repo;
-struct _Repokey;
 struct _KeyValue;
 
+typedef struct _Repokey {
+  Id name;
+  Id type;               /* REPOKEY_TYPE_xxx */
+  unsigned int size;
+  unsigned int storage; /* KEY_STORAGE_xxx */
+} Repokey;
+
+#define KEY_STORAGE_DROPPED             0
+#define KEY_STORAGE_SOLVABLE            1
+#define KEY_STORAGE_INCORE              2
+#define KEY_STORAGE_VERTICAL_OFFSET     3
+
+
 typedef struct _Repodata {
   struct _Repo *repo;          /* back pointer to repo */
 
@@ -45,8 +57,7 @@ typedef struct _Repodata {
   FILE *fp;                    /* file pointer of solv file */
   int error;                   /* corrupt solv file */
 
-
-  struct _Repokey *keys;       /* keys, first entry is always zero */
+  Repokey *keys;               /* keys, first entry is always zero */
   unsigned int nkeys;          /* length of keys array */
   unsigned char keybits[32];   /* keyname hash */
 
@@ -61,33 +72,33 @@ typedef struct _Repodata {
 
   Dirpool dirpool;             /* local dir pool */
 
-  Id mainschema;
-  Id *mainschemaoffsets;
-
-  unsigned char *incoredata;   /* in-core data (flat_attrs) */
-  unsigned int incoredatalen;  /* data len (attr_next_free) */
+  unsigned char *incoredata;   /* in-core data */
+  unsigned int incoredatalen;  /* in-core data used */
   unsigned int incoredatafree; /* free data len */
 
-  Id *incoreoffset;            /* offset for all entries (ent2attr) */
+  Id mainschema;               /* SOLVID_META schema */
+  Id *mainschemaoffsets;       /* SOLVID_META offsets into incoredata */
+
+  Id *incoreoffset;            /* offset for all entries */
 
   Id *verticaloffset;          /* offset for all verticals, nkeys elements */
   Id lastverticaloffset;       /* end of verticals */
 
   Repopagestore store;         /* our page store */
 
-  unsigned char *vincore;      
-  unsigned int vincorelen;
+  unsigned char *vincore;      /* internal vertical data */
+  unsigned int vincorelen;     /* data size */
 
   Id **attrs;                  /* un-internalized attributes */
   Id **xattrs;                 /* anonymous handles */
-  int nxattrs;
+  int nxattrs;                 /* number of handles */
 
   unsigned char *attrdata;     /* their string data space */
-  unsigned int attrdatalen;
+  unsigned int attrdatalen;    /* its len */
   Id *attriddata;              /* their id space */
-  unsigned int attriddatalen;
+  unsigned int attriddatalen;  /* its len */
 
-  /* array cache */
+  /* array cache to speed up repodata_add functions*/
   Id lasthandle;
   Id lastkey;
   Id lastdatalen;
@@ -98,20 +109,40 @@ typedef struct _Repodata {
 #define SOLVID_POS             -2
 #define SOLVID_SUBSCHEMA       -3              /* internal! */
 
+
 /*-----
  * management functions
  */
 void repodata_init(Repodata *data, struct _Repo *repo, int localpool);
-void repodata_extend(Repodata *data, Id p);
-void repodata_extend_block(Repodata *data, Id p, int num);
 void repodata_free(Repodata *data);
 
-/* internalize repodata into .solv, required before writing out a .solv file */
-void repodata_internalize(Repodata *data);
 
-Id repodata_key2id(Repodata *data, struct _Repokey *key, int create);
+/*
+ * key management functions
+ */
+Id repodata_key2id(Repodata *data, Repokey *key, int create);
+static inline Repokey *
+repodata_id2key(Repodata *data, Id keyid)
+{
+  return data->keys + keyid;
+}
+
+/*
+ * schema management functions
+ */
 Id repodata_schema2id(Repodata *data, Id *schema, int create);
+static inline Id *
+repodata_id2schema(Repodata *data, Id schemaid)
+{
+  return data->schemadata + data->schemata[schemaid];
+}
+
+/*
+ * data search and access
+ */
 
+/* check if there is a chance that the repodata contains data for
+ * the specified keyname */
 static inline int
 repodata_precheck_keyname(Repodata *data, Id keyname)
 {
@@ -119,15 +150,13 @@ repodata_precheck_keyname(Repodata *data, Id keyname)
   return x && (x & (1 << (keyname & 7))) ? 1 : 0;
 }
 
-/*----
- * access functions
- */
+/* search key <keyname> (all keys, if keyname == 0) for Id <solvid>
+ * Call <callback> for each match */
+void repodata_search(Repodata *data, Id solvid, Id keyname, int flags, int (*callback)(void *cbdata, Solvable *s, Repodata *data, Repokey *key, struct _KeyValue *kv), void *cbdata);
 
-/* Search key <keyname> (all keys, if keyname == 0) for Id <solvid>
- * Call <callback> for each match
- */
-void repodata_search(Repodata *data, Id solvid, Id keyname, int flags, int (*callback)(void *cbdata, Solvable *s, Repodata *data, struct _Repokey *key, struct _KeyValue *kv), void *cbdata);
-int repodata_stringify(Pool *pool, Repodata *data, struct _Repokey *key, struct _KeyValue *kv, int flags);
+/* Make sure the found KeyValue has the "str" field set. Return false
+ * if not possible */
+int repodata_stringify(Pool *pool, Repodata *data, Repokey *key, struct _KeyValue *kv, int flags);
 
 
 /* lookup functions */
@@ -138,23 +167,32 @@ int repodata_lookup_void(Repodata *data, Id solvid, Id keyname);
 const unsigned char *repodata_lookup_bin_checksum(Repodata *data, Id solvid, Id keyname, Id *typep);
 
 
+
 /*-----
  * data assignment functions
  */
 
+/*
+ * extend the data so that it contains the specified solvables
+ * (no longer needed, as the repodata_set functions autoextend)
+ */
+void repodata_extend(Repodata *data, Id p);
+void repodata_extend_block(Repodata *data, Id p, int num);
+
+/* internalize freshly set data, so that it is found by the search
+ * functions and written out */
+void repodata_internalize(Repodata *data);
+
 /* create an anonymous handle. useful for substructures like
  * fixarray/flexarray  */
 Id repodata_new_handle(Repodata *data);
 
 /* basic types: void, num, string, Id */
-
 void repodata_set_void(Repodata *data, Id solvid, Id keyname);
 void repodata_set_num(Repodata *data, Id solvid, Id keyname, unsigned int num);
-void repodata_set_str(Repodata *data, Id solvid, Id keyname, const char *str);
 void repodata_set_id(Repodata *data, Id solvid, Id keyname, Id id);
-
-/*  */
-
+void repodata_set_str(Repodata *data, Id solvid, Id keyname, const char *str);
+/* create id from string, then set_id */
 void repodata_set_poolstr(Repodata *data, Id solvid, Id keyname, const char *str);
 
 /* set numeric constant */
@@ -180,18 +218,15 @@ void repodata_add_poolstr_array(Repodata *data, Id solvid, Id keyname, const cha
 void repodata_add_fixarray(Repodata *data, Id solvid, Id keyname, Id ghandle);
 void repodata_add_flexarray(Repodata *data, Id solvid, Id keyname, Id ghandle);
 
-
-/*-----
- * data management
- */
-
 /* 
- merge attributes fro one solvable to another
+ merge attributes from one solvable to another
  works only if the data is not yet internalized
 */
-void repodata_merge_attrs (Repodata *data, Id dest, Id src);
+void repodata_merge_attrs(Repodata *data, Id dest, Id src);
 
-/* */
+/*
+ * load all paged data, used to speed up copying in repo_rpmdb
+ */
 void repodata_disable_paging(Repodata *data);
 
 /* helper functions */
index 4c08d3e..6ce3ca8 100644 (file)
@@ -88,8 +88,8 @@ compress_buf(const unsigned char *in, unsigned int in_len,
 #define HS (65536)
   Ref htab[HS];
   Ref hnext[BLOCK_SIZE];
-  memset (htab, -1, sizeof (htab));
-  memset (hnext, -1, sizeof (hnext));
+  memset(htab, -1, sizeof (htab));
+  memset(hnext, -1, sizeof (hnext));
   unsigned int litofs = 0;
   while (io + 2 < in_len)
     {
@@ -118,8 +118,8 @@ compress_buf(const unsigned char *in, unsigned int in_len,
        }
       for (; try != -1 && tries < 12; tries++)
        {
-         //assert (mlen >= 2);
-         //assert (io + mlen < in_len);
+         //assert(mlen >= 2);
+         //assert(io + mlen < in_len);
          /* Try a match starting from [io] with the strings at [try].
             That's only sensible if TRY actually is before IO (can happen
             with uninit hash table).  If we have a previous match already
@@ -128,7 +128,7 @@ compress_buf(const unsigned char *in, unsigned int in_len,
          if (try < io && in[try + mlen] == in[io + mlen])
            {
              unsigned int this_len, this_ofs;
-             if (memcmp (in + try, in + io, mlen))
+             if (memcmp(in + try, in + io, mlen))
                goto no_match;
              this_len = mlen + 1;
              /* Now try extending the match by more characters.  */
@@ -139,15 +139,15 @@ compress_buf(const unsigned char *in, unsigned int in_len,
 #if 0
              unsigned int testi;
              for (testi = 0; testi < this_len; testi++)
-               assert (in[try + testi] == in[io + testi]);
+               assert(in[try + testi] == in[io + testi]);
 #endif
              this_ofs = (io - try) - 1;
              /*if (this_ofs > 65535)
                 goto no_match; */
 #if 0
-             assert (this_len >= 2);
-             assert (this_len >= mlen);
-             assert (this_len > mlen || (this_len == mlen && this_ofs > mofs));
+             assert(this_len >= 2);
+             assert(this_len >= mlen);
+             assert(this_len > mlen || (this_len == mlen && this_ofs > mofs));
 #endif
              mlen = this_len, mofs = this_ofs;
              /* If our match extends up to the end of input, no next
@@ -166,7 +166,7 @@ compress_buf(const unsigned char *in, unsigned int in_len,
 match_done:
       if (mlen)
        {
-         //fprintf (stderr, "%d %d\n", mlen, mofs);
+         /*fprintf(stderr, "%d %d\n", mlen, mofs);*/
          if (mlen == 2 && (litofs || mofs >= 1024))
            mlen = 0;
          /*else if (mofs >= 65536)
@@ -223,7 +223,7 @@ match_done:
            {
              litofs--;
              unsigned litlen = io - litofs;
-             //fprintf (stderr, "lit: %d\n", litlen);
+             //fprintf(stderr, "lit: %d\n", litlen);
              while (litlen)
                {
                  unsigned int easy_sz;
@@ -239,7 +239,7 @@ match_done:
                    {
                      if (oo + easy_sz >= out_len)
                        return 0;
-                     memcpy (out + oo, in + litofs, easy_sz);
+                     memcpy(out + oo, in + litofs, easy_sz);
                      litofs += easy_sz;
                      oo += easy_sz;
                      litlen -= easy_sz;
@@ -261,7 +261,7 @@ match_done:
                      if (oo + 1 + 32 >= out_len)
                        return 0;
                      out[oo++] = 0x80 | 31;
-                     memcpy (out + oo, in + litofs, 32);
+                     memcpy(out + oo, in + litofs, 32);
                      oo += 32;
                      litofs += 32;
                      litlen -= 32;
@@ -270,7 +270,7 @@ match_done:
              litofs = 0;
            }
 
-         //fprintf (stderr, "ref: %d @ %d\n", mlen, mofs);
+         //fprintf(stderr, "ref: %d @ %d\n", mlen, mofs);
 
          if (mlen >= 2 && mlen <= 9 && mofs < 1024)
            {
@@ -288,7 +288,7 @@ match_done:
            }
          else if (mofs >= 65536)
            {
-             assert (mlen >= 5 && mlen < 2048 + 5);
+             assert(mlen >= 5 && mlen < 2048 + 5);
              if (oo + 5 >= out_len)
                return 0;
              out[oo++] = 0xf8 | ((mlen - 5) >> 8);
@@ -299,7 +299,7 @@ match_done:
            }
          else if (mlen >= 3 && mlen <= 18)
            {
-             assert (mofs < 65536);
+             assert(mofs < 65536);
              if (oo + 3 >= out_len)
                return 0;
              out[oo++] = 0xe0 | (mlen - 3);
@@ -308,7 +308,7 @@ match_done:
            }
          else
            {
-             assert (mlen >= 19 && mlen <= 4095 + 19 && mofs < 65536);
+             assert(mlen >= 19 && mlen <= 4095 + 19 && mofs < 65536);
              if (oo + 4 >= out_len)
                return 0;
              out[oo++] = 0xf0 | ((mlen - 19) >> 8);
@@ -346,7 +346,7 @@ match_done:
     {
       litofs--;
       unsigned litlen = io - litofs;
-      //fprintf (stderr, "lit: %d\n", litlen);
+      //fprintf(stderr, "lit: %d\n", litlen);
       while (litlen)
        {
          unsigned int easy_sz;
@@ -361,7 +361,7 @@ match_done:
            {
              if (oo + easy_sz >= out_len)
                return 0;
-             memcpy (out + oo, in + litofs, easy_sz);
+             memcpy(out + oo, in + litofs, easy_sz);
              litofs += easy_sz;
              oo += easy_sz;
              litlen -= easy_sz;
@@ -383,7 +383,7 @@ match_done:
              if (oo + 1 + 32 >= out_len)
                return 0;
              out[oo++] = 0x80 | 31;
-             memcpy (out + oo, in + litofs, 32);
+             memcpy(out + oo, in + litofs, 32);
              oo += 32;
              litofs += 32;
              litlen -= 32;
@@ -476,7 +476,7 @@ unchecked_decompress_buf(const unsigned char *in, unsigned int in_len,
            break;
          }
        }
-      //fprintf (stderr, "ref: %d @ %d\n", first, o);
+      //fprintf(stderr, "ref: %d @ %d\n", first, o);
       o++;
       o = -o;
 #if 0
@@ -591,10 +591,10 @@ repopagestore_load_page_range(Repopagestore *store, unsigned int pstart, unsigne
       if (store->ncanmap < 4)
         store->ncanmap = 4;
       store->mapped = sat_realloc2(store->mapped, store->ncanmap, sizeof(store->mapped[0]));
-      memset (store->mapped + oldcan, 0, (store->ncanmap - oldcan) * sizeof (store->mapped[0]));
+      memset(store->mapped + oldcan, 0, (store->ncanmap - oldcan) * sizeof (store->mapped[0]));
       store->blob_store = sat_realloc2(store->blob_store, store->ncanmap, BLOB_PAGESIZE);
 #ifdef DEBUG_PAGING
-      fprintf (stderr, "PAGE: can map %d pages\n", store->ncanmap);
+      fprintf(stderr, "PAGE: can map %d pages\n", store->ncanmap);
 #endif
     }
 
@@ -612,7 +612,7 @@ repopagestore_load_page_range(Repopagestore *store, unsigned int pstart, unsigne
         {
          pnum--;
          Attrblobpage *p = store->pages + pnum;
-         assert (p->mapped_at != -1);
+         assert(p->mapped_at != -1);
          if (pnum >= pstart && pnum <= pend)
            cost[i] = 1;
          else
@@ -658,7 +658,7 @@ repopagestore_load_page_range(Repopagestore *store, unsigned int pstart, unsigne
        {
          /* Evict this page.  */
 #ifdef DEBUG_PAGING
-         fprintf (stderr, "PAGE: evict page %d from %d\n", pnum, i);
+         fprintf(stderr, "PAGE: evict page %d from %d\n", pnum, i);
 #endif
          cost[i] = 0;
          store->mapped[i] = 0;
@@ -677,10 +677,10 @@ repopagestore_load_page_range(Repopagestore *store, unsigned int pstart, unsigne
          if (p->mapped_at != pnum * BLOB_PAGESIZE)
            {
 #ifdef DEBUG_PAGING
-             fprintf (stderr, "PAGECOPY: %d to %d\n", i, pnum);
+             fprintf(stderr, "PAGECOPY: %d to %d\n", i, pnum);
 #endif
              /* Still mapped somewhere else, so just copy it from there.  */
-             memcpy (dest, store->blob_store + p->mapped_at, BLOB_PAGESIZE);
+             memcpy(dest, store->blob_store + p->mapped_at, BLOB_PAGESIZE);
              store->mapped[p->mapped_at / BLOB_PAGESIZE] = 0;
            }
        }
@@ -690,11 +690,11 @@ repopagestore_load_page_range(Repopagestore *store, unsigned int pstart, unsigne
          unsigned int compressed = in_len & 1;
          in_len >>= 1;
 #ifdef DEBUG_PAGING
-         fprintf (stderr, "PAGEIN: %d to %d", i, pnum);
+         fprintf(stderr, "PAGEIN: %d to %d", i, pnum);
 #endif
           if (pread(store->pagefd, compressed ? buf : dest, in_len, p->file_offset) != in_len)
            {
-             perror ("mapping pread");
+             perror("mapping pread");
              return 0;
            }
          if (compressed)
@@ -710,11 +710,11 @@ repopagestore_load_page_range(Repopagestore *store, unsigned int pstart, unsigne
                  return 0;
                }
 #ifdef DEBUG_PAGING
-             fprintf (stderr, " (expand %d to %d)", in_len, out_len);
+             fprintf(stderr, " (expand %d to %d)", in_len, out_len);
 #endif
            }
 #ifdef DEBUG_PAGING
-         fprintf (stderr, "\n");
+         fprintf(stderr, "\n");
 #endif
        }
       p->mapped_at = pnum * BLOB_PAGESIZE;
@@ -775,7 +775,7 @@ repopagestore_read_or_setup_pages(Repopagestore *store, FILE *fp, unsigned int p
     can_seek = 0;
 
 #ifdef DEBUG_PAGING
-  fprintf (stderr, "can %sseek\n", can_seek ? "" : "NOT ");
+  fprintf(stderr, "can %sseek\n", can_seek ? "" : "NOT ");
 #endif
   npages = (blobsz + BLOB_PAGESIZE - 1) / BLOB_PAGESIZE;
 
@@ -792,7 +792,7 @@ repopagestore_read_or_setup_pages(Repopagestore *store, FILE *fp, unsigned int p
       Attrblobpage *p = store->pages + i;
       in_len >>= 1;
 #ifdef DEBUG_PAGING
-      fprintf (stderr, "page %d: len %d (%scompressed)\n",
+      fprintf(stderr, "page %d: len %d (%scompressed)\n",
               i, in_len, compressed ? "" : "not ");
 #endif
       if (can_seek)
@@ -847,7 +847,7 @@ repopagestore_disable_paging(Repopagestore *store)
 #ifdef STANDALONE
 
 static void
-transfer_file (FILE * from, FILE * to, int compress)
+transfer_file(FILE * from, FILE * to, int compress)
 {
   unsigned char inb[BLOCK_SIZE];
   unsigned char outb[BLOCK_SIZE];
@@ -856,45 +856,45 @@ transfer_file (FILE * from, FILE * to, int compress)
       unsigned int in_len, out_len;
       if (compress)
        {
-         in_len = fread (inb, 1, BLOCK_SIZE, from);
+         in_len = fread(inb, 1, BLOCK_SIZE, from);
          if (in_len)
            {
              unsigned char *b = outb;
-             out_len = compress_buf (inb, in_len, outb, sizeof (outb));
+             out_len = compress_buf(inb, in_len, outb, sizeof (outb));
              if (!out_len)
                b = inb, out_len = in_len;
-             if (fwrite (&out_len, sizeof (out_len), 1, to) != 1)
+             if (fwrite(&out_len, sizeof (out_len), 1, to) != 1)
                {
-                 perror ("write size");
+                 perror("write size");
                  exit (1);
                }
-             if (fwrite (b, out_len, 1, to) != 1)
+             if (fwrite(b, out_len, 1, to) != 1)
                {
-                 perror ("write data");
+                 perror("write data");
                  exit (1);
                }
            }
        }
       else
        {
-         if (fread (&in_len, sizeof (in_len), 1, from) != 1)
+         if (fread(&in_len, sizeof(in_len), 1, from) != 1)
            {
-             if (feof (from))
+             if (feof(from))
                return;
-             perror ("can't read size");
-             exit (1);
+             perror("can't read size");
+             exit(1);
            }
-         if (fread (inb, in_len, 1, from) != 1)
+         if (fread(inb, in_len, 1, from) != 1)
            {
-             perror ("can't read data");
-             exit (1);
+             perror("can't read data");
+             exit(1);
            }
          out_len =
-           unchecked_decompress_buf (inb, in_len, outb, sizeof (outb));
-         if (fwrite (outb, out_len, 1, to) != 1)
+           unchecked_decompress_buf(inb, in_len, outb, sizeof(outb));
+         if (fwrite(outb, out_len, 1, to) != 1)
            {
-             perror ("can't write output");
-             exit (1);
+             perror("can't write output");
+             exit(1);
            }
        }
     }
@@ -902,7 +902,7 @@ transfer_file (FILE * from, FILE * to, int compress)
 
 /* Just for benchmarking purposes.  */
 static void
-dumb_memcpy (void *dest, const void *src, unsigned int len)
+dumb_memcpy(void *dest, const void *src, unsigned int len)
 {
   char *d = dest;
   const char *s = src;
@@ -911,16 +911,16 @@ dumb_memcpy (void *dest, const void *src, unsigned int len)
 }
 
 static void
-benchmark (FILE * from)
+benchmark(FILE * from)
 {
   unsigned char inb[BLOCK_SIZE];
   unsigned char outb[BLOCK_SIZE];
-  unsigned int in_len = fread (inb, 1, BLOCK_SIZE, from);
+  unsigned int in_len = fread(inb, 1, BLOCK_SIZE, from);
   unsigned int out_len;
   if (!in_len)
     {
-      perror ("can't read from input");
-      exit (1);
+      perror("can't read from input");
+      exit(1);
     }
 
   unsigned int calib_loop;
@@ -932,71 +932,71 @@ benchmark (FILE * from)
 #if 0
   calib_loop = 1;
   per_loop = 0;
-  start = clock ();
-  while ((clock () - start) < CLOCKS_PER_SEC / 4)
+  start = clock();
+  while ((clock() - start) < CLOCKS_PER_SEC / 4)
     {
       calib_loop *= 2;
       for (i = 0; i < calib_loop; i++)
-       dumb_memcpy (outb, inb, in_len);
+       dumb_memcpy(outb, inb, in_len);
       per_loop += calib_loop;
     }
 
-  fprintf (stderr, "memcpy:\nCalibrated to %d iterations per loop\n",
+  fprintf(stderr, "memcpy:\nCalibrated to %d iterations per loop\n",
           per_loop);
 
-  start = clock ();
+  start = clock();
   for (i = 0; i < 10; i++)
     for (j = 0; j < per_loop; j++)
-      dumb_memcpy (outb, inb, in_len);
-  end = clock ();
+      dumb_memcpy(outb, inb, in_len);
+  end = clock();
   seconds = (end - start) / (float) CLOCKS_PER_SEC;
-  fprintf (stderr, "%.2f seconds == %.2f MB/s\n", seconds,
+  fprintf(stderr, "%.2f seconds == %.2f MB/s\n", seconds,
           ((long long) in_len * per_loop * 10) / (1024 * 1024 * seconds));
 #endif
 
   calib_loop = 1;
   per_loop = 0;
-  start = clock ();
-  while ((clock () - start) < CLOCKS_PER_SEC / 4)
+  start = clock();
+  while ((clock() - start) < CLOCKS_PER_SEC / 4)
     {
       calib_loop *= 2;
       for (i = 0; i < calib_loop; i++)
-       compress_buf(inb, in_len, outb, sizeof (outb));
+       compress_buf(inb, in_len, outb, sizeof(outb));
       per_loop += calib_loop;
     }
 
   fprintf(stderr, "compression:\nCalibrated to %d iterations per loop\n",
           per_loop);
 
-  start = clock ();
+  start = clock();
   for (i = 0; i < 10; i++)
     for (j = 0; j < per_loop; j++)
-      compress_buf (inb, in_len, outb, sizeof (outb));
-  end = clock ();
+      compress_buf(inb, in_len, outb, sizeof(outb));
+  end = clock();
   seconds = (end - start) / (float) CLOCKS_PER_SEC;
   fprintf(stderr, "%.2f seconds == %.2f MB/s\n", seconds,
           ((long long) in_len * per_loop * 10) / (1024 * 1024 * seconds));
 
-  out_len = compress_buf(inb, in_len, outb, sizeof (outb));
+  out_len = compress_buf(inb, in_len, outb, sizeof(outb));
 
   calib_loop = 1;
   per_loop = 0;
-  start = clock ();
-  while ((clock () - start) < CLOCKS_PER_SEC / 4)
+  start = clock();
+  while ((clock() - start) < CLOCKS_PER_SEC / 4)
     {
       calib_loop *= 2;
       for (i = 0; i < calib_loop; i++)
-       unchecked_decompress_buf(outb, out_len, inb, sizeof (inb));
+       unchecked_decompress_buf(outb, out_len, inb, sizeof(inb));
       per_loop += calib_loop;
     }
 
   fprintf(stderr, "decompression:\nCalibrated to %d iterations per loop\n",
           per_loop);
 
-  start = clock ();
+  start = clock();
   for (i = 0; i < 10; i++)
     for (j = 0; j < per_loop; j++)
-      unchecked_decompress_buf(outb, out_len, inb, sizeof (inb));
+      unchecked_decompress_buf(outb, out_len, inb, sizeof(inb));
   end = clock();
   seconds = (end - start) / (float) CLOCKS_PER_SEC;
   fprintf(stderr, "%.2f seconds == %.2f MB/s\n", seconds,
@@ -1004,15 +1004,15 @@ benchmark (FILE * from)
 }
 
 int
-main (int argc, char *argv[])
+main(int argc, char *argv[])
 {
   int compress = 1;
-  if (argc > 1 && !strcmp (argv[1], "-d"))
+  if (argc > 1 && !strcmp(argv[1], "-d"))
     compress = 0;
-  if (argc > 1 && !strcmp (argv[1], "-b"))
-    benchmark (stdin);
+  if (argc > 1 && !strcmp(argv[1], "-b"))
+    benchmark(stdin);
   else
-    transfer_file (stdin, stdout, compress);
+    transfer_file(stdin, stdout, compress);
   return 0;
 }
 
index f55d691..6c23b0c 100644 (file)
@@ -3149,9 +3149,11 @@ problems_to_solutions(Solver *solv, Queue *job)
   Id *problem;
   Id why;
   int i, j, nsol;
+  unsigned int now, refnow;
 
   if (!solv->problems.count)
     return;
+  now = sat_timems(0);
   problems_sort(solv);
   queue_clone(&problems, &solv->problems);
   queue_init(&solution);
@@ -3159,6 +3161,7 @@ problems_to_solutions(Solver *solv, Queue *job)
   /* copy over proof index */
   queue_push(&solutions, problems.elements[0]);
   problem = problems.elements + 1;
+  refnow = sat_timems(0);
   for (i = 1; i < problems.count; i++)
     {
       Id v = problems.elements[i];
@@ -3167,12 +3170,14 @@ problems_to_solutions(Solver *solv, Queue *job)
          /* mark end of this problem */
          queue_push(&solutions, 0);
          queue_push(&solutions, 0);
+         POOL_DEBUG(SAT_DEBUG_STATS, "refining took %d ms\n", sat_timems(refnow));
          if (i + 1 == problems.count)
            break;
          /* copy over proof of next problem */
           queue_push(&solutions, problems.elements[i + 1]);
          i++;
          problem = problems.elements + i + 1;
+         refnow = sat_timems(0);
          continue;
        }
       refine_suggestion(solv, job, problem, v, &solution);
@@ -3261,6 +3266,7 @@ problems_to_solutions(Solver *solv, Queue *job)
 
   assert(solv->problems.count == solutions.count);
   queue_free(&solutions);
+  POOL_DEBUG(SAT_DEBUG_STATS, "problems_to_solutions took %d ms\n", sat_timems(now));
 }
 
 
@@ -3922,7 +3928,9 @@ solver_solve(Solver *solv, Queue *job)
   Solvable *s;
   int goterase;
   Rule *r;
+  int now, solve_start;
 
+  solve_start = sat_timems(0);
   POOL_DEBUG(SAT_DEBUG_STATS, "solver started\n");
   POOL_DEBUG(SAT_DEBUG_STATS, "fixsystem=%d updatesystem=%d dosplitprovides=%d, noupdateprovide=%d\n", solv->fixsystem, solv->updatesystem, solv->dosplitprovides, solv->noupdateprovide);
   POOL_DEBUG(SAT_DEBUG_STATS, "distupgrade=%d distupgrade_removeunsupported=%d\n", solv->distupgrade, solv->distupgrade_removeunsupported);
@@ -3969,6 +3977,7 @@ solver_solve(Solver *solv, Queue *job)
   queue_push(&solv->decisionq_why, 0);
   solv->decisionmap[SYSTEMSOLVABLE] = 1; /* installed at level '1' */
 
+  now = sat_timems(0);
   /*
    * create rules for all package that could be involved with the solving
    * so called: rpm rules
@@ -4056,6 +4065,7 @@ solver_solve(Solver *solv, Queue *job)
 
   solv->directdecisions = solv->decisionq.count;
   POOL_DEBUG(SAT_DEBUG_STATS, "decisions so far: %d\n", solv->decisionq.count);
+  POOL_DEBUG(SAT_DEBUG_STATS, "rpm rule creation took %d ms\n", sat_timems(now));
 
   /*
    * create feature rules
@@ -4341,7 +4351,9 @@ solver_solve(Solver *solv, Queue *job)
    * ********************************************
    */
     
+  now = sat_timems(0);
   run_solver(solv, 1, solv->dontinstallrecommended ? 0 : 1);
+  POOL_DEBUG(SAT_DEBUG_STATS, "solver took %d ms\n", sat_timems(now));
 
   queue_init(&redoq);
   goterase = 0;
@@ -4527,8 +4539,9 @@ solver_solve(Solver *solv, Queue *job)
       solv->recommendations.count = recocount;
     }
 
-  POOL_DEBUG(SAT_DEBUG_STATS, "final solver statistics: %d learned rules, %d unsolvable\n", solv->stats_learned, solv->stats_unsolvable);
   queue_free(&redoq);
+  POOL_DEBUG(SAT_DEBUG_STATS, "final solver statistics: %d learned rules, %d unsolvable\n", solv->stats_learned, solv->stats_unsolvable);
+  POOL_DEBUG(SAT_DEBUG_STATS, "solver_solve took %d ms\n", sat_timems(solve_start));
 }
 
 /***********************************************************************/
index 2956a75..77d66fd 100644 (file)
@@ -70,7 +70,7 @@ stringpool_clone(Stringpool *ss, Stringpool *from)
 }
 
 Id
-stringpool_strn2id (Stringpool *ss, const char *str, unsigned len, int create)
+stringpool_strn2id(Stringpool *ss, const char *str, unsigned len, int create)
 {
   Hashval h;
   unsigned int hh;
@@ -148,18 +148,18 @@ stringpool_strn2id (Stringpool *ss, const char *str, unsigned len, int create)
 }
 
 Id
-stringpool_str2id (Stringpool *ss, const char *str, int create)
+stringpool_str2id(Stringpool *ss, const char *str, int create)
 {
-  if ( !str )
+  if (!str)
     return STRID_NULL;
-  if ( !*str )
+  if (!*str)
     return STRID_EMPTY;
-  unsigned len = strlen (str);
-  return stringpool_strn2id (ss, str, len, create);
+  unsigned len = strlen(str);
+  return stringpool_strn2id(ss, str, len, create);
 }
 
 void
-stringpool_shrink (Stringpool *ss)
+stringpool_shrink(Stringpool *ss)
 {
   ss->stringspace = sat_extend_resize(ss->stringspace, ss->sstrings, 1, STRINGSPACE_BLOCK);
   ss->strings = sat_extend_resize(ss->strings, ss->nstrings, sizeof(Offset), STRING_BLOCK);
index cf30017..915dd1b 100644 (file)
@@ -9,6 +9,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
+#include <sys/time.h>
 
 #include "util.h"
 
@@ -81,3 +82,17 @@ sat_free(void *mem)
   return 0;
 }
 
+unsigned int
+sat_timems(unsigned int subtract)
+{
+  struct timeval tv;
+  unsigned int r;
+
+  if (gettimeofday(&tv, 0))
+    return 0;
+  r = (((unsigned int)tv.tv_sec >> 16) * 1000) << 16;
+  r += ((unsigned int)tv.tv_sec & 0xffff) * 1000;
+  r += (unsigned int)tv.tv_usec / 1000;
+  return r - subtract;
+}
+
index c5d3d15..7662b62 100644 (file)
@@ -27,6 +27,7 @@ extern void *sat_realloc(void *, size_t);
 extern void *sat_realloc2(void *, size_t, size_t);
 extern void *sat_free(void *);
 extern void sat_oom(size_t, size_t);
+extern unsigned int sat_timems(unsigned int subtract);
 
 static inline void *sat_extend(void *buf, size_t len, size_t nmemb, size_t size, size_t block)
 {
index 4f0bef5..bc016e5 100644 (file)
@@ -142,7 +142,7 @@ adddep(Pool *pool, struct parsedata *pd, unsigned int olddeps, char *line, Id ma
 
          if (!rel || !evr)
            {
-             fprintf(stderr, "repo_content: bad relation '%s %s'\n", name, rel);
+             pool_debug(pool, SAT_FATAL, "repo_content: bad relation '%s %s'\n", name, rel);
              exit(1);
            }
          for (flags = 0; flags < 6; flags++)
@@ -150,7 +150,7 @@ adddep(Pool *pool, struct parsedata *pd, unsigned int olddeps, char *line, Id ma
              break;
          if (flags == 6)
            {
-             fprintf(stderr, "repo_content: Unknown relation '%s'\n", rel);
+             pool_debug(pool, SAT_FATAL, "repo_content: unknown relation '%s'\n", rel);
              exit(1);
            }
          id = rel2id(pool, id, str2id(pool, evr, 1), flags + 1, 1);
@@ -367,7 +367,7 @@ repo_add_content(Repo *repo, FILE *fp, int flags)
 
          else if (code10 && istag ("CONTENTSTYLE"))
            /* CONTENTSTYLE must be first line */
-           fprintf(stderr, "repo_content: 'CONTENTSTYLE' must be first line of 'content'\n");
+           pool_debug(pool, SAT_ERROR, "repo_content: 'CONTENTSTYLE' must be first line of 'content'\n");
          else if (code10 && istag ("DISTPRODUCT"))
            /* DISTPRODUCT is for registration and Yast, not for the solver. */
            repo_set_str(repo, s - pool->solvables, PRODUCT_DISTPRODUCT, value);
@@ -407,12 +407,12 @@ repo_add_content(Repo *repo, FILE *fp, int flags)
 #undef istag
        }
       else
-       fprintf (stderr, "repo_content: malformed line: %s\n", line);
+       pool_debug(pool, SAT_ERROR, "repo_content: malformed line: %s\n", line);
     }
 
   if (!s || !s->name)
     {
-      fprintf(stderr, "repo_content: 'content' incomplete, no product solvable created !\n");
+      pool_debug(pool, SAT_FATAL, "repo_content: 'content' incomplete, no product solvable created !\n");
       exit(1);
     }
 
index 5f22859..6bc0cc9 100644 (file)
@@ -285,7 +285,7 @@ startElement(void *userData, const char *name, const char **atts)
   const char *str;
 
 #if 0
-      fprintf(stderr, "start: [%d]%s\n", pd->state, name);
+  fprintf(stderr, "start: [%d]%s\n", pd->state, name);
 #endif
   if (pd->depth != pd->statedepth)
     {
@@ -301,7 +301,7 @@ startElement(void *userData, const char *name, const char **atts)
       break;
   if (sw->from != pd->state)
     {
-#if 1
+#if 0
       fprintf(stderr, "into unknown: [%d]%s (from: %d)\n", sw->to, name, sw->from);
       exit( 1 );
 #endif
@@ -355,7 +355,7 @@ startElement(void *userData, const char *name, const char **atts)
          else if (!strcasecmp(str, "md5"))
            pd->delta.filechecksumtype = REPOKEY_TYPE_MD5;
          else
-           fprintf(stderr, "warning: unknown checksum type: '%s'\n", str);
+           pool_debug(pool, SAT_ERROR, "unknown checksum type: '%s'\n", str);
        }
     case STATE_SEQUENCE:
       break;
@@ -373,12 +373,12 @@ endElement(void *userData, const char *name)
   const char *str;
 
 #if 0
-      fprintf(stderr, "end: %s\n", name);
+  fprintf(stderr, "end: %s\n", name);
 #endif
   if (pd->depth != pd->statedepth)
     {
       pd->depth--;
-#if 1
+#if 0
       fprintf(stderr, "back from unknown %d %d %d\n", pd->state, pd->depth, pd->statedepth);
 #endif
       return;
@@ -585,7 +585,7 @@ repo_add_deltainfoxml(Repo *repo, FILE *fp, int flags)
       l = fread(buf, 1, sizeof(buf), fp);
       if (XML_Parse(parser, buf, l, l == 0) == XML_STATUS_ERROR)
        {
-         fprintf(stderr, "repo_updateinfoxml: %s at line %u:%u\n", XML_ErrorString(XML_GetErrorCode(parser)), (unsigned int)XML_GetCurrentLineNumber(parser), (unsigned int)XML_GetCurrentColumnNumber(parser));
+         pool_debug(pool, SAT_FATAL, "repo_updateinfoxml: %s at line %u:%u\n", XML_ErrorString(XML_GetErrorCode(parser)), (unsigned int)XML_GetCurrentLineNumber(parser), (unsigned int)XML_GetCurrentColumnNumber(parser));
          exit(1);
        }
       if (l == 0)
index f7cbaf1..726dce7 100644 (file)
@@ -271,7 +271,7 @@ endElement(void *userData, const char *name)
       if (pd->ctime)
         repodata_set_num(pd->data, pd->handle, SOLVABLE_INSTALLTIME, pd->ctime);
 
-      if ( pd->basename )
+      if (pd->basename)
         repodata_set_str(pd->data, pd->handle, PRODUCT_REFERENCEFILE, pd->basename);
 
       /* this is where <productsdir>/baseproduct points to */
@@ -660,7 +660,6 @@ repo_add_products(Repo *repo, const char *proddir, const char *root, const char
   sat_free(pd.content);
   join_freemem();
 
-
   if (!(flags & REPO_NO_INTERNALIZE))
     repodata_internalize(data);
 }
index e60ffbf..d5e2dfb 100644 (file)
@@ -77,7 +77,7 @@ adddep(Pool *pool, struct parsedata *pd, unsigned int olddeps, char *line, Id ma
       i = split(line + 5, sp, 4); /* name, <op>, evr, ? */
       if (i != 1 && i != 3) /* expect either 'name' or 'name' <op> 'evr' */
         {
-          fprintf(stderr, "Bad dependency line: %d: %s\n", pd->lineno, line);
+         pool_debug(pool, SAT_FATAL, "susetags: bad dependency line: %d: %s\n", pd->lineno, line);
           exit(1);
         }
       if (kind)
@@ -92,7 +92,7 @@ adddep(Pool *pool, struct parsedata *pd, unsigned int olddeps, char *line, Id ma
               break;
           if (flags == 6)
             {
-              fprintf(stderr, "Unknown relation %d: '%s'\n", pd->lineno, sp[1]);
+             pool_debug(pool, SAT_FATAL, "susetags: unknown relation in %d: '%s'\n", pd->lineno, sp[1]);
               exit(1);
             }
           id = rel2id(pool, id, evrid, flags + 1, 1);
@@ -117,7 +117,7 @@ add_location(struct parsedata *pd, char *line, Solvable *s, Id handle)
   i = split(line, sp, 3);
   if (i != 2 && i != 3)
     {
-      fprintf(stderr, "Bad location line: %d: %s\n", pd->lineno, line);
+      pool_debug(pool, SAT_FATAL, "susetags: bad location line: %d: %s\n", pd->lineno, line);
       exit(1);
     }
   /* If we have a dirname, let's see if it's the same as arch.  In that
@@ -187,7 +187,7 @@ add_source(struct parsedata *pd, char *line, Solvable *s, Id handle)
 
   if (split(line, sp, 5) != 4)
     {
-      fprintf(stderr, "Bad source line: %d: %s\n", pd->lineno, line);
+      pool_debug(pool, SAT_FATAL, "susetags: bad source line: %d: %s\n", pd->lineno, line);
       exit(1);
     }
 
@@ -244,7 +244,7 @@ set_checksum(struct parsedata *pd, Repodata *data, Id handle, Id keyname, char *
   Id type;
   if (split(line, sp, 3) != 2)
     {
-      fprintf(stderr, "Bad source line: %d: %s\n", pd->lineno, line);
+      pool_debug(pd->repo->pool, SAT_FATAL, "susetags: bad checksum line: %d: %s\n", pd->lineno, line);
       exit(1);
     }
   if (!strcasecmp (sp[0], "sha1"))
@@ -253,12 +253,12 @@ set_checksum(struct parsedata *pd, Repodata *data, Id handle, Id keyname, char *
     l = SIZEOF_MD5 * 2, type = REPOKEY_TYPE_MD5;
   else
     {
-      fprintf(stderr, "Unknown checksum type: %d: %s\n", pd->lineno, sp[0]);
+      pool_debug(pd->repo->pool, SAT_FATAL, "susetags: unknown checksum type: %d: %s\n", pd->lineno, sp[0]);
       exit(1);
     }
   if (strlen(sp[1]) != l)
     {
-      fprintf(stderr, "Invalid checksum length: %d: for %s: %s\n", pd->lineno, sp[0], sp[1]);
+      pool_debug(pd->repo->pool, SAT_FATAL, "susetags: bad checksum length: %d: for %s: %s\n", pd->lineno, sp[0], sp[1]);
       exit(1);
     }
   repodata_set_checksum(data, handle, keyname, type, sp[1]);
@@ -559,7 +559,7 @@ repo_add_susetags(Repo *repo, FILE *fp, Id product, const char *language, int fl
          if (is_end
              && strncmp(linep - 1 - intag, line + 1, intag))
            {
-             fprintf(stderr, "Nonmatching multi-line tags: %d: '%s' '%s' %d\n", pd.lineno, linep - 1 - intag, line + 1, intag);
+             pool_debug(pool, SAT_ERROR, "susetags: Nonmatching multi-line tags: %d: '%s' '%s' %d\n", pd.lineno, linep - 1 - intag, line + 1, intag);
            }
          if (cummulate && !is_end)
            {
@@ -591,7 +591,7 @@ repo_add_susetags(Repo *repo, FILE *fp, Id product, const char *language, int fl
          char *tagend = strchr(line, ':');
          if (!tagend)
            {
-             fprintf(stderr, "bad line: %d: %s\n", pd.lineno, line);
+             pool_debug(pool, SAT_FATAL, "susetags: bad line: %d: %s\n", pd.lineno, line);
              exit(1);
            }
          intag = tagend - (line + 1);
@@ -666,7 +666,7 @@ repo_add_susetags(Repo *repo, FILE *fp, Id product, const char *language, int fl
 
           if (split(line + 5, sp, 5) != 4)
            {
-             fprintf(stderr, "Bad line: %d: %s\n", pd.lineno, line);
+             pool_debug(pool, SAT_FATAL, "susetags: bad line: %d: %s\n", pd.lineno, line);
              exit(1);
            }
          /* Lookup (but don't construct) the name and arch.  */
@@ -964,7 +964,7 @@ repo_add_susetags(Repo *repo, FILE *fp, Id product, const char *language, int fl
            break;
 
          default:
-            fprintf(stderr,"unknown line %s\n", line);
+           pool_debug(pool, SAT_ERROR, "susetags: unknown line: %d: %s\n", pd.lineno, line);
            break;
        }
 
@@ -985,7 +985,7 @@ repo_add_susetags(Repo *repo, FILE *fp, Id product, const char *language, int fl
          {
            if (split(pd.share_with[i], sp, 5) != 4)
              {
-               fprintf(stderr, "Bad =Shr line: %s\n", pd.share_with[i]);
+               pool_debug(pool, SAT_FATAL, "susetags: bad =Shr line: %s\n", pd.share_with[i]);
                exit(1);
              }