widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #14014
[Merge] lp:~widelands-dev/widelands/bug-1784113-desktop-file-utils into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1784113-desktop-file-utils into lp:widelands.
Commit message:
Validate .desktop file on translation updates. Removed deprecated category from .desktop file.
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
Bug #1784113 in widelands: "Automatically validate the .desktop file"
https://bugs.launchpad.net/widelands/+bug/1784113
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1784113-desktop-file-utils/+merge/351614
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1784113-desktop-file-utils into lp:widelands.
=== modified file 'debian/org.widelands.widelands.desktop'
--- debian/org.widelands.widelands.desktop 2018-07-06 14:23:53 +0000
+++ debian/org.widelands.widelands.desktop 2018-07-28 11:16:58 +0000
@@ -74,4 +74,4 @@
Icon=/usr/share/games/widelands/data/images/logos/wl-ico-64.png
TryExec=widelands
Exec=widelands
-Categories=Application;Game;StrategyGame;
+Categories=Game;StrategyGame;
=== modified file 'debian/org.widelands.widelands.desktop.stub'
--- debian/org.widelands.widelands.desktop.stub 2017-03-10 12:39:34 +0000
+++ debian/org.widelands.widelands.desktop.stub 2018-07-28 11:16:58 +0000
@@ -6,4 +6,4 @@
Icon=/usr/share/games/widelands/data/images/logos/wl-ico-64.png
TryExec=widelands
Exec=widelands
-Categories=Application;Game;StrategyGame;
+Categories=Game;StrategyGame;
=== modified file 'utils/update_appdata.py'
--- utils/update_appdata.py 2017-03-10 12:39:34 +0000
+++ utils/update_appdata.py 2018-07-28 11:16:58 +0000
@@ -118,8 +118,8 @@
input_file.close()
-dest_filepath = base_path + '/debian/widelands.appdata.xml'
-dest_file = codecs.open(dest_filepath, encoding='utf-8', mode='w')
+appdata_filepath = base_path + '/debian/widelands.appdata.xml'
+dest_file = codecs.open(appdata_filepath, encoding='utf-8', mode='w')
dest_file.write(appdata)
dest_file.close()
@@ -135,12 +135,22 @@
input_file.close()
-dest_filepath = base_path + '/debian/org.widelands.widelands.desktop'
-dest_file = codecs.open(dest_filepath, encoding='utf-8', mode='w')
+desktop_filepath = base_path + '/debian/org.widelands.widelands.desktop'
+dest_file = codecs.open(desktop_filepath, encoding='utf-8', mode='w')
dest_file.write(desktop)
dest_file.close()
print('Done!')
-from subprocess import call
-call(['appstreamcli', 'validate', base_path + '/debian/widelands.appdata.xml'])
+from subprocess import call, CalledProcessError, Popen, PIPE
+
+# Validata Appdata
+call(['appstreamcli', 'validate', appdata_filepath])
+
+# Validate desktop file. We don't get return codes, so we have to parse it
+process = Popen(['desktop-file-validate', desktop_filepath], stderr=PIPE, stdout=PIPE, stdin=PIPE)
+desktop_result = process.communicate()
+if desktop_result[0] != "":
+ print(desktop_result[0])
+ sys.exit(1)
+
Follow ups