Closed rgeorgiev583 closed 4 years ago
Does it work if you separate the packages by a newline rather than a space? I think this was a regression in the migration to the new argument parser
@lucasdemarchi, it still fails, albeit with a different error message:
# mkosi -o /tmp/mkosi/arch --default arch.default build
Traceback (most recent call last):
File "/usr/bin/mkosi", line 4628, in <module>
main()
File "/usr/bin/mkosi", line 4611, in main
args = parse_args()
File "/usr/bin/mkosi", line 3413, in parse_args
args = parse_args_file_group(argv, default_path)
File "/usr/bin/mkosi", line 3448, in parse_args_file_group
parsed_args = parser.parse_args(argv_post_parsed, CommandLineArguments())
File "/usr/lib/python3.7/argparse.py", line 1749, in parse_args
args, argv = self.parse_known_args(args, namespace)
File "/usr/lib/python3.7/argparse.py", line 1781, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
File "/usr/lib/python3.7/argparse.py", line 1793, in _parse_known_args
arg_strings = self._read_args_from_files(arg_strings)
File "/usr/bin/mkosi", line 3176, in _read_args_from_files
config.read_file(args_file)
File "/usr/lib/python3.7/configparser.py", line 717, in read_file
self._read(f, source)
File "/usr/lib/python3.7/configparser.py", line 1110, in _read
raise e
configparser.ParsingError: Source contains parsing errors: '/home/sid/pkg/img/mkosi/arch.default'
[line 10]: 'base-devel\\\n'
[line 11]: 'xorg-server\\\n'
[line 12]: 'plasma\\\n'
[line 13]: 'plasma-meta\\\n'
[line 14]: 'kde-applications\\\n'
[line 15]: 'kde-applications-meta\n'
And here's the modified arch.default
file:
[Distribution]
Distribution=arch
[Output]
Format=directory
Hostname=**REDACTED**
[Packages]
Packages=base\
base-devel\
xorg-server\
plasma\
plasma-meta\
kde-applications\
kde-applications-meta
[Validation]
Password=**REDACTED**
I suppose that either newline-separated lists are not supported by the parser or the syntax I'm using is wrong.
Packages = test1 Test2 Test3
This should work. Don't escape the \n with an extra .
I removed the backslashes but the error persists:
configparser.ParsingError: Source contains parsing errors: '/home/sid/pkg/img/mkosi/arch.default'
[line 10]: 'base-devel\n'
[line 11]: 'xorg-server\n'
[line 12]: 'plasma\n'
[line 13]: 'plasma-meta\n'
[line 14]: 'kde-applications\n'
[line 15]: 'kde-applications-meta\n'
I removed the backslashes but the error persists:
configparser.ParsingError: Source contains parsing errors: '/home/sid/pkg/img/mkosi/arch.default' [line 10]: 'base-devel\n' [line 11]: 'xorg-server\n' [line 12]: 'plasma\n' [line 13]: 'plasma-meta\n' [line 14]: 'kde-applications\n' [line 15]: 'kde-applications-meta\n'
Works for me if you provide the package list as described in the documentation:
The file format is inspired by Windows .ini files and supports multi-line assignments: any line with initial whitespace is considered a continuation line of the line before.
[Distribution]
Distribution=arch
[Output]
Format=directory
Hostname=**REDACTED**
[Packages]
Packages=base
base-devel
xorg-server
plasma
plasma-meta
kde-applications
kde-applications-meta
[Validation]
Password=**REDACTED**
Let's close this, simply replacing the spaces by comma's also solves the issue.
Here are the contents of the
arch.default
file:I'm running the command on a Manjaro Linux host system (which is a distribution compatible with Arch).