Teach rpm tag table about extensions
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 14 May 2008 10:20:46 +0000 (13:20 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 14 May 2008 10:20:46 +0000 (13:20 +0300)
- add rpmTag_e enumerations for all extension tags
- add extension field to headerTagTableEntry_s for things that are "pure"
  extensions (instead of just extension overrides) so we have a chance to
  catch out anybody trying to insert such tags to headers

lib/gentagtbl.sh
lib/header.h
lib/rpmtag.h

index 04ad2fe..3f6f7b5 100755 (executable)
@@ -12,6 +12,7 @@ EOF
 ${AWK} '/[\t ](RPMTAG_[A-Z0-9]*)[ \t]+([0-9]*)/ && !/internal/ {
        tt = "NULL"
        ta = "ANY"
+       ext = "0"
        if ($5 == "c") {
                tt = "CHAR"
                ta = "SCALAR"
@@ -60,6 +61,9 @@ ${AWK} '/[\t ](RPMTAG_[A-Z0-9]*)[ \t]+([0-9]*)/ && !/internal/ {
                tt = "BIN"
                ta = "SCALAR"
        }
+       if ($6 == "extension") {
+               ext = "1"
+       }
        if ($2 == "=") {
                tnarg = $1
        } else {
@@ -68,14 +72,14 @@ ${AWK} '/[\t ](RPMTAG_[A-Z0-9]*)[ \t]+([0-9]*)/ && !/internal/ {
        tn = substr(tnarg, index(tnarg, "_") + 1)
        sn = (substr(tn, 1, 1) tolower(substr(tn, 2)))
        if ($2 == "=") {
-               printf("    { \"%s\", \"%s\", %s RPM_%s_TYPE + RPM_%s_RETURN_TYPE  },\n", tnarg, sn, $3, tt, ta)
+               printf("    { \"%s\", \"%s\", %s RPM_%s_TYPE + RPM_%s_RETURN_TYPE, %d },\n", tnarg, sn, $3, tt, ta, ext)
        } else {
-               printf("    { \"%s\", \"%s\", %s, RPM_%s_TYPE + RPM_%s_RETURN_TYPE  },\n", tnarg, sn, $3, tt, ta)
+               printf("    { \"%s\", \"%s\", %s, RPM_%s_TYPE + RPM_%s_RETURN_TYPE, %d },\n", tnarg, sn, $3, tt, ta, ext)
        }
 }' < $1 | sort
 
 cat << EOF
-    { NULL, NULL, 0, 0 }
+    { NULL, NULL, 0, 0, 0 }
 };
 
 const struct headerTagTableEntry_s * const rpmTagTable = rpmTagTbl;
index 0c63218..fab8311 100644 (file)
@@ -30,6 +30,7 @@ struct headerTagTableEntry_s {
     const char * shortname;    /*!< "Human readable" short name. */
     rpmTag val;                        /*!< Tag numeric value. */
     rpmTagType type;           /*!< Tag type. */
+    int extension;             /*!< Extension or "real" tag */
 };
 
 /**
index 9432dec..2da6b49 100644 (file)
@@ -265,6 +265,13 @@ typedef enum rpmTag_e {
     RPMTAG_REQUIREATTRSX       = 1192, /* i[] (unimplemented) */
     RPMTAG_BUILDPROVIDES       = 1193, /* internal */
     RPMTAG_BUILDOBSOLETES      = 1194, /* internal */
+    RPMTAG_FILENAMES           = 5000, /* s[] extension */
+    RPMTAG_FILEPROVIDE         = 5001, /* s[] extension */
+    RPMTAG_FILEREQUIRE         = 5002, /* s[] extension */
+    RPMTAG_FSNAMES             = 5003, /* s[] extension */
+    RPMTAG_FSSIZES             = 5004, /* i[] extension */
+    RPMTAG_TRIGGERCONDS                = 5005, /* s[] extension */
+    RPMTAG_TRIGGERTYPE         = 5006, /* s[] extension */
 
     RPMTAG_FIRSTFREE_TAG       /*!< internal */
 } rpmTag;