(output_type)
| 21 | _generate_icons() |
| 22 | |
| 23 | def run_fpm(output_type): |
| 24 | dest = path('target/${installer}') |
| 25 | if exists(dest): |
| 26 | remove(dest) |
| 27 | # Lower-case the name to avoid the following fpm warning: |
| 28 | # > Debian tools (dpkg/apt) don't do well with packages that use capital |
| 29 | # > letters in the name. In some cases it will automatically downcase |
| 30 | # > them, in others it will not. It is confusing. Best to not use any |
| 31 | # > capital letters at all. |
| 32 | name = SETTINGS['app_name'].lower() |
| 33 | args = [ |
| 34 | 'fpm', '-s', 'dir', |
| 35 | # We set the log level to error because fpm prints the following warning |
| 36 | # even if we don't have anything in /etc: |
| 37 | # > Debian packaging tools generally labels all files in /etc as config |
| 38 | # > files, as mandated by policy, so fpm defaults to this behavior for |
| 39 | # > deb packages. You can disable this default behavior with |
| 40 | # > --deb-no-default-config-files flag |
| 41 | '--log', 'error', |
| 42 | '-C', path('target/installer'), |
| 43 | '-n', name, |
| 44 | '-v', SETTINGS['version'], |
| 45 | '--vendor', SETTINGS['author'], |
| 46 | '-t', output_type, |
| 47 | '-p', dest |
| 48 | ] |
| 49 | if SETTINGS['description']: |
| 50 | args.extend(['--description', SETTINGS['description']]) |
| 51 | if SETTINGS['author_email']: |
| 52 | args.extend([ |
| 53 | '-m', '%s <%s>' % (SETTINGS['author'], SETTINGS['author_email']) |
| 54 | ]) |
| 55 | if SETTINGS['url']: |
| 56 | args.extend(['--url', SETTINGS['url']]) |
| 57 | for dependency in SETTINGS['depends']: |
| 58 | args.extend(['-d', dependency]) |
| 59 | if is_arch_linux(): |
| 60 | for opt_dependency in SETTINGS['depends_opt']: |
| 61 | args.extend(['--pacman-optional-depends', opt_dependency]) |
| 62 | try: |
| 63 | run(args, check=True, stdout=DEVNULL) |
| 64 | except FileNotFoundError: |
| 65 | raise FileNotFoundError( |
| 66 | "fbs could not find executable 'fpm'. Please install fpm using the " |
| 67 | "instructions at " |
| 68 | "https://fpm.readthedocs.io/en/latest/installation.html." |
| 69 | ) from None |
| 70 | |
| 71 | def _generate_icons(): |
| 72 | dest_root = path('target/installer/usr/share/icons/hicolor') |
no test coverage detected