Skip to content

Commit

Permalink
Merge pull request #5 from vthriller/master
Browse files Browse the repository at this point in the history
a couple of minor fixes
  • Loading branch information
itkatchev committed Jan 16, 2014
2 parents a1898f6 + 0ab57c5 commit b784074
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions makerpm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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()
Expand All @@ -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);

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b784074

Please sign in to comment.