Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
f3171e83
Commit
f3171e83
authored
Jun 28, 2010
by
kh1
Browse files
We need to cache the version number, since it can be changed
during the generation process and copy might fail afterwards.
parent
40623d00
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp
View file @
f3171e83
...
...
@@ -164,9 +164,14 @@ bool MaemoPackageCreationStep::createPackage()
buildProc
.
start
(
"cd "
+
buildDir
);
buildProc
.
waitForFinished
();
// cache those two since we can change the version number during packaging
// and might fail later to modify, copy, remove etc. the generated package
const
QString
version
=
versionString
();
const
QString
pkgFilePath
=
packageFilePath
();
if
(
!
QFileInfo
(
buildDir
+
QLatin1String
(
"/debian"
)).
exists
())
{
const
QString
command
=
QLatin1String
(
"dh_make -s -n -p "
)
%
executableFileName
().
toLower
()
%
QLatin1Char
(
'_'
)
%
version
String
()
;
%
executableFileName
().
toLower
()
%
QLatin1Char
(
'_'
)
%
version
;
if
(
!
runCommand
(
buildProc
,
command
))
return
false
;
...
...
@@ -194,11 +199,12 @@ bool MaemoPackageCreationStep::createPackage()
}
{
QFile
::
remove
(
buildDir
+
QLatin1String
(
"/debian/files"
));
QFile
changeLog
(
buildDir
+
QLatin1String
(
"/debian/changelog"
));
if
(
changeLog
.
open
(
QIODevice
::
ReadWrite
))
{
QString
content
=
QString
::
fromUtf8
(
changeLog
.
readAll
());
content
.
replace
(
QRegExp
(
"
\\
([a-zA-Z0-9_
\\
.]+
\\
)"
),
QLatin1Char
(
'('
)
%
version
String
()
%
QLatin1Char
(
')'
));
QLatin1Char
(
'('
)
%
version
%
QLatin1Char
(
')'
));
changeLog
.
resize
(
0
);
changeLog
.
write
(
content
.
toUtf8
());
}
...
...
@@ -209,7 +215,7 @@ bool MaemoPackageCreationStep::createPackage()
// Workaround for non-working dh_builddeb --destdir=.
if
(
!
QDir
(
buildDir
).
isRoot
())
{
const
QString
packageFileName
=
QFileInfo
(
p
ackage
FilePath
()
).
fileName
();
const
QString
packageFileName
=
QFileInfo
(
p
kg
FilePath
).
fileName
();
const
QString
changesFileName
=
QFileInfo
(
packageFileName
)
.
completeBaseName
()
+
QLatin1String
(
".changes"
);
const
QString
packageSourceDir
=
buildDir
+
QLatin1String
(
"/../"
);
...
...
@@ -219,9 +225,9 @@ bool MaemoPackageCreationStep::createPackage()
=
packageSourceDir
+
changesFileName
;
const
QString
changesTargetFilePath
=
buildDir
+
QLatin1Char
(
'/'
)
+
changesFileName
;
QFile
::
remove
(
p
ackage
FilePath
()
);
QFile
::
remove
(
p
kg
FilePath
);
QFile
::
remove
(
changesTargetFilePath
);
if
(
!
QFile
::
rename
(
packageSourceFilePath
,
p
ackage
FilePath
()
)
if
(
!
QFile
::
rename
(
packageSourceFilePath
,
p
kg
FilePath
)
||
!
QFile
::
rename
(
changesSourceFilePath
,
changesTargetFilePath
))
{
raiseError
(
tr
(
"Packaging failed."
),
tr
(
"Could not move package files from %1 to %2."
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment