From a4d1a21b4678d531d8d112ff93bf4ad5659a6f9a Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Sat, 11 Jun 2011 23:07:29 +0200 Subject: [PATCH] dom0: qvm-sync-appmenus - copy *directory.template when needed --- dom0/misc/qubes-templatevm.directory.template | 5 +++++ dom0/misc/qubes-vm.directory.template | 5 +++++ dom0/qvm-tools/qvm-sync-appmenus | 11 +++++------ rpm_spec/core-dom0.spec | 4 ++++ 4 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 dom0/misc/qubes-templatevm.directory.template create mode 100644 dom0/misc/qubes-vm.directory.template diff --git a/dom0/misc/qubes-templatevm.directory.template b/dom0/misc/qubes-templatevm.directory.template new file mode 100644 index 00000000..596fffaf --- /dev/null +++ b/dom0/misc/qubes-templatevm.directory.template @@ -0,0 +1,5 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Directory +Name=Template: %VMNAME% +Icon=/usr/share/qubes/icons/template.png diff --git a/dom0/misc/qubes-vm.directory.template b/dom0/misc/qubes-vm.directory.template new file mode 100644 index 00000000..6825d200 --- /dev/null +++ b/dom0/misc/qubes-vm.directory.template @@ -0,0 +1,5 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Directory +Name=Domain: %VMNAME% +Icon=%VMDIR%/icon.png diff --git a/dom0/qvm-tools/qvm-sync-appmenus b/dom0/qvm-tools/qvm-sync-appmenus index c444bbb8..da5f5c97 100755 --- a/dom0/qvm-tools/qvm-sync-appmenus +++ b/dom0/qvm-tools/qvm-sync-appmenus @@ -25,6 +25,7 @@ import re import os import sys import fnmatch +import shutil from optparse import OptionParser from qubes.qubes import QubesVmCollection,QubesException from qubes.qubes import qrexec_client_path @@ -156,6 +157,10 @@ def main(): if not os.path.exists(vm.appmenus_templates_dir): os.mkdir(vm.appmenus_templates_dir) + if vm.is_template(): + shutil.copy('/usr/share/qubes/qubes-templatevm.directory.template', vm.appmenus_templates_dir) + else: + shutil.copy('/usr/share/qubes/qubes-vm.directory.template', vm.appmenus_templates_dir) # Create new/update existing templates if options.verbose: @@ -181,9 +186,3 @@ def main(): os.unlink(vm.appmenus_templates_dir + '/' + appmenu_file) main() - - - - - - diff --git a/rpm_spec/core-dom0.spec b/rpm_spec/core-dom0.spec index 5223a3ca..5b6e1519 100644 --- a/rpm_spec/core-dom0.spec +++ b/rpm_spec/core-dom0.spec @@ -111,6 +111,8 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/qubes/dvmdata mkdir -p $RPM_BUILD_ROOT/usr/share/qubes/icons cp icons/*.png $RPM_BUILD_ROOT/usr/share/qubes/icons +cp misc/qubes-vm.directory.template $RPM_BUILD_ROOT/usr/share/qubes/ +cp misc/qubes-templatevm.directory.template $RPM_BUILD_ROOT/usr/share/qubes/ mkdir -p $RPM_BUILD_ROOT/usr/bin cp ../common/qubes_setup_dnat_to_ns $RPM_BUILD_ROOT/usr/lib/qubes @@ -271,6 +273,8 @@ fi %attr(770,root,qubes) %dir /var/lib/qubes/backup %attr(770,root,qubes) %dir /var/lib/qubes/dvmdata %dir /usr/share/qubes/icons/*.png +/usr/share/qubes/qubes-vm.directory.template +/usr/share/qubes/qubes-templatevm.directory.template /usr/lib/qubes/qubes_setup_dnat_to_ns /usr/lib/qubes/qubes_fix_nm_conf.sh /etc/dhclient.d/qubes_setup_dnat_to_ns.sh