Skip to content

Commit 0a81f65

Browse files
committed
fix windows build
1 parent 411aff6 commit 0a81f65

File tree

3 files changed

+17
-22
lines changed

3 files changed

+17
-22
lines changed

ms-windows/osgeo4w/package-nightly.cmd

-14
Original file line numberDiff line numberDiff line change
@@ -155,20 +155,6 @@ tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 ^
155155
etc/preremove/%PACKAGENAME%.bat ^
156156
>>%LOG% 2>&1
157157
if errorlevel 1 goto error
158-
159-
REM tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-grass-%VERSION%-%PACKAGE%.tar.bz2 ^
160-
REM --exclude-from exclude ^
161-
REM "apps/%PACKAGENAME%/themes/classic/grass" ^
162-
REM "apps/%PACKAGENAME%/themes/default/grass" ^
163-
REM "apps/%PACKAGENAME%/themes/gis/grass" ^
164-
REM "apps/%PACKAGENAME%/grass" ^
165-
REM "apps/%PACKAGENAME%/bin/qgisgrass.dll" ^
166-
REM "apps/%PACKAGENAME%/plugins/grassrasterprovider.dll" ^
167-
REM "apps/%PACKAGENAME%/plugins/grassplugin.dll" ^
168-
REM "apps/%PACKAGENAME%/plugins/grassprovider.dll" ^
169-
REM >>%LOG% 2>&1
170-
REM if errorlevel 1 goto error
171-
172158
goto end
173159

174160
:error

ms-windows/osgeo4w/package.cmd

-7
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,6 @@ if errorlevel 1 goto error
199199
tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 ^
200200
--exclude-from exclude ^
201201
--exclude "*.pyc" ^
202-
--exclude apps/%PACKAGENAME%/themes/classic/grass ^
203-
--exclude apps/%PACKAGENAME%/themes/default/grass ^
204-
--exclude apps/%PACKAGENAME%/themes/gis/grass ^
205202
"apps/%PACKAGENAME%/bin/qgis.exe" ^
206203
"apps/%PACKAGENAME%/bin/qgis.reg.tmpl" ^
207204
"apps/%PACKAGENAME%/i18n/" ^
@@ -230,7 +227,6 @@ tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 ^
230227
"apps/%PACKAGENAME%/python/" ^
231228
"apps/%PACKAGENAME%/resources/context_help/" ^
232229
"apps/%PACKAGENAME%/resources/qgis_help.db" ^
233-
"apps/%PACKAGENAME%/themes/" ^
234230
"bin/%PACKAGENAME%.bat.tmpl" ^
235231
"etc/postinstall/%PACKAGENAME%.bat" ^
236232
"etc/preremove/%PACKAGENAME%.bat" ^
@@ -240,9 +236,6 @@ if errorlevel 1 goto error
240236
tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-grass-plugin-%VERSION%-%PACKAGE%.tar.bz2 ^
241237
--exclude-from exclude ^
242238
--exclude "*.pyc" ^
243-
"apps/%PACKAGENAME%/themes/classic/grass" ^
244-
"apps/%PACKAGENAME%/themes/default/grass" ^
245-
"apps/%PACKAGENAME%/themes/gis/grass" ^
246239
"apps/%PACKAGENAME%/grass" ^
247240
"apps/%PACKAGENAME%/bin/qgisgrass.dll" ^
248241
"apps/%PACKAGENAME%/plugins/grassrasterprovider.dll" ^

src/providers/grass/qgsgrass.cpp

+17-1
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,17 @@ QString GRASS_EXPORT QgsGrass::openMapset( QString gisdbase, QString location, Q
450450
{
451451
return QObject::tr( "%1 is not a GRASS mapset." ).arg( mapsetPath );
452452
}
453+
QString lock = mapsetPath + "/.gislock";
454+
455+
#ifndef _MSC_VER
456+
int pid = getpid();
457+
#else
458+
int pid = GetCurrentProcessId();
459+
#endif
460+
461+
QgsDebugMsg( QString( "pid = %1" ).arg( pid ) );
453462

454463
#ifndef Q_OS_WIN
455-
QString lock = mapsetPath + "/.gislock";
456464
QFile lockFile( lock );
457465
QProcess *process = new QProcess();
458466
QString lockProgram( gisBase + "/etc/lock" );
@@ -488,13 +496,17 @@ QString GRASS_EXPORT QgsGrass::openMapset( QString gisdbase, QString location, Q
488496
QFileInfo dirInfo( mTmp );
489497
if ( !dirInfo.isWritable() )
490498
{
499+
#ifndef Q_OS_WIN
491500
lockFile.remove();
501+
#endif
492502
return QObject::tr( "Temporary directory %1 exists but is not writable" ).arg( mTmp );
493503
}
494504
}
495505
else if ( !dir.mkdir( mTmp ) )
496506
{
507+
#ifndef Q_OS_WIN
497508
lockFile.remove();
509+
#endif
498510
return QObject::tr( "Cannot create temporary directory %1" ).arg( mTmp );
499511
}
500512

@@ -508,7 +520,9 @@ QString GRASS_EXPORT QgsGrass::openMapset( QString gisdbase, QString location, Q
508520
QFile out( mGisrc );
509521
if ( !out.open( QIODevice::WriteOnly ) )
510522
{
523+
#ifndef Q_OS_WIN
511524
lockFile.remove();
525+
#endif
512526
return QObject::tr( "Cannot create %1" ).arg( mGisrc );
513527
}
514528
QTextStream stream( &out );
@@ -566,12 +580,14 @@ QString GRASS_EXPORT QgsGrass::openMapset( QString gisdbase, QString location, Q
566580

567581
active = true;
568582

583+
#ifndef Q_OS_WIN
569584
// Close old mapset
570585
if ( mMapsetLock.length() > 0 )
571586
{
572587
QFile file( mMapsetLock );
573588
file.remove();
574589
}
590+
#endif
575591

576592
mMapsetLock = lock;
577593

0 commit comments

Comments
 (0)