You are not logged in.

#1 2021-11-24 09:14:14

ABOhiccups
Member
Registered: 2017-08-27
Posts: 62

How to tell PKGBUILD to ignore existed file?

Does anyone know how to tell PKGBUILD to ignore existed file without overwriting it.

I made AUR Package with pre-config file for Home Directory.

When I push a new version of AUR Package. The update will overwrite existed file from Home Directory and it may annoyed users because of that.

Offline

#2 2021-11-24 09:42:23

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 14,477

Re: How to tell PKGBUILD to ignore existed file?

PKGBUILDs that manipulate the home dir are a big no. write a system wide example and tell people to merge or so for the file in the home dir in an info message via a post-install/update note.

The actual answer to the question is to declare the file you want to keep if it has been modified is adding it to the backup array

Last edited by V1del (2021-11-24 09:42:58)

Online

#3 2021-11-24 10:14:25

ABOhiccups
Member
Registered: 2017-08-27
Posts: 62

Re: How to tell PKGBUILD to ignore existed file?

I've tried to put '$HOME/.config/FasterPPlus/Dolphin.ini' and 'home/$USER/.config/FasterPPlus/Dolphin.ini' in "backup=".

It does not backup a config file. But put 'home/<my-username>/.config/FasterPPlus/Dolphin.ini' in "backup=" does backup a config file. Putting a username as a directory is not a good idea and many people has different username.

Do you have ideas how to tell backup to backup a file from Home Directory with $HOME or $USER?

Last edited by ABOhiccups (2021-11-24 10:16:01)

Offline

#4 2021-11-24 10:31:09

ABOhiccups
Member
Registered: 2017-08-27
Posts: 62

Re: How to tell PKGBUILD to ignore existed file?

Is there a special a command or something to tell PKGBUILD to continue building if there was an error from 1 command?

For example. If I have (cp "$HOME/.config/FasterPPlus/Dolphin.ini" "$pkgdir/$HOME/.config/FasterPPlus/Dolphin.ini") if the file from target directory does not exist. It will continue instead of stopping the build.

Offline

#5 2021-11-24 10:32:41

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 14,477

Re: How to tell PKGBUILD to ignore existed file?

As said, manipulating the home dir from a PKGBUILD is not something you should do in any case, why do you think you need to do this? If you want to include optimized new config changes store the file system wide and tell the user to merge anything that's possibly applicable.

Online

#6 2021-11-24 10:46:48

ABOhiccups
Member
Registered: 2017-08-27
Posts: 62

Re: How to tell PKGBUILD to ignore existed file?

I'm just going to remove a pre-config and leave a note in the comment letting anyone know where to find a directory to setup.

Thank you trying to help.

Offline

#7 2021-11-24 17:20:55

ayekat
Member
Registered: 2011-01-17
Posts: 1,468
Website

Re: How to tell PKGBUILD to ignore existed file?

User configuration is likely better handled by using a Git (or other VCS) repo. See the dotfiles article in the Arch Wiki to get an idea and some examples.

The main problem with using distribution packages for installing files into users' home is that… well, how do you know the location of the users' home directories? If you package something for /home/ABOhiccups, but my home is in /home/ayekat, it won't work. Not to mention if there are multiple users on a system.
And most users don't want the system administrator messing around with files in their home directory. That includes cases where I'm both a user and the local system administrator.

Last edited by ayekat (2021-11-24 17:21:12)


{,META,RE}PKGBUILDSpacman-hacks (includes makemetapkg and remakepkg) │ dotfiles

Offline

Board footer

Powered by FluxBB