You are not logged in.

#1 2021-07-28 01:19:49

libele
Member
Registered: 2021-07-27
Posts: 4

[SOLVED] pkgbuild best practice for installing folder with subdirs

sorry if this has been asked before, but the forum doesn't like it if i search for this.

is it possible to use the 'install' program to install a folder that has subdirectories? if not, how should one do this?

Last edited by libele (2021-07-28 02:52:54)

Offline

#2 2021-07-28 02:14:21

mpan
Member
Registered: 2012-08-01
Posts: 1,205
Website

Re: [SOLVED] pkgbuild best practice for installing folder with subdirs

install has the `-d and `-D` options, which creates a directory and all its parents. You may invoke install multiple times (core/systemd PKGBUILD as an example).

However, that is what makepkg is being asked to do by a PKGBUILD. See it as an extra step over what the upstream installation procedure does; a kind of Arch-specific tweaking. Normally it’s the installation code — for example `make install` — that handles creation of all of the relevant directories, placing files and so on.

Last edited by mpan (2021-07-28 02:16:43)


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#3 2021-07-28 02:31:36

libele
Member
Registered: 2021-07-27
Posts: 4

Re: [SOLVED] pkgbuild best practice for installing folder with subdirs

ah, i see that the systemd PKGBUILD uses mv to install a folder. i was under the impression that install should be used for everything!

Offline

#4 2021-07-28 02:37:35

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,520
Website

Re: [SOLVED] pkgbuild best practice for installing folder with subdirs

If it's a single directory full of files, you can do it with two install commands: one to make the directory, and another using the '-t' flag for target directory and a shell glob for files to install.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2021-07-28 02:47:59

libele
Member
Registered: 2021-07-27
Posts: 4

Re: [SOLVED] pkgbuild best practice for installing folder with subdirs

but if it's a directory full of directories, it would okay to use mv instead of install?

Offline

#6 2021-07-28 02:49:40

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,520
Website

Re: [SOLVED] pkgbuild best practice for installing folder with subdirs

You can use whatever you'd like.  But if it was me, I'd use `cp -a`.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2021-07-28 02:52:16

libele
Member
Registered: 2021-07-27
Posts: 4

Re: [SOLVED] pkgbuild best practice for installing folder with subdirs

okay, will do. i'm partial to `cp -a` as well. marking this as solved, thanks y'all!

Offline

Board footer

Powered by FluxBB