Skip to content

Commit

Permalink
[WIP] fixes
Browse files Browse the repository at this point in the history
Use desktop file
  • Loading branch information
emkll committed May 28, 2019
1 parent 8952cc4 commit 94f0afa
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ remove-sd-gpg: assert-dom0 ## Destroys SD GPG keystore VM
@./scripts/destroy-vm sd-gpg

remove-sd-export: assert-dom0 ## Destroys SD EXPORT VMs
@qvm-kill sd-export-usb
@qvm-kill sd-export-usb || true
@qvm-usb detach sd-export-usb || true
@./scripts/destroy-vm sd-export-usb
@./scripts/destroy-vm sd-export-dvm
Expand Down
29 changes: 17 additions & 12 deletions dom0/sd-export-files.sls
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
sud# -*- coding: utf-8 -*-
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :

##
Expand All @@ -20,6 +20,19 @@ sd-export-send-to-usb-script:
- mode: 755
- makedirs: True

sd-export-desktop-file:
file.managed:
- name: /usr/share/applications/send-to-usb.desktop
- source: salt://sd/sd-export/send-to-usb.desktop
- user: root
- group: root
- mode: 755
- makedirs: True
cmd.run:
- name: sudo update desktop-database /usr/share/applications
- require:
- file: sd-export-desktop-file

sd-export-file-format:
file.managed:
- name: /usr/share/mime/packages/application-x-sd-export.xml
Expand All @@ -30,14 +43,6 @@ sd-export-file-format:
- makedirs: True
cmd.run:
- name: sudo update-mime-database /usr/share/mime

sd-export-template-mimetype:
file.blockreplace:
- name: /etc/mailcap
- prepend_if_not_found: False
- marker_start: "# ----- User Section Begins ----- #"
- marker_end: "# ----- User Section Ends ----- #"
- content: |
application/x-sd-export; /usr/bin/send-to-usb '%s';
cmd.run:
- name: sudo update-mime
- require:
- file: sd-export-file-format
- file: sd-export-desktop-file
2 changes: 1 addition & 1 deletion sd-export/send-to-usb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import sys
import tarfile
import tempfile

DEVICE = "/dev/sdb1"
DEVICE = "/dev/sda1"
MOUNTPOINT = "/media/usb"
ENCRYPTED_DEVICE = "encrypted_volume"
FILE = sys.argv[1]
Expand Down
5 changes: 5 additions & 0 deletions sd-export/send-to-usb.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Desktop Entry]
Type=Application
MimeType=application/x-sd-export
Name="Export SD submission to USB"
Exec=/usr/bin/send-to-usb

0 comments on commit 94f0afa

Please sign in to comment.