From 7e79664b23068f8a8e2324a0b336caa8592521ed Mon Sep 17 00:00:00 2001 From: mbusb Date: Sun, 7 May 2017 09:32:49 +0530 Subject: [PATCH 1/2] Don't include temp files for git commits --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 54f33b6..c32cff0 100644 --- a/.gitignore +++ b/.gitignore @@ -105,4 +105,5 @@ multibootusb*.exe # Test file which I work on to test logic before committing to main file. mbusb_te*py text.txt -text.py \ No newline at end of file +text.py +*~ From 021b3ae436db4deda8c2c72c582d7a569b24924f Mon Sep 17 00:00:00 2001 From: mbusb Date: Sun, 7 May 2017 12:18:14 +0530 Subject: [PATCH 2/2] Bug fix and typos 1. Add python path so as to avaoid import error under debian 2. Fixed shipping of grub2 modules under correct directory 3. Display version info only before launching the application --- multibootusb | 13 +++++++++---- org.debian.pkexec.run-multibootusb.policy | 2 +- setup.py | 12 +++++++++++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/multibootusb b/multibootusb index f5e3ff0..996ac26 100644 --- a/multibootusb +++ b/multibootusb @@ -12,9 +12,13 @@ import sys import os import platform -# The following line is required for distros based on rpm so as to avoid import errors when running from installed system +# The following line is required for distros based on rpm so as to avoid import errors when running from +# installed system sys.path.append('/usr/local/lib/python3.4/dist-packages') -# print(sys.path) + +# Ensure that above issue doesn't occur on debian based distro as well +if '/usr/lib/python3/dist-packages/scripts/' not in sys.path: + sys.path.append('/usr/lib/python3/dist-packages/scripts/') # Had trouble in importing scripts directory. Had to add few lines below to ensure it works on source as well as # post install @@ -57,7 +61,7 @@ Options: -h or --help : Print this help message and exit -c or --command : Invoke command line usage. This option is required; if omitted, the GUI will be launched. - -i or --iso : Path to ISO file()s. If many ISOs are supplied, + -i or --iso : Path to ISO file(s). If many ISOs are supplied, they should be separated by ',' with no spaces in between. -t or --target : Path to target USB device partition (e.g. "/dev/sdb1"). @@ -105,7 +109,6 @@ def start_gui(): if __name__ == '__main__': - running_from() if platform.system() == 'Windows': if not admin.isUserAdmin(): admin.runAsAdmin() @@ -165,7 +168,9 @@ if gui is False: log('\nOptions \'-i\' and \'-t\' must be supplied together. See the usage below.') usage() else: + running_from() cli_install_distro() elif gui is True: + running_from() start_gui() diff --git a/org.debian.pkexec.run-multibootusb.policy b/org.debian.pkexec.run-multibootusb.policy index d8e8566..e111748 100644 --- a/org.debian.pkexec.run-multibootusb.policy +++ b/org.debian.pkexec.run-multibootusb.policy @@ -12,7 +12,7 @@ auth_admin auth_admin - /usr/local/bin/multibootusb + /usr/bin/multibootusb true diff --git a/setup.py b/setup.py index 6adf520..41d9aa6 100644 --- a/setup.py +++ b/setup.py @@ -20,6 +20,15 @@ def get_data(_dir): data.append(cfg_file) return data + +def root_files(_dir): + data = [] + for _file in os.listdir(_dir): + path = os.path.join(_dir, _file) + if not os.path.isdir(path): + data.append(path) + return data + Version = mbusb_version() print(Version) setup( @@ -55,6 +64,7 @@ setup( ('/usr/share/multibootusb/data/multibootusb', ["data/multibootusb/menu.lst"]), ('/usr/share/multibootusb/data/multibootusb', ["data/multibootusb/syslinux.cfg"]), ('/usr/share/multibootusb/data/multibootusb', ["data/multibootusb/vesamenu.c32"]), - ('/usr/share/multibootusb/data/multibootusb/grub', get_data('data/multibootusb/grub')), + ('/usr/share/multibootusb/data/multibootusb/grub/i386-pc', get_data('data/multibootusb/grub')), + ('/usr/share/multibootusb/data/multibootusb/grub', root_files('data/multibootusb/grub')), ('/usr/share/multibootusb/data/tools/syslinux', get_data('data/tools/syslinux'))] )