Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit ff431bd

Browse files
hkielOpenModelica-Hudson
authored andcommitted
try to fix some "Argument list too long" errors
Belonging to [master]: - #2751
1 parent 898f94d commit ff431bd

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

Examples/GenerateDoc.mos

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141

4242
setDebugFlags("nogen") /* Don't generate dll/so-files when instantiating classes (performance) */;
4343

44+
import shutil
45+
4446
// rmSymlinks
4547
// (false) should we keep readable names (nice online, if the server handles symbolic links), or
4648
// (true) use the hashed names in the links (nice if you want a zipped version to work on Windows). This removes the readable names, keeping only the hashed and de-duped images.
@@ -79,9 +81,10 @@ py:=getInstallationDirectoryPath() + "/share/doc/omc/testmodels/generate_icons.p
7981

8082
// adrpo: do not run the python stuff when running the testsuite
8183
if getEnvironmentVar("GenerateDocTest") == "YES" then
82-
system("mkdir -p Icons");
84+
if not os.path.exists("Icons"):
85+
os.mkdir("Icons")
8386
else
84-
commands:={"python "+py+" --quiet --output-dir Icons "+typeNameString(cl) for cl in getClassNames(builtin=false)};getErrorString();
87+
commands:={"python "+py+" --quiet --output-dir Icons "+typeNameString(cl) for cl in reversed(getClassNames(builtin=false))};getErrorString();
8588
res:=system_parallel(commands);getErrorString();
8689
//system("rm -f *.json");getErrorString();
8790
end if;
@@ -456,8 +459,11 @@ echo(shouldEcho);
456459
system("rm -f tidy.links tidy.out tidy.err tidy.filtered");
457460

458461
"Copying original HTML files to 'old-html-tmp'";
459-
system("mkdir -p old-html-tmp");
460-
system("cp *.html old-html-tmp/");
462+
oldtmp = "old-html-tmp"
463+
if not os.path.exists(oldtmp):
464+
os.mkdir(oldtmp)
465+
for file in glob.glob('*.html'):
466+
shutil.copy(file, oldtmp)
461467

462468
"Tidy.py";
463469
system("python Tidy.py 2> tidy.err");
@@ -499,7 +505,8 @@ def makeCaseSensitive():
499505
print('Renaming file %s to %s' % (file,nfile))
500506
if os.path.isfile(nfile):
501507
raise Exception('File already exists: ' + nfile)
502-
call(['sed','-i','s/%s/%s/g' % (file,nfile)] + files)
508+
for f in getFiles():
509+
call(['sed','-i','s/%s/%s/g' % (file,nfile)] + f)
503510
os.rename(file,nfile)
504511
return False
505512
visited[upper] = file

0 commit comments

Comments
 (0)