Skip to content

Commit

Permalink
Make sequence of filenames in control.tar predictable
Browse files Browse the repository at this point in the history
Replacing plain Python dict by an OrderedDict for Python versions
before 3.7, so that iteration order of "extrafiles" is determined by
insertion order.  Since 3.7 iteration order of plain dict itself is
stable.

bazelbuild#114
  • Loading branch information
andreas-0815-qwertz committed Nov 29, 2019
1 parent b28e8c8 commit 488cfbb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/make_deb.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
import textwrap
import time

if sys.version_info < (3, 7):
from collections import OrderedDict
else:
OrderedDict = dict


# list of debian fields : (name, mandatory, wrap[, default])
# see http://www.debian.org/doc/debian-policy/ch-controlfields.html
Expand Down Expand Up @@ -166,7 +171,7 @@ def CreateDeb(output,
conffiles=None,
**kwargs):
"""Create a full debian package."""
extrafiles = {}
extrafiles = OrderedDict()
if preinst:
extrafiles['preinst'] = (preinst, 0o755)
if postinst:
Expand Down Expand Up @@ -296,7 +301,7 @@ def main():
help='The output file, mandatory')
parser.add_argument('--changes', required=True,
help='The changes output file, mandatory.')
parser.add_argument('--data', required=True,
parser.add_argument('--data', required=True,
help='Path to the data tarball, mandatory')
parser.add_argument(
'--preinst',
Expand Down

0 comments on commit 488cfbb

Please sign in to comment.