Handle absolute sysconfdir when installing symlinks

sysconfdir defaults to /etc when the prefix is set to /usr. But joining
MESON_INSTALL_DESTDIR_PREFIX and sysconfdir when the latter is an
absoulte path, results in sysconfdir only. Which might lead to an error
during install because /etc/fonts/conf.d/ might already exist from an
pre-existing fontconfig installation.
This commit is contained in:
Heiko Becker 2020-12-03 21:04:26 +01:00 committed by Akira TAGOH
parent 615e2cb844
commit 4e42925096
1 changed files with 8 additions and 1 deletions

View File

@ -12,7 +12,14 @@ if __name__=='__main__':
parser.add_argument('links', nargs='+')
args = parser.parse_args()
confpath = os.path.join(os.environ['MESON_INSTALL_DESTDIR_PREFIX'], args.confpath)
if os.path.isabs(args.confpath):
destdir = os.environ.get('DESTDIR')
if destdir:
confpath = os.path.join(destdir, args.confpath[1:])
else:
confpath = args.confpath
else:
confpath = os.path.join(os.environ['MESON_INSTALL_DESTDIR_PREFIX'], args.confpath)
if not os.path.exists(confpath):
os.makedirs(confpath)