diff -Nru customizer-4.1.5/data/customizer.conf customizer-4.1.5/data/customizer.conf --- customizer-4.1.5/data/customizer.conf 2017-02-09 03:54:00.000000000 +0000 +++ customizer-4.1.5/data/customizer.conf 2017-02-19 01:31:58.000000000 +0000 @@ -1,13 +1,13 @@ # NOTES: # # The paths to files should include quotes otherwise if some -# special characters or spaces are included actions may will fail! +# special characters or spaces are included actions will fail! # # Changing the WORK_DIR while in the middle of customization -# proccess is a bad idea! Clean and do it after that. +# process is a very bad idea! Clean and do it after that. [preferences] -WORK_DIR = /home +WORK_DIR = /home/customizer LOCALES = C RESOLUTION = 800x600 COMPRESSION = gzip diff -Nru customizer-4.1.5/debian/bzr-builder.manifest customizer-4.1.5/debian/bzr-builder.manifest --- customizer-4.1.5/debian/bzr-builder.manifest 2017-02-09 03:54:01.000000000 +0000 +++ customizer-4.1.5/debian/bzr-builder.manifest 2017-02-19 01:31:58.000000000 +0000 @@ -1,2 +1,2 @@ -# bzr-builder format 0.3 deb-version {debupstream}-0~293 -lp:~eloaders/customizer/stable revid:git-v1:ff53aaf3b93df3c34e0f404a848b492d147f0b88 +# bzr-builder format 0.3 deb-version {debupstream}-0~294 +lp:~eloaders/customizer/stable revid:git-v1:972cd0f3890836b35e0c2d822841883838391d90 diff -Nru customizer-4.1.5/debian/changelog customizer-4.1.5/debian/changelog --- customizer-4.1.5/debian/changelog 2017-02-09 03:54:01.000000000 +0000 +++ customizer-4.1.5/debian/changelog 2017-02-19 01:31:58.000000000 +0000 @@ -1,8 +1,8 @@ -customizer (4.1.5-0~293~ubuntu12.04.1) precise; urgency=low +customizer (4.1.5-0~294~ubuntu12.04.1) precise; urgency=low * Auto build. - -- Sonicwalker Thu, 09 Feb 2017 03:54:01 +0000 + -- Sonicwalker Sun, 19 Feb 2017 01:31:58 +0000 customizer (4.1.5-0+20170208) unstable; urgency=medium diff -Nru customizer-4.1.5/installer.py customizer-4.1.5/installer.py --- customizer-4.1.5/installer.py 2017-02-09 03:54:00.000000000 +0000 +++ customizer-4.1.5/installer.py 2017-02-19 01:31:58.000000000 +0000 @@ -104,9 +104,15 @@ if not IS_ROOT: root_warning() if use_pyqt5: - run_cmd = ("make", "PYQT=5") + if PYTHON3_OK: + run_cmd = ("make", "PYQT=5", "PYTHON=python3") + else: + run_cmd = ("make", "PYQT=5") else: - run_cmd = ("make") + if PYTHON3_OK: + run_cmd = ("make", "PYTHON=python3") + else: + run_cmd = ("make") try: code = subprocess.call(run_cmd) except OSError as errmsg: @@ -223,7 +229,11 @@ except Exception as errmsg: print("Sorry, package installation failed [{0}]".format(errmsg)) else: - print("Sorry, we won't be able to manage packages unless\n" + code = subprocess.call(("sudo", "apt", "install", package_names)) + if code == 0: + print("\nCustomizer requirements have been installed from apt.") + else: + print("Sorry, we won't be able to manage packages unless\n" "the installer is run as root. (perhaps with 'sudo !!' )") cache.close() diff -Nru customizer-4.1.5/Makefile customizer-4.1.5/Makefile --- customizer-4.1.5/Makefile 2017-02-09 03:54:00.000000000 +0000 +++ customizer-4.1.5/Makefile 2017-02-19 01:31:58.000000000 +0000 @@ -54,6 +54,7 @@ core: $(SED) -e 's|@VERSION@|$(VERSION)|' -e 's|@PREFIX@|$(PREFIX)|g' \ + -e 's|@PYTHON_VERSION@|$(PYTHON_VERSION)|' \ src/main.py.in > src/main.py gui: @@ -64,6 +65,7 @@ $(SED) 's|@PREFIX@|$(PREFIX)|' data/customizer.policy.in > \ data/customizer.policy $(SED) -e 's|@VERSION@|$(VERSION)|' -e 's|@PREFIX@|$(PREFIX)|g' \ + -e 's|@PYTHON_VERSION@|$(PYTHON_VERSION)|' \ src/gui.py.in > src/gui.py $(PYUIC) src/gui.ui -o src/gui_ui.py ifneq ($(shell which $(LRELEASE)),) diff -Nru customizer-4.1.5/src/actions/rebuild.py customizer-4.1.5/src/actions/rebuild.py --- customizer-4.1.5/src/actions/rebuild.py 2017-02-09 03:54:00.000000000 +0000 +++ customizer-4.1.5/src/actions/rebuild.py 2017-02-19 01:31:58.000000000 +0000 @@ -86,6 +86,12 @@ release = common.get_value(config.FILESYSTEM_DIR + '/etc/lsb-release', \ 'DISTRIB_RELEASE=') + if isinstance(arch, bytes): # For some reason this is of type 'bytes'. + if int(sys.version_info[0]) >= 3: # If we're running under python3 + arch = str(arch, 'utf-8') + else: # Otherwise just cast it to a str without the 'utf-8' option. + arch = str(arch) + # It's really annoying to override the output filename other ways. # If you actually try to change lsb-release, you end up breaking apt. livecd_file = misc.join_paths(config.FILESYSTEM_DIR, 'etc/livecd-release') @@ -134,14 +140,21 @@ # Detect files needed for booting, the kernel, initramfs, xen and anything else. detect_boot() if not vmlinuz: - message.sub_info('Re-installing kernel') - misc.chroot_exec(('apt-get', 'purge', '--yes', 'linux-image*', '-q')) - if arch is not "amd64": # then use the 32bit 'linux-image-generic' - misc.chroot_exec(('apt-get', 'install', '--yes', \ - 'linux-image-generic', '-q')) - else: # use the amd64 'linux-signed-generic' for uEFI + if config.PURGE_KERNEL: + message.sub_info('Re-installing kernel') + misc.chroot_exec(('apt-get', 'purge', '--yes', 'linux-image*', '-q')) + message.sub_debug("Kernel Selection Debug: {0}, {1}".format(type(config.KERNEL), config.KERNEL)) + if config.KERNEL is not "default" or None: misc.chroot_exec(('apt-get', 'install', '--yes', \ - 'linux-signed-generic', '-q')) + config.KERNEL, '-q')) + else: # use the kernel the user specified in the config. + if arch is not "amd64": # then use the 32bit 'linux-image-generic' + misc.chroot_exec(('apt-get', 'install', '--yes', \ + 'linux-image-generic', '-q')) + else: # use the amd64 'linux-signed-generic' for uEFI + misc.chroot_exec(('apt-get', 'install', '--yes', \ + 'linux-signed-generic', '-q')) + misc.chroot_exec(('apt-get', 'clean')) else: message.sub_info('Updating initramfs') @@ -255,6 +268,11 @@ lpackages = misc.chroot_exec(('dpkg-query', '-W', \ '--showformat=${Package} ${Version}\\n'), prepare=False, mount=False, \ output=True) + if isinstance(lpackages, bytes): # For some reason this is of type 'bytes'. + if int(sys.version_info[0]) >= 3: # If we're running under python3 + lpackages = str(lpackages, 'utf-8') + else: # Otherwise just cast it to a str without the 'utf-8' option. + lpackages = str(lpackages) message.sub_debug('Packages', lpackages) misc.write_file(misc.join_paths(config.ISO_DIR, \ 'casper/filesystem.manifest'), lpackages) diff -Nru customizer-4.1.5/src/gui.py.in customizer-4.1.5/src/gui.py.in --- customizer-4.1.5/src/gui.py.in 2017-02-09 03:54:00.000000000 +0000 +++ customizer-4.1.5/src/gui.py.in 2017-02-19 01:31:58.000000000 +0000 @@ -1,4 +1,4 @@ -#!@PREFIX@/bin/python2.7 +#!@PREFIX@/bin/python@PYTHON_VERSION@ ################# NOTE ################# # This is quick and dirty written GUI! # @@ -88,6 +88,9 @@ # Note that because we use a string to specify the type of # the QString argument then this code will run under Python v2 and v3. critical_messagebox = pyqtSignal(['QString']) + warning_messagebox = pyqtSignal(['QString']) + info_messagebox = pyqtSignal(['QString']) + exit_customizer = pyqtSignal() # Threads use this mailbox to signal the main window on the main thread. # Add more pyqtSignal in the class above to 'connect' or 'emit'. @@ -105,8 +108,16 @@ self.func() except SystemExit: pass - except Exception as detail: - main_thread_mailbox.critical_messagebox.emit(detail[0]) + except RuntimeError as detail: # catch misc.system_command + errmsg = u"An error occured while a thread was running: \n \ + Type: {0}\nDetails: \n{1}\n\n".format(type(detail), detail) + print(errmsg) + myval = main_thread_mailbox.warning_messagebox.emit(errmsg) + except Exception as detail: # Something else went wrong. + errmsg = u"An Exception occured while a thread was running: \n \ + Type: {0}\nDetails: \n{1}\n\n".format(type(detail), detail) + print(errmsg) + myval = main_thread_mailbox.critical_messagebox.emit(errmsg) self.quit() finally: self.finished.emit() @@ -178,6 +189,10 @@ ui.rebuildButton.setEnabled(False) ui.cleanButton.setEnabled(False) ui.extraCustomizationBox.setEnabled(False) + main_thread_mailbox.critical_messagebox.connect(msg_critical) + main_thread_mailbox.warning_messagebox.connect(msg_warning) + main_thread_mailbox.info_messagebox.connect(msg_info) + main_thread_mailbox.exit_customizer.connect(quit) def run_core(args, terminal=True): message.sub_debug('GUI Running', 'customizer ' + args) @@ -251,19 +266,24 @@ global thread thread = Thread(func) thread.finished.connect(worker_stopped) - main_thread_mailbox.critical_messagebox.connect(msg_critical) worker_started() thread.start() -def run_extract(): +def obtain_filename(dir, extfilter): sfile = QFileDialog.getOpenFileName(MainWindow, app.tr('Open'), \ - config.ISO, app.tr('ISO Files (*.iso);;All Files (*)')) + dir, extfilter) + message.sub_debug("File Dialog returned: {0} {1}".format(sfile, type(sfile))) + if QT_VER is not 5: + return sfile + else: # QFileDialog's return is a tuple in 5.x+ + message.sub_debug("File Dialog was QT5 formatted: {0} {1}".format(sfile[0], type(sfile[0]))) + return sfile[0] + +def run_extract(): + sfile = obtain_filename(config.ISO, \ + app.tr('ISO Files (*.iso);;All Files (*)')) if not sfile: return - if QT_VER is not 5: - sfile = u'{}'.format(sfile) - else: # QFileDialog's return is a tuple in 5.x+ - sfile = u'{}'.format(sfile[0]) change_value('saved', 'iso', sfile) extract.config.ISO = sfile message.sub_debug('Extracting ISO', sfile) @@ -309,14 +329,10 @@ def run_deb(): try: - sfile = QFileDialog.getOpenFileName(MainWindow, 'Open', \ - config.DEB, app.tr('Deb Files (*.deb);;All Files (*)')) + sfile = obtain_filename(config.DEB, \ + app.tr('Deb Files (*.deb);;All Files (*)')) if not sfile: return - if QT_VER is not 5: - sfile = u'{}'.format(sfile) - else: # QFileDialog's return is a tuple in 5.x+ - sfile = u'{}'.format(sfile[0]) change_value('saved', 'deb', sfile) deb.config.DEB = sfile message.sub_debug('Installing DEB package', sfile) @@ -330,14 +346,10 @@ def run_hook(): try: - sfile = QFileDialog.getOpenFileName(MainWindow, 'Open', \ - config.HOOK, app.tr('Shell Scripts (*.sh);;All Files (*)')) + sfile = obtain_filename(config.HOOK, \ + app.tr('Shell Scripts (*.sh);;All Files (*)')) if not sfile: return - if QT_VER is not 5: - sfile = u'{}'.format(sfile) - else: # QFileDialog's return is a tuple in 5.x+ - sfile = u'{}'.format(sfile[0]) change_value('saved', 'hook', sfile) hook.config.HOOK = sfile message.sub_debug('Attempting to run hook', sfile) @@ -391,10 +403,8 @@ 'Directory', config.WORK_DIR) if not spath: return - if QT_VER is not 5: - spath = u'{}'.format(spath) - else: # QFileDialog's return is a tuple in 5.x+ - spath = u'{}'.format(spath[0]) + # QFileDialog.getExistingDirectory's return is NOT a tuple in 5.x+ + spath = u'{}'.format(spath) change_value('preferences', 'work_dir', spath) ui.workDirEdit.setText(spath) except Exception as detail: diff -Nru customizer-4.1.5/src/lib/config.py customizer-4.1.5/src/lib/config.py --- customizer-4.1.5/src/lib/config.py 2017-02-09 03:54:00.000000000 +0000 +++ customizer-4.1.5/src/lib/config.py 2017-02-19 01:31:58.000000000 +0000 @@ -10,7 +10,7 @@ conf = ConfigParser.SafeConfigParser( { - 'WORK_DIR': '/home', + 'WORK_DIR': '/home/customizer', 'LOCALES': 'C', 'RESOLUTION': '800x600', 'COMPRESSION': 'gzip', @@ -18,6 +18,8 @@ 'ISO': '', 'DEB': '', 'HOOK': '', + 'KERNEL': 'default', + 'PURGE_KERNEL': True, } ) @@ -40,6 +42,8 @@ ISO = '{}'.format(conf.get('saved', 'ISO')) DEB = '{}'.format(conf.get('saved', 'DEB')) HOOK = '{}'.format(conf.get('saved', 'HOOK')) +KERNEL = '{}'.format(conf.get('saved', 'KERNEL', fallback='default')) +PURGE_KERNEL = '{}'.format(conf.get('saved', 'PURGE_KERNEL', fallback=True)) MOUNT_DIR = '/media' FILESYSTEM_DIR = os.path.join(WORK_DIR, 'FileSystem') diff -Nru customizer-4.1.5/src/lib/misc.py customizer-4.1.5/src/lib/misc.py --- customizer-4.1.5/src/lib/misc.py 2017-02-09 03:54:00.000000000 +0000 +++ customizer-4.1.5/src/lib/misc.py 2017-02-19 01:31:58.000000000 +0000 @@ -5,6 +5,7 @@ import lib.message as message CMD_DEBUG = False CHROOT_DEBUG = False +COPY_DEBUG = False FILE_DEBUG = False MOUNT_DEBUG = False @@ -61,7 +62,7 @@ return content def write_file(sfile, content): - if FILE_DEBUG: message.sub_debug('Writing data to', sfile) + if FILE_DEBUG: message.sub_debug('Writing {0} data to'.format(type(content)), sfile) dirname = os.path.dirname(sfile) if not os.path.isdir(dirname): os.makedirs(dirname) @@ -80,7 +81,7 @@ wfile.close() def append_file(sfile, content): - if FILE_DEBUG: message.sub_debug('Appending data to', sfile) + if FILE_DEBUG: message.sub_debug('Appending {0} data to'.format(type(content)), sfile) dirname = os.path.dirname(sfile) if not os.path.isdir(dirname): os.makedirs(dirname) @@ -90,7 +91,7 @@ afile.close() def copy_file(source, destination): - if FILE_DEBUG: message.sub_debug('File {} copied to'.format(source), destination) + if COPY_DEBUG: message.sub_debug('File {} copied to'.format(source), destination) base = os.path.dirname(destination) if not os.path.isdir(base): os.makedirs(base) @@ -158,7 +159,7 @@ shell=shell, cwd=cwd, env=env) pipe.wait() if pipe.returncode != 0: - raise(Exception(pipe.communicate()[1].strip())) + raise(RuntimeError(pipe.communicate()[1].strip())) return pipe.returncode else: return subprocess.check_call(command, shell=shell, cwd=cwd, env=env) diff -Nru customizer-4.1.5/src/main.py.in customizer-4.1.5/src/main.py.in --- customizer-4.1.5/src/main.py.in 2017-02-09 03:54:00.000000000 +0000 +++ customizer-4.1.5/src/main.py.in 2017-02-19 01:31:58.000000000 +0000 @@ -1,4 +1,4 @@ -#!@PREFIX@/bin/python2.7 +#!@PREFIX@/bin/python@PYTHON_VERSION@ try: # Python2 compat first import ConfigParser as configparser diff -Nru customizer-4.1.5/tr/customizer_bg_BG.ts customizer-4.1.5/tr/customizer_bg_BG.ts --- customizer-4.1.5/tr/customizer_bg_BG.ts 2017-02-09 03:54:00.000000000 +0000 +++ customizer-4.1.5/tr/customizer_bg_BG.ts 2017-02-19 01:31:58.000000000 +0000 @@ -248,47 +248,47 @@ Опитвате се да стартирате Customizer с Python 3. - + The filesystem is not valid or corrupted. Clean is recommended. Файловата система не е валидна или е повредена. Изчистване е препоръчително. - + No supported terminal emulator detected. Не е намерен терминал, който се поддържа. - + Open Отвори - + ISO Files (*.iso);;All Files (*) ISO Файлове (*.iso);;Всички Файлове (*) - + No supported text editor detected. Не е намерен текстов редактор, който се поддържа. - + Deb Files (*.deb);;All Files (*) Deb Файлове (*.deb);;Всички Файлове (*) - + Shell Scripts (*.sh);;All Files (*) Скриптове на Обвивката (*.sh);;Всички Файлове (*) - + No supported file manager detected. Не е намерен файлов мениджър, който се поддържа. - + Live user can not be empty. diff -Nru customizer-4.1.5/tr/customizer_ko_KR.ts customizer-4.1.5/tr/customizer_ko_KR.ts --- customizer-4.1.5/tr/customizer_ko_KR.ts 2017-02-09 03:54:00.000000000 +0000 +++ customizer-4.1.5/tr/customizer_ko_KR.ts 2017-02-19 01:31:58.000000000 +0000 @@ -248,47 +248,47 @@ 당신은 파이썬 3으로 커스터마이저를 실행하려고합니다. - + The filesystem is not valid or corrupted. Clean is recommended. 파일시스템이 잘못되거나 손상되었습니다. 청소를 하는 것이 좋습니다. - + No supported terminal emulator detected. 지원되는 터미널 에뮬레이터가 감지 되지 않습니다. - + Open 열기 - + ISO Files (*.iso);;All Files (*) ISO 파일 (*.iso);;모든 파일 (*) - + No supported text editor detected. 지원되는 텍스트 에디터가 감지 되지 않습니다. - + Deb Files (*.deb);;All Files (*) Deb 파일 (*.deb);;모든 파일 (*) - + Shell Scripts (*.sh);;All Files (*) 쉘 스크립트 (*.sh);;모든 파일 (*) - + No supported file manager detected. 지원되는 파일 탐색기가 감지 되지 않습니다. - + Live user can not be empty. 라이브 유저는 비워 둘 수 없습니다 .