@@ -391,14 +391,14 @@ func createFilesInsideDataTar(info *nfpm.Info, tw *tar.Writer) (md5buf bytes.Buf
391
391
Format : tar .FormatGNU ,
392
392
Uname : file .FileInfo .Owner ,
393
393
Gname : file .FileInfo .Group ,
394
- ModTime : file . FileInfo . MTime ,
394
+ ModTime : time . Unix ( 0 , 0 ) ,
395
395
})
396
396
case files .TypeSymlink :
397
397
err = newItemInsideTar (tw , []byte {}, & tar.Header {
398
398
Name : files .AsExplicitRelativePath (file .Destination ),
399
399
Linkname : file .Source ,
400
400
Typeflag : tar .TypeSymlink ,
401
- ModTime : file . FileInfo . MTime ,
401
+ ModTime : time . Unix ( 0 , 0 ) ,
402
402
Format : tar .FormatGNU ,
403
403
})
404
404
case files .TypeDebChangelog :
@@ -554,18 +554,27 @@ func createControl(instSize int64, md5sums []byte, info *nfpm.Info) (controlTarG
554
554
return nil , err
555
555
}
556
556
557
- filesToCreate := map [string ][]byte {
558
- "./control" : body .Bytes (),
559
- "./md5sums" : md5sums ,
560
- "./conffiles" : conffiles (info ),
557
+ // ensure predefined sort order of these items
558
+ filesToCreateNames := []string {
559
+ "./control" ,
560
+ "./md5sums" ,
561
+ "./conffiles" ,
562
+ }
563
+
564
+ filesToCreateContent := [][]byte {
565
+ body .Bytes (),
566
+ md5sums ,
567
+ conffiles (info ),
561
568
}
562
569
563
570
triggers := createTriggers (info )
564
571
if len (triggers ) > 0 {
565
- filesToCreate ["./triggers" ] = triggers
572
+ filesToCreateNames = append (filesToCreateNames , "./triggers" )
573
+ filesToCreateContent = append (filesToCreateContent , triggers )
566
574
}
567
575
568
- for name , content := range filesToCreate {
576
+ for idx , name := range filesToCreateNames {
577
+ content := filesToCreateContent [idx ]
569
578
if err := newFileInsideTar (out , name , content ); err != nil {
570
579
return nil , err
571
580
}
@@ -638,7 +647,7 @@ func newFileInsideTar(out *tar.Writer, name string, content []byte) error {
638
647
Name : files .AsExplicitRelativePath (name ),
639
648
Size : int64 (len (content )),
640
649
Mode : 0o644 ,
641
- ModTime : time .Now ( ),
650
+ ModTime : time .Unix ( 0 , 0 ),
642
651
Typeflag : tar .TypeReg ,
643
652
Format : tar .FormatGNU ,
644
653
})
@@ -657,7 +666,7 @@ func newFilePathInsideTar(out *tar.Writer, path, dest string, mode int64) error
657
666
Name : files .AsExplicitRelativePath (dest ),
658
667
Size : int64 (len (content )),
659
668
Mode : mode ,
660
- ModTime : time .Now ( ),
669
+ ModTime : time .Unix ( 0 , 0 ),
661
670
Typeflag : tar .TypeReg ,
662
671
Format : tar .FormatGNU ,
663
672
})
0 commit comments