poldek: poldek/pkgu.c, poldek/pkgu.h, poldek/cli/desc.c - added source rpm ...

mis mis at pld-linux.org
Thu May 8 22:35:52 CEST 2008


Author: mis                          Date: Thu May  8 20:35:52 2008 GMT
Module: poldek                        Tag: HEAD
---- Log message:
- added source rpm filename to pndir index (megabajt). This unfortunately 
  breaks backward compat because of stupid bug. 

---- Files affected:
poldek/poldek:
   pkgu.c (1.35 -> 1.36) , pkgu.h (1.11 -> 1.12) 
poldek/poldek/cli:
   desc.c (1.32 -> 1.33) 

---- Diffs:

================================================================
Index: poldek/poldek/pkgu.c
diff -u poldek/poldek/pkgu.c:1.35 poldek/poldek/pkgu.c:1.36
--- poldek/poldek/pkgu.c:1.35	Sun Feb 24 23:14:08 2008
+++ poldek/poldek/pkgu.c	Thu May  8 22:35:47 2008
@@ -39,7 +39,7 @@
 #define NA_OWNED             (1 << 0)
 #define RECODE_SUMMMARY      (1 << 1) /* needs to be recoded */
 #define RECODE_DESCRIPTION   (1 << 2)
-#define SUMMARY_RECODED     (1 << 3) /* already recoded     */
+#define SUMMARY_RECODED      (1 << 3) /* already recoded     */
 #define DESCRITPION_RECODED  (1 << 4)
 
 struct pkguinf {
@@ -51,6 +51,7 @@
     char              *vendor;
     char              *buildhost;
     char              *distro;
+    char              *sourcerpm;
     
     tn_hash           *_ht;
     tn_array          *_langs;
@@ -113,6 +114,7 @@
     pkgu->_description = NULL;
     pkgu->vendor = NULL;
     pkgu->buildhost = NULL;
+    pkgu->sourcerpm = NULL;
 
     pkgu->_ht = NULL;
     pkgu->_langs = NULL;
@@ -347,6 +349,7 @@
     pkgu->url = cp_tag(pkgu->_na, h, RPMTAG_URL);
     pkgu->distro = cp_tag(pkgu->_na, h, RPMTAG_DISTRIBUTION);
     pkgu->buildhost = cp_tag(pkgu->_na, h, RPMTAG_BUILDHOST);
+    pkgu->sourcerpm = cp_tag(pkgu->_na, h, RPMTAG_SOURCERPM);
 
     return pkgu;
 }
@@ -404,7 +407,15 @@
             n_buf_puts(nbuf, pkgu->distro);
             n_buf_putc(nbuf, '\0');
         }
-        
+
+        if (pkgu->sourcerpm) {
+            
+    	    n_buf_putc(nbuf, PKGUINF_SOURCERPM);
+    	    n_buf_putc(nbuf, '\0');
+    	    n_buf_puts(nbuf, pkgu->sourcerpm);
+    	    n_buf_putc(nbuf, '\0');
+        }
+
         n_buf_putc(nbuf, PKGUINF_TAG_ENDCMN);
         n_buf_putc(nbuf, '\0');
     }
@@ -494,8 +505,13 @@
                     set_member(pkgu, &pkgu->distro, val, len);
                     break;
 
+                case PKGUINF_SOURCERPM:
+                    set_member(pkgu, &pkgu->sourcerpm, val, len);
+                    break;
+
                 default:
-                    n_assert(0);
+                    /* skip unknown tag */
+                    ;
             }
         }
     }
@@ -559,6 +575,9 @@
 
         case PKGUINF_DISTRO:
             return pkgu->distro;
+
+        case PKGUINF_SOURCERPM:
+    	    return pkgu->sourcerpm;
             
         case PKGUINF_SUMMARY:
             val = (char**)&pkgu->_summary;
@@ -628,6 +647,10 @@
             set_member(pkgu, &pkgu->distro, val, len);
             break;
 
+        case PKGUINF_SOURCERPM:
+            set_member(pkgu, &pkgu->sourcerpm, val, len);
+            break;
+
         case PKGUINF_SUMMARY:
         case PKGUINF_DESCRIPTION: 
         {

================================================================
Index: poldek/poldek/pkgu.h
diff -u poldek/poldek/pkgu.h:1.11 poldek/poldek/pkgu.h:1.12
--- poldek/poldek/pkgu.h:1.11	Tue Oct 18 18:25:12 2005
+++ poldek/poldek/pkgu.h	Thu May  8 22:35:47 2008
@@ -14,6 +14,7 @@
 #define PKGUINF_VENDOR       'v'
 #define PKGUINF_BUILDHOST    'b'
 #define PKGUINF_DISTRO       'D'
+#define PKGUINF_SOURCERPM    'S'
 
 struct pkguinf;
 

================================================================
Index: poldek/poldek/cli/desc.c
diff -u poldek/poldek/cli/desc.c:1.32 poldek/poldek/cli/desc.c:1.33
--- poldek/poldek/cli/desc.c:1.32	Sat Feb  2 22:16:36 2008
+++ poldek/poldek/cli/desc.c	Thu May  8 22:35:47 2008
@@ -882,6 +882,11 @@
         cmdctx_printf(cmdctx, "%s\n", pkg_pkgdirpath(pkg));
     }
 
+    if (pkgu && (s = pkguinf_get(pkgu, PKGUINF_SOURCERPM))) {
+        cmdctx_printf_c(cmdctx, PRCOLOR_CYAN, "%-16s", "Source RPM:");
+        cmdctx_printf(cmdctx, "%s\n", s);
+    }
+
     if ((fn = pkg_filename(pkg, fnbuf, sizeof(fnbuf)))) {
         cmdctx_printf_c(cmdctx, PRCOLOR_CYAN, "%-16s", "File:");
         cmdctx_printf(cmdctx, "%s\n", fn);
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/poldek/poldek/pkgu.c?r1=1.35&r2=1.36&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/poldek/poldek/pkgu.h?r1=1.11&r2=1.12&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/poldek/poldek/cli/desc.c?r1=1.32&r2=1.33&f=u



More information about the pld-cvs-commit mailing list