Skip to content
Permalink
Browse files
fix windows build
  • Loading branch information
jef-n authored and mach0 committed Feb 24, 2012
1 parent 5e07667 commit d4b87622af5c724702031e7a757c11d89c9d69d5
Showing with 17 additions and 22 deletions.
  1. +0 −14 ms-windows/osgeo4w/package-nightly.cmd
  2. +0 −7 ms-windows/osgeo4w/package.cmd
  3. +17 −1 src/providers/grass/qgsgrass.cpp
@@ -155,20 +155,6 @@ tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 ^
etc/preremove/%PACKAGENAME%.bat ^
>>%LOG% 2>&1
if errorlevel 1 goto error

REM tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-grass-%VERSION%-%PACKAGE%.tar.bz2 ^
REM --exclude-from exclude ^
REM "apps/%PACKAGENAME%/themes/classic/grass" ^
REM "apps/%PACKAGENAME%/themes/default/grass" ^
REM "apps/%PACKAGENAME%/themes/gis/grass" ^
REM "apps/%PACKAGENAME%/grass" ^
REM "apps/%PACKAGENAME%/bin/qgisgrass.dll" ^
REM "apps/%PACKAGENAME%/plugins/grassrasterprovider.dll" ^
REM "apps/%PACKAGENAME%/plugins/grassplugin.dll" ^
REM "apps/%PACKAGENAME%/plugins/grassprovider.dll" ^
REM >>%LOG% 2>&1
REM if errorlevel 1 goto error

goto end

:error
@@ -199,9 +199,6 @@ if errorlevel 1 goto error
tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 ^
--exclude-from exclude ^
--exclude "*.pyc" ^
--exclude apps/%PACKAGENAME%/themes/classic/grass ^
--exclude apps/%PACKAGENAME%/themes/default/grass ^
--exclude apps/%PACKAGENAME%/themes/gis/grass ^
"apps/%PACKAGENAME%/bin/qgis.exe" ^
"apps/%PACKAGENAME%/bin/qgis.reg.tmpl" ^
"apps/%PACKAGENAME%/i18n/" ^
@@ -230,7 +227,6 @@ tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 ^
"apps/%PACKAGENAME%/python/" ^
"apps/%PACKAGENAME%/resources/context_help/" ^
"apps/%PACKAGENAME%/resources/qgis_help.db" ^
"apps/%PACKAGENAME%/themes/" ^
"bin/%PACKAGENAME%.bat.tmpl" ^
"etc/postinstall/%PACKAGENAME%.bat" ^
"etc/preremove/%PACKAGENAME%.bat" ^
@@ -240,9 +236,6 @@ if errorlevel 1 goto error
tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-grass-plugin-%VERSION%-%PACKAGE%.tar.bz2 ^
--exclude-from exclude ^
--exclude "*.pyc" ^
"apps/%PACKAGENAME%/themes/classic/grass" ^
"apps/%PACKAGENAME%/themes/default/grass" ^
"apps/%PACKAGENAME%/themes/gis/grass" ^
"apps/%PACKAGENAME%/grass" ^
"apps/%PACKAGENAME%/bin/qgisgrass.dll" ^
"apps/%PACKAGENAME%/plugins/grassrasterprovider.dll" ^
@@ -450,9 +450,17 @@ QString GRASS_EXPORT QgsGrass::openMapset( QString gisdbase, QString location, Q
{
return QObject::tr( "%1 is not a GRASS mapset." ).arg( mapsetPath );
}
QString lock = mapsetPath + "/.gislock";

#ifndef _MSC_VER
int pid = getpid();
#else
int pid = GetCurrentProcessId();
#endif

QgsDebugMsg( QString( "pid = %1" ).arg( pid ) );

#ifndef Q_OS_WIN
QString lock = mapsetPath + "/.gislock";
QFile lockFile( lock );
QProcess *process = new QProcess();
QString lockProgram( gisBase + "/etc/lock" );
@@ -488,13 +496,17 @@ QString GRASS_EXPORT QgsGrass::openMapset( QString gisdbase, QString location, Q
QFileInfo dirInfo( mTmp );
if ( !dirInfo.isWritable() )
{
#ifndef Q_OS_WIN
lockFile.remove();
#endif
return QObject::tr( "Temporary directory %1 exists but is not writable" ).arg( mTmp );
}
}
else if ( !dir.mkdir( mTmp ) )
{
#ifndef Q_OS_WIN
lockFile.remove();
#endif
return QObject::tr( "Cannot create temporary directory %1" ).arg( mTmp );
}

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

active = true;

#ifndef Q_OS_WIN
// Close old mapset
if ( mMapsetLock.length() > 0 )
{
QFile file( mMapsetLock );
file.remove();
}
#endif

mMapsetLock = lock;

0 comments on commit d4b8762

Please sign in to comment.