File reproducible.patch of Package occt

Author: Bernhard M. Wiedemann
Subject: avoid variations in OCCT.cfg and generated html
Date: 2023-10-22
License: CC0 / public domain

Index: occt-V7_7_0/adm/gendoc.tcl
===================================================================
--- occt-V7_7_0.orig/adm/gendoc.tcl
+++ occt-V7_7_0/adm/gendoc.tcl
@@ -522,7 +522,7 @@ proc OCCDoc_Main {docType {docfiles {}}
       # Prepare a list of TeX files, generated by Doxygen
       cd $LATEXDIR
 
-      set TEXFILES   [glob $LATEXDIR -type f -directory $LATEXDIR -tails "*.tex" ]
+      set TEXFILES   [lsort [glob $LATEXDIR -type f -directory $LATEXDIR -tails "*.tex" ]]
       foreach path $TEXFILES {
         if { [string compare -nocase $path $LATEXDIR] == 0 } {
           set DEL_IDX [lsearch $TEXFILES $path]
@@ -706,7 +706,7 @@ proc OCCDoc_MakeDoxyfile {docType outDir
       set modules_scripts [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $productsPath]/VAS/" *.tcl]
     }
     if { [llength $modules_scripts] != 0} {
-      foreach module_file $modules_scripts {
+      foreach module_file [lsort $modules_scripts] {
         source $module_file
       }
     }
Index: occt-V7_7_0/adm/occaux.tcl
===================================================================
--- occt-V7_7_0.orig/adm/occaux.tcl
+++ occt-V7_7_0/adm/occaux.tcl
@@ -358,7 +358,7 @@ proc OCCDoc_DetectNecessarySoftware { DO
 # Convert SVG files to PDF format to allow including them to PDF
 # (requires InkScape to be in PATH)
 proc OCCDoc_ProcessSvg {latexDir verboseMode} {
-  set anSvgList [glob -nocomplain $latexDir/*.svg]
+  set anSvgList [lsort [glob -nocomplain $latexDir/*.svg]]
   if { $anSvgList == {} } {
     return
   }
@@ -480,7 +480,7 @@ proc OCCDoc_LoadData { {theProductsDir "
     set modules_files [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $theProductsDir]/VAS/" *.tcl]
   }
 
-  foreach module_file $modules_files {
+  foreach module_file [lsort $modules_files] {
     source $module_file
   }
 
@@ -568,7 +568,7 @@ proc OCCDoc_GetModulesList { {theProduct
 proc OCCDoc_GetHeadersList { theDesiredContent thePackageName {theProductsDir ""} } {
 
   # Get list of header files with path
-  set files_list [split [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $theProductsDir]/$thePackageName" "${thePackageName}.hxx" "${thePackageName}_*.hxx"]]
+  set files_list [split [lsort [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $theProductsDir]/$thePackageName" "${thePackageName}.hxx" "${thePackageName}_*.hxx"]]]
 
   # Get content according to desired type ('p' for path and 'f' for filenames only)
   if { $theDesiredContent == "p" } {
@@ -696,7 +696,7 @@ proc OCCDoc_MakeMainPage {outDir outFile
 proc OCCDoc_PostProcessor {outDir} {
   puts "[clock format [clock seconds] -format {%Y.%m.%d %H:%M}] Post-process is started ..."
   append outDir "/html"
-  set files [glob -nocomplain -type f $outDir/package_*]
+  set files [lsort [glob -nocomplain -type f $outDir/package_*]]
   if { $files != {} } {
     foreach f [lsort $files] {
       set packageFilePnt  [open $f r]
openSUSE Build Service is sponsored by