You are not logged in.

#1 2021-11-14 13:14:41

ayushnix
Member
Registered: 2021-11-14
Posts: 8
Website

[SOLVED] How should I go about removing old legacy files?

I installed bash completion files to the legacy /etc/bash_completion.d directory using a PKGBUILD that I published on the AUR. In the new version of the package, I'm installing the bash completion files to /usr/share/bash-completion/completions/.

Should I just check if the file is present in the legacy folder and remove it in the PKGBUILD package() function? Or should I use a .install file and inform users to remove the old bash completion file? Or maybe both?

I realize many users would build PKGBUILDs inside some sort of chroot so removing files may not work in that case. This makes me think the post_install method is fine. What do you think?

Last edited by ayushnix (2021-11-14 13:57:11)

Offline

#2 2021-11-14 13:18:52

Ammako
Member
Registered: 2021-07-16
Posts: 266

Re: [SOLVED] How should I go about removing old legacy files?

You can't and shouldn't be removing user files in the PKGBUILD package() function anyway.

Offline

#3 2021-11-14 13:18:56

Scimmia
Fellow
Registered: 2012-09-01
Posts: 8,751

Re: [SOLVED] How should I go about removing old legacy files?

If the files are part of the package, they will be removed automatically when you update.

Offline

#4 2021-11-14 13:19:54

Slithery
Forum Moderator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 4,753

Re: [SOLVED] How should I go about removing old legacy files?

Ammako wrote:

You can't and shouldn't be removing user files in the PKGBUILD package() function anyway.

What user files?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2021-11-14 13:20:16

Ammako
Member
Registered: 2021-07-16
Posts: 266

Re: [SOLVED] How should I go about removing old legacy files?

The files in /etc/bash_completion.d

Last edited by Ammako (2021-11-14 13:21:15)

Offline

#6 2021-11-14 13:20:59

Slithery
Forum Moderator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 4,753

Re: [SOLVED] How should I go about removing old legacy files?

And why would that be a user file? It's in a system directory...


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#7 2021-11-14 13:21:45

Ammako
Member
Registered: 2021-07-16
Posts: 266

Re: [SOLVED] How should I go about removing old legacy files?

Does the terminology matter? package() function will not and should not touch anything on disk. Just $pkgdir

Last edited by Ammako (2021-11-14 13:22:07)

Offline

#8 2021-11-14 13:53:44

ayushnix
Member
Registered: 2021-11-14
Posts: 8
Website

Re: [SOLVED] How should I go about removing old legacy files?

I'll use a .install file to inform users if needed. Removing files in a PKGBUILD wouldn't work if makepkg is run in a chroot anways.

Offline

#9 2021-11-14 13:56:48

ayushnix
Member
Registered: 2021-11-14
Posts: 8
Website

Re: [SOLVED] How should I go about removing old legacy files?

Scimmia wrote:

If the files are part of the package, they will be removed automatically when you update.

Yeah, looks like the file in /etc/bash_completion.d got removed when I upgraded the package. Thanks.

Offline

Board footer

Powered by FluxBB