Re: [libvirt PATCH 2/3] scripts: Add $DESTDIR support to meson-install-web.py

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 09, 2022 at 05:26:28PM +0200, Pavel Hrdina wrote:
> On Tue, Jul 19, 2022 at 04:17:44PM +0200, Andrea Bolognani wrote:
> > +destdir = os.getenv('DESTDIR')
> > +if destdir:
> > +    destdir = Path(destdir)
> > +    if not destdir.is_absolute():
> > +        print('$DESTDIR must be an absolute path')
> > +        sys.exit(1)
>
> I don't see any reason for this check. Yes, DESTDIR is mostly used with
> absolute path but the other two scripts where we use DESTDIR don't have
> this check and meson itself doesn't complaint if the path is
> not absolute as well.
>
> That brings me to the other point that there is no need to use pathlib
> at all. We can just do the same as scripts/meson-install-dirs.py or
> scripts/meson-install-symlink.py:
>
> destdir = os.environ.get('DESTDIR', os.sep)
>
> for desc in sys.argv[1:]:
>     inst = desc.split(':')
>     dst = os.path.join(destdir, inst[1].strip(os.sep))
>     os.makedirs(dst, exist_ok=True)
>     shutil.copy(src, dst)

You're absolutely right. Somehow I had not realized that we already
had custom DESTDIR handling in other scripts that I could rip off ;)

v2 here:

  https://listman.redhat.com/archives/libvir-list/2022-August/233655.html

-- 
Andrea Bolognani / Red Hat / Virtualization




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux