diff --git a/makerpm.cc b/makerpm.cc index ad93471..1ce83de 100644 --- a/makerpm.cc +++ b/makerpm.cc @@ -309,10 +309,6 @@ std::string make_index2(const rpmprops_t& props) { uint32_t totsize = 0; uint64_t totlongsize = 0; - // despite it's name, the index entry does not allow one to store tags in random order; - // some misplacements are not fatal, some may lead to various metadata glitches (e.g. appearance of non-stored tags or incorrect file ownership). - // current tag order is actually incorrect; for correct ones, see `rpm --querytags`. - //store.add(rpm::TAG_HEADERI18NTABLE, props.locale); store.add(rpm::TAG_NAME, props.name, false); @@ -329,6 +325,9 @@ std::string make_index2(const rpmprops_t& props) { store.add(rpm::TAG_URL, props.url, false); store.add(rpm::TAG_OS, props.os, false); store.add(rpm::TAG_ARCH, props.arch, false); + store.add(rpm::TAG_PAYLOADFORMAT, props.payload_format, false); + store.add(rpm::TAG_PAYLOADCOMPRESSOR, props.payload_compressor, false); + store.add(rpm::TAG_PLATFORM, props.platform, false); // for details, see yum's rpmUtils/miscutils.py, function pkgTupleFromHeader(), // or createrepo's createrepo/yumbased.py, method CreateRepoPackage.isSrpm() @@ -340,10 +339,6 @@ std::string make_index2(const rpmprops_t& props) { if(props.arch == "src") store.add(rpm::TAG_SOURCEPACKAGE, (uint32_t)1); - store.add(rpm::TAG_PAYLOADFORMAT, props.payload_format, false); - store.add(rpm::TAG_PAYLOADCOMPRESSOR, props.payload_compressor, false); - store.add(rpm::TAG_PLATFORM, props.platform, false); - store.add(rpm::TAG_OPTFLAGS, props.optflags, false); store.add(rpm::TAG_RPMVERSION, props.rpmversion, false); @@ -639,7 +634,7 @@ mfile make_rpm(const rpmprops_t& props, const std::string& payload_file, std::st mfile ret = make_index1(index2, payload, payload_file + ".gz", header); std::string lead = make_lead( props.name, - htons((uint16_t)(props.arch != "src")) /* 0 for source, 1 for binary */ + htons((uint16_t)(props.arch == "src")) /* 1 for source, 0 for binary */ ); header = lead + header + index2;