Uninstall before update
This commit is contained in:
+4
-2
@@ -7,10 +7,11 @@ Linux_x64:
|
||||
stage: build
|
||||
script:
|
||||
- zypper -q install -y libgit2-devel make gcc gcc-c++ libQt5Concurrent-devel libQt5Core-devel libQt5Gui-devel libQt5QuickControls2-devel libqt5-qtbase-devel libqt5-qtdeclarative-devel
|
||||
- make -f CI.mk build
|
||||
- make -f CI.mk linuxdeploy
|
||||
- make -f CI.mk finalize
|
||||
artifacts:
|
||||
paths:
|
||||
- GitAddonsManager/GitAddonsManager
|
||||
- GitAddonsManager
|
||||
name: "GitAddonsManager_Linux_x64-$CI_COMMIT_SHA"
|
||||
|
||||
Win32:
|
||||
@@ -24,6 +25,7 @@ Win32:
|
||||
script:
|
||||
- zypper -q install -y wine-staging wine-staging-32bit wget make p7zip tar
|
||||
- make -f CI.mk windeploy
|
||||
- make -f CI.mk finalize
|
||||
artifacts:
|
||||
paths:
|
||||
- GitAddonsManager
|
||||
|
||||
@@ -10,9 +10,17 @@ WINEPATH=WINEPATH='C:\Program Files (x86)\CMake\bin;$(shell $(winepath) -w "$(pw
|
||||
qmake_opts="QMAKE_INCDIR+=Z:$(pwd)/libgit2-0.27.2/include Z:$(pwd)/quazip/quazip" "QMAKE_LIBDIR+=Z:$(pwd)/libgit2-0.27.2/build/ Z:$(pwd)/quazip/build/release Z:$(pwd)/libz/build" -spec win32-g++ LIBS+=-lquazip
|
||||
qmake=$(wine) $(pwd)/Qt/5.11.1/mingw53_32/bin/qmake.exe
|
||||
|
||||
.PHONY: build winbuild windeploy
|
||||
.PHONY: build winbuild windeploy linuxdeploy finalize
|
||||
|
||||
finalize:
|
||||
cd GitAddonsManager && echo "# DO NOT EDIT" > .installedFiles && find ! -path . >> .installedFiles
|
||||
|
||||
build:
|
||||
mkdir -p GitAddonsManager && cd GitAddonsManager && qmake-qt5 .. -spec linux-g++ DEFINES+='GAM_BUILD_NAME=\\\"Linux_x64\\\"' LIBS+=-lquazip5 INCLUDEPATH+=/usr/include/quazip5 && make
|
||||
mkdir -p build && cd build && qmake-qt5 .. -spec linux-g++ DEFINES+='GAM_BUILD_NAME=\\\"Linux_x64\\\"' LIBS+=-lquazip5 INCLUDEPATH+=/usr/include/quazip5 && make
|
||||
|
||||
linuxdeploy: build
|
||||
mkdir GitAddonsManager
|
||||
cp build/GitAddonsManager -f GitAddonsManager/GitAddonsManager
|
||||
|
||||
cmake-3.12.0-rc3-win32-x86.msi:
|
||||
wget https://cmake.org/files/v3.12/cmake-3.12.0-rc3-win32-x86.msi
|
||||
|
||||
+29
@@ -187,6 +187,34 @@ void Control::completeUpdate(const QString &path)
|
||||
QDir root(QApplication::applicationDirPath());
|
||||
QDir newRoot(path);
|
||||
if (!newRoot.mkpath(newRoot.absolutePath())) return false;
|
||||
QFile oldFilesList(newRoot.absoluteFilePath(".installedFiles"));
|
||||
if (oldFilesList.exists()) {
|
||||
oldFilesList.open(QFile::ReadOnly);
|
||||
QString line;
|
||||
QStringList oldFiles;
|
||||
QStringList oldDirs;
|
||||
while (!(line = oldFilesList.readLine()).isEmpty()) {
|
||||
if (line.startsWith('#') || line.startsWith('\n')) continue;
|
||||
oldFiles << line.chopped(1);
|
||||
}
|
||||
oldFilesList.close();
|
||||
setTotal(oldFiles.size());
|
||||
int count = 0;
|
||||
foreach (const QString &file, oldFiles) {
|
||||
QFileInfo info(newRoot.absoluteFilePath(file));
|
||||
if (info.exists() && (info.isFile() || info.isSymLink())) {
|
||||
newRoot.remove(file);
|
||||
setProgress(++count);
|
||||
}
|
||||
else if (info.isDir())
|
||||
oldDirs << file;
|
||||
}
|
||||
for (auto i = oldDirs.rbegin(); i != oldDirs.rend(); i++)
|
||||
newRoot.rmdir(*i);
|
||||
|
||||
setProgress(0);
|
||||
setTotal(-1);
|
||||
}
|
||||
walkFoldersIf({root.absolutePath()},[&newRoot, &files, &root, &oldFiles](const QFileInfo &info){
|
||||
QFileInfo dest(newRoot.absoluteFilePath(root.relativeFilePath(info.absoluteFilePath())));
|
||||
files << info.absoluteFilePath();
|
||||
@@ -200,6 +228,7 @@ void Control::completeUpdate(const QString &path)
|
||||
return !dest.exists() ? 1 : dest.isDir() && info.isDir() && !info.isSymLink() && !dest.isSymLink() ? -1 : 1;
|
||||
});
|
||||
setTotal(files.size() + oldFiles.size());
|
||||
qDebug() << oldFiles.size();
|
||||
int count = 0;
|
||||
bool success = true;
|
||||
foreach (auto file, oldFiles) {
|
||||
|
||||
Reference in New Issue
Block a user