From 2effca5830eecb1f2a1ba4e8388ac5cf4fb248a7 Mon Sep 17 00:00:00 2001 From: Jiri Malak Date: Mon, 1 Aug 2022 08:27:57 +0200 Subject: [PATCH] fix installers build --- bld/setupgui/mkdisk/langdat.c | 51 +++++++++++++++++++++++++---------- distrib/ow/builder.ctl | 6 ++--- distrib/ow/master.mif | 25 ++++++++++------- 3 files changed, 55 insertions(+), 27 deletions(-) diff --git a/bld/setupgui/mkdisk/langdat.c b/bld/setupgui/mkdisk/langdat.c index cd0d9be600..104bee0102 100644 --- a/bld/setupgui/mkdisk/langdat.c +++ b/bld/setupgui/mkdisk/langdat.c @@ -2,7 +2,7 @@ * * Open Watcom Project * -* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved. +* Copyright (c) 2002-2022 The Open Watcom Contributors. All Rights Reserved. * Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved. * * ======================================================================== @@ -428,6 +428,39 @@ static char *NextWord( char *p ) return( FirstWord( p + strlen( p ) + 1 ) ); } +static char *GetNextPathOrFile( char *p ) +{ + char c; + char quotechar; + char *start; + + p += strlen( p ) + 1; + SKIP_BLANKS( p ); + if( *p == '\0' ) + return( NULL ); + quotechar = ( *p == '"' ) ? *p++ : ' '; + start = p; + while( (c = *p) != '\0' ) { + if( c == quotechar ) { + *p = '\0'; + return( start ); + } +#ifdef __UNIX__ + if( c == '\\' ) { + *p = '/'; + } +#else + if( c == '/' ) { + *p = '\\'; + } +#endif + p++; + } + *p++ = '\0'; + *p = '\0'; + return( start ); +} + bool checkWord( char *p, ctl_file *word_list ) { ctl_file *w; @@ -768,23 +801,13 @@ static void ProcessCtlFile( const char *name ) p = FirstWord( p + 1 ); if( stricmp( p, "INCLUDE" ) == 0 ) { if( IncludeStk->skipping == 0 ) { - char inc_file[_MAX_PATH]; - - p = GetPathOrFile( p, inc_file ); - PushInclude( inc_file ); + PushInclude( GetNextPathOrFile( p ) ); } } else if( stricmp( p, "LOG" ) == 0 ) { if( IncludeStk->skipping == 0 ) { - char log_name[_MAX_PATH]; - - p = GetPathOrFile( p, &log_name ); - p = GetWord( p, &word ); - if( *word == '\0' || strcmp( word, "]" ) == 0 ) { - BackupLog( log_name, LogBackup ); - } else { - BackupLog( log_name, strtoul( word, NULL, 0 ) ); - } + log_name = GetNextPathOrFile( p ); + p = NextWord( log_name ); if( LogFile == NULL ) { OpenLog( log_name ); } diff --git a/distrib/ow/builder.ctl b/distrib/ow/builder.ctl index e16c44f8db..160ef4efff 100644 --- a/distrib/ow/builder.ctl +++ b/distrib/ow/builder.ctl @@ -5,9 +5,9 @@ set PROJNAME=install set PROJDIR= -[ INCLUDE /build/prolog.ctl ] +[ INCLUDE "/build/prolog.ctl" ] -cdsay +cdsay "" echo Installer Build: <1> <2> <3> <4> <5> @@ -32,4 +32,4 @@ echo Installer Build: <1> <2> <3> <4> <5> [ BLOCK . . ] -[ INCLUDE /build/epilog.ctl ] +[ INCLUDE "/build/epilog.ctl" ] diff --git a/distrib/ow/master.mif b/distrib/ow/master.mif index 4cd2775507..8050f81763 100644 --- a/distrib/ow/master.mif +++ b/distrib/ow/master.mif @@ -79,11 +79,16 @@ distrib_bindir = ../bin !ifdef missing all: .SYMBOLIC + @rm -f *.__c langdat -l filelist $(langdat_keys) -r $(bld_ver) c - mkinf -x -i../include $(mkinf_opt_$(host_os)) c filelist $(%OWRELROOT) + mkinf -x -i../include $(mkinf_opt_$(host_os)) c filelist "$(%OWRELROOT)" langdat -l filelist $(langdat_keys) -r $(bld_ver) f77 - mkinf -x -i../include $(mkinf_opt_$(host_os)) f77 filelist $(%OWRELROOT) + mkinf -x -i../include $(mkinf_opt_$(host_os)) f77 filelist "$(%OWRELROOT)" +!ifdef debug + @%ren filelist filelist.__c +!else @rm -rf filelist +!endif !else @@ -94,10 +99,10 @@ $(distrib_bindir)/$(installer_c) : ../files.dat $(distrib_bindir) $(setup_c) .AL @%make clean_inf langdat -l filelist $(langdat_keys) -r $(bld_ver) -c $[@ c @copy $]@ setup.exe - mkinf -i.. -i../../include -dBldVer=$(bld_ver_str) -dDstDir=$(dstdir) $(mkinf_opt_$(host_os)) c filelist $(%OWRELROOT) - @copy setup.inf $(%OWRELROOT)/setup.inf - uzip setup.zip instarch.lst $(%OWRELROOT) - @rm $(%OWRELROOT)/setup.inf + mkinf -i.. -i../../include -dBldVer=$(bld_ver_str) -dDstDir=$(dstdir) $(mkinf_opt_$(host_os)) c filelist "$(%OWRELROOT)" + @copy setup.inf "$(%OWRELROOT)/setup.inf" + uzip setup.zip instarch.lst "$(%OWRELROOT)" + @rm "$(%OWRELROOT)/setup.inf" @rm setup.exe !ifdef debug @%ren filelist filelist.__c @@ -114,10 +119,10 @@ $(distrib_bindir)/$(installer_f77) : ../files.dat $(distrib_bindir) $(setup_f77) @%make clean_inf langdat -l filelist $(langdat_keys) -r $(bld_ver) -c $[@ f77 @copy $]@ setup.exe - mkinf -i.. -i../../include -dBldVer=$(bld_ver_str) -dDstDir=$(dstdir) $(mkinf_opt_$(host_os)) f77 filelist $(%OWRELROOT) - @copy setup.inf $(%OWRELROOT)/setup.inf - uzip setup.zip instarch.lst $(%OWRELROOT) - @rm $(%OWRELROOT)/setup.inf + mkinf -i.. -i../../include -dBldVer=$(bld_ver_str) -dDstDir=$(dstdir) $(mkinf_opt_$(host_os)) f77 filelist "$(%OWRELROOT)" + @copy setup.inf "$(%OWRELROOT)/setup.inf" + uzip setup.zip instarch.lst "$(%OWRELROOT)" + @rm "$(%OWRELROOT)/setup.inf" @rm setup.exe !ifdef debug @%ren filelist filelist.__f