Skip to content

difference between using 'install' or plain 'cp' when writing AUR packages

can someone explain to me which one to use when writing PKGBUILDS. for example when copying a folder in package {} should I just use something like 'cp -r' or 'install -dm' ? What is the difference?

36 points8 comments
Open on Reddit
About this post
Posted
Archived
Score
36 · 100% up
Kind
Text
ID
22avoa

9 comments

Use install. The difference is that install unlinks any existing files before copying. This is important because the files you're updating could be running.

17 points
unknown author4 hidden

Deleted before we saved it.

15 points

The PKGBUILD commands happen in a chroot, apart from the real file system.

That is technically incorrect, since makepkg does not use a chroot. What's true is that it doesn't write to the system directly.

12 points

AFAIK, The main advantage of install is it allows you to specify permissions. It might also create directories as needed (like mkdir -p) Personally, I would rather just use mkdir, cp, and chmod - but I don't think it really matters

15 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.