sort directory listings because ordering matters in some places when we want to generate reproducible results to fix https://bugzilla.gnome.org/show_bug.cgi?id=784177 See also https://reproducible-builds.org/docs/stable-inputs/ on that topic Index: gtk-doc-1.25/gtkdoc-scan.in =================================================================== --- gtk-doc-1.25.orig/gtkdoc-scan.in +++ gtk-doc-1.25/gtkdoc-scan.in @@ -223,7 +223,7 @@ sub ScanHeaders { opendir (SRCDIR, $source_dir) || die "Can't open source directory $source_dir: $!"; my $file; - foreach $file (readdir (SRCDIR)) { + foreach $file (sort (readdir (SRCDIR))) { if ($file eq '.' || $file eq '..' || $file =~ /^\./) { next; } elsif (-d "$source_dir/$file") { Index: gtk-doc-1.25/gtkdoc-fixxref.in =================================================================== --- gtk-doc-1.25.orig/gtkdoc-fixxref.in +++ gtk-doc-1.25/gtkdoc-fixxref.in @@ -204,7 +204,7 @@ sub ScanIndices { opendir (HTMLDIR, $scan_dir) || return; my $file; - foreach $file (readdir (HTMLDIR)) { + foreach $file (sort (readdir (HTMLDIR))) { if ($file eq '.' || $file eq '..') { next; } elsif (-d "$scan_dir/$file") { @@ -323,7 +323,7 @@ sub FixCrossReferences { opendir (HTMLDIR, $scan_dir) || die "Can't open HTML directory $scan_dir: $!"; my $file; - foreach $file (readdir (HTMLDIR)) { + foreach $file (sort (readdir (HTMLDIR))) { if ($file eq '.' || $file eq '..') { next; } elsif ($file =~ m/.html?$/) { Index: gtk-doc-1.25/gtkdoc-mkdb.in =================================================================== --- gtk-doc-1.25.orig/gtkdoc-mkdb.in +++ gtk-doc-1.25/gtkdoc-mkdb.in @@ -3900,7 +3900,7 @@ sub ReadSourceDocumentation { opendir (SRCDIR, $source_dir) || die "Can't open source directory $source_dir: $!"; - foreach $file (readdir (SRCDIR)) { + foreach $file (sort (readdir (SRCDIR))) { if ($file =~ /^\./) { next; } elsif (-d "$source_dir/$file") { Index: gtk-doc-1.25/gtkdoc-rebase.in =================================================================== --- gtk-doc-1.25.orig/gtkdoc-rebase.in +++ gtk-doc-1.25/gtkdoc-rebase.in @@ -157,7 +157,7 @@ sub ScanDirectory { my $file; my $onlinedir; my $have_index = 0; - foreach $file (readdir(HTMLDIR)) { + foreach $file (sort (readdir(HTMLDIR))) { if ($file eq '.' or $file eq '..') { next; } @@ -291,7 +291,7 @@ sub RebaseReferences { my ($dir) = @_; opendir(HTMLDIR, $dir) || die "Can't open HTML directory $dir: $!"; - foreach my $file (readdir(HTMLDIR)) { + foreach my $file (sort (readdir(HTMLDIR))) { if ($file =~ m/\.html?$/) { &RebaseFile("$dir$file"); }