/src/main/java/org/redline_rpm/header/Header.java

http://github.com/craigwblake/redline · Java · 130 lines · 116 code · 14 blank · 0 comment · 1 complexity · c69b9e5b47eaec73c755de59f9654e32 MD5 · raw file

  1. package org.redline_rpm.header;
  2. public class Header extends AbstractHeader {
  3. public Header() {
  4. for ( HeaderTag tag : HeaderTag.values()) tags.put( tag.getCode(), tag);
  5. }
  6. protected boolean pad() { return false; }
  7. public enum HeaderTag implements Tag {
  8. NAME( 1000, STRING_ENTRY, "name"),
  9. VERSION( 1001, STRING_ENTRY, "version"),
  10. RELEASE( 1002, STRING_ENTRY, "release"),
  11. EPOCH( 1003, INT32_ENTRY, "epoch"),
  12. SUMMARY( 1004, I18NSTRING_ENTRY, "summary"),
  13. DESCRIPTION( 1005, I18NSTRING_ENTRY, "description"),
  14. BUILDTIME( 1006, INT32_ENTRY, "buildtime"),
  15. BUILDHOST( 1007, STRING_ENTRY, "buildhost"),
  16. SIZE( 1009, INT32_ENTRY, "size"),
  17. DISTRIBUTION( 1010, STRING_ENTRY, "distribution"),
  18. VENDOR( 1011, STRING_ENTRY, "vendor"),
  19. LICENSE( 1014, STRING_ENTRY, "license"),
  20. PACKAGER( 1015, STRING_ENTRY, "packager"),
  21. GROUP( 1016, I18NSTRING_ENTRY, "group"),
  22. CHANGELOG( 1017, STRING_ARRAY_ENTRY, "changelog"), //
  23. URL( 1020, STRING_ENTRY, "url"),
  24. OS( 1021, STRING_ENTRY, "os"),
  25. ARCH( 1022, STRING_ENTRY, "arch"),
  26. SOURCERPM( 1044, STRING_ENTRY, "sourcerpm"),
  27. FILEVERIFYFLAGS( 1045, INT32_ENTRY, "fileverifyflags"),
  28. ARCHIVESIZE( 1046, INT32_ENTRY, "archivesize"),
  29. RPMVERSION( 1064, STRING_ENTRY, "rpmversion"),
  30. CHANGELOGTIME( 1080, INT32_ENTRY, "changelogtime"),
  31. CHANGELOGNAME( 1081, STRING_ARRAY_ENTRY, "changelogname"),
  32. CHANGELOGTEXT( 1082, STRING_ARRAY_ENTRY, "changelogtext"),
  33. COOKIE( 1094, STRING_ENTRY, "cookie"),
  34. OPTFLAGS( 1122, STRING_ENTRY, "optflags"),
  35. PAYLOADFORMAT( 1124, STRING_ENTRY, "payloadformat"),
  36. PAYLOADCOMPRESSOR( 1125, STRING_ENTRY, "payloadcompressor"),
  37. PAYLOADFLAGS( 1126, STRING_ENTRY, "payloadflags"),
  38. RHNPLATFORM( 1131, STRING_ENTRY, "rhnplatform"),
  39. PLATFORM( 1132, STRING_ENTRY, "platform"),
  40. FILECOLORS( 1140, INT32_ENTRY, "filecolors"),
  41. FILECLASS( 1141, INT32_ENTRY, "fileclass"),
  42. CLASSDICT( 1142, STRING_ARRAY_ENTRY, "classdict"),
  43. FILEDEPENDSX( 1143, INT32_ENTRY, "filedependsx"),
  44. FILEDEPENDSN( 1144, INT32_ENTRY, "filedependsn"),
  45. DEPENDSDICT( 1145, INT32_ENTRY, "dependsdict"),
  46. SOURCEPKGID( 1146, BIN_ENTRY, "sourcepkgid"),
  47. FILECONTEXTS( 1147, STRING_ARRAY_ENTRY, "filecontexts"),
  48. HEADERIMMUTABLE( 63, BIN_ENTRY, "headerimmutable"),
  49. HEADERI18NTABLE( 100, STRING_ARRAY_ENTRY, "headeri18ntable"),
  50. PREINSCRIPT( 1023, STRING_ENTRY, "prein"),
  51. POSTINSCRIPT( 1024, STRING_ENTRY, "postin"),
  52. PREUNSCRIPT( 1025, STRING_ENTRY, "preun"),
  53. POSTUNSCRIPT( 1026, STRING_ENTRY, "postun"),
  54. PREINPROG( 1085, STRING_ENTRY, "preinprog"),
  55. POSTINPROG( 1086, STRING_ENTRY, "postinprog"),
  56. PREUNPROG( 1087, STRING_ENTRY, "preunprog"),
  57. POSTUNPROG( 1088, STRING_ENTRY, "postunprog"),
  58. PRETRANSSCRIPT( 1151, STRING_ENTRY, "pretrans"),
  59. POSTTRANSSCRIPT( 1152, STRING_ENTRY, "posttrans"),
  60. PRETRANSPROG( 1153, STRING_ENTRY, "pretransprog"),
  61. POSTTRANSPROG( 1154, STRING_ENTRY, "pretransprog"),
  62. TRIGGERSCRIPTS( 1065, STRING_ARRAY_ENTRY, "triggerscripts"),
  63. TRIGGERNAME( 1066, STRING_ARRAY_ENTRY, "triggername"),
  64. TRIGGERVERSION( 1067, STRING_ARRAY_ENTRY, "triggerversion"),
  65. TRIGGERFLAGS( 1068, INT32_ENTRY, "triggerflags"),
  66. TRIGGERINDEX( 1069, INT32_ENTRY, "triggerindex"),
  67. TRIGGERSCRIPTPROG( 1092, STRING_ARRAY_ENTRY, "triggerscriptprog"),
  68. OLDFILENAMES( 1027, STRING_ARRAY_ENTRY, "oldfilenames"),
  69. FILESIZES( 1028, INT32_ENTRY, "filesizes"),
  70. FILEMODES( 1030, INT16_ENTRY, "filemodes"),
  71. FILERDEVS( 1033, INT16_ENTRY, "filerdevs"),
  72. FILEMTIMES( 1034, INT32_ENTRY, "filemtimes"),
  73. FILEDIGESTS( 1035, STRING_ARRAY_ENTRY, "filedigests"),
  74. FILELINKTOS( 1036, STRING_ARRAY_ENTRY, "filelinktos"),
  75. FILEFLAGS( 1037, INT32_ENTRY, "fileflags"),
  76. FILEUSERNAME( 1039, STRING_ARRAY_ENTRY, "fileusername"),
  77. FILEGROUPNAME( 1040, STRING_ARRAY_ENTRY, "filegroupname"),
  78. FILEDEVICES( 1095, INT32_ENTRY, "filedevices"),
  79. FILEINODES( 1096, INT32_ENTRY, "fileinodes"),
  80. FILELANGS( 1097, STRING_ARRAY_ENTRY, "filelangs"),
  81. PREFIXES( 1098, STRING_ARRAY_ENTRY, "prefixes"),
  82. DIRINDEXES( 1116, INT32_ENTRY, "dirindexes"),
  83. BASENAMES( 1117, STRING_ARRAY_ENTRY, "basenames"),
  84. DIRNAMES( 1118, STRING_ARRAY_ENTRY, "dirnames"),
  85. PROVIDENAME( 1047, STRING_ARRAY_ENTRY, "providename"),
  86. REQUIREFLAGS( 1048, INT32_ENTRY, "requireflags"),
  87. REQUIRENAME( 1049, STRING_ARRAY_ENTRY, "requirename"),
  88. REQUIREVERSION( 1050, STRING_ARRAY_ENTRY, "requireversion"),
  89. CONFLICTFLAGS( 1053, INT32_ENTRY, "conflictflags"),
  90. CONFLICTNAME( 1054, STRING_ARRAY_ENTRY, "conflictname"),
  91. CONFLICTVERSION( 1055, STRING_ARRAY_ENTRY, "conflictversion"),
  92. OBSOLETENAME( 1090, STRING_ARRAY_ENTRY, "obsoletename"),
  93. PROVIDEFLAGS( 1112, INT32_ENTRY, "provideflags"),
  94. PROVIDEVERSION( 1113, STRING_ARRAY_ENTRY, "provideversion"),
  95. OBSOLETEFLAGS( 1114, INT32_ENTRY, "obsoleteflags"),
  96. OBSOLETEVERSION( 1115, STRING_ARRAY_ENTRY, "obsoleteversion"),
  97. DISTURL( 1123, STRING_ENTRY, "disturl"),
  98. DISTTAG( 1155, STRING_ENTRY, "disttag"),
  99. BUGURL( 5012, STRING_ENTRY, "bugurl"),
  100. ENCODING( 5062, STRING_ENTRY, "encoding"),
  101. PAYLOADDIGEST( 5092, STRING_ARRAY_ENTRY, "payloaddigest"),
  102. PAYLOADDIGESTALGO( 5093, INT32_ENTRY, "payloaddigestalgo"),
  103. PAYLOADDIGESTALT( 5097, STRING_ARRAY_ENTRY, "payloaddigestalt");
  104. private int code;
  105. private int type;
  106. private String name;
  107. private HeaderTag( final int code, final int type, final String name) {
  108. this.code = code;
  109. this.type = type;
  110. this.name = name;
  111. }
  112. public int getCode() { return code; }
  113. public int getType() { return type; }
  114. public String getName() { return name; }
  115. }
  116. }