Re: [arch-general] Howto - tell pacman -S (-U) to overwrite existing file in filesystem?
On 02/20/2011 04:15 PM, Gaetan Bisson wrote:
[2011-02-20 15:32:14 -0600] David C. Rankin:
The question is "Can I do something in the PKGBUILD to tell pacman - if the file is already there -> overwrite it?"
Please. This mailing list is not for people to read you man pages.
Next time, could you first spend five minutes to try and answer your questions on your own? Here, it was as simple as searching for "pacman overwrite" in Google, or looking for "overwrite" in pacman's man page.
I am sure you understand this would benefit to everyone.
For a more lengthy essay on the topic, see:
Thank you Gaetan and Sebastian, From your answers, I don't think you read my question before giving the the RTFM dismissal. I know how pacman -f works. I stated that in my original email. I'm not asking how to make pacman do it. I'm asking: <quote> The question is "Can I do something in the PKGBUILD to tell pacman - if the file is already there -> overwrite it?" </quote> The only information I found in man PKGBUILD on force was option(force) which relates to triggering an update even though the version number would not normally do so. I apologize if I missed it in the man page, but that is why I asked. -- David C. Rankin, J.D.,P.E.
On 02/20/11 18:28, David C. Rankin wrote:
The question is "Can I do something in the PKGBUILD to tell pacman - if the file is already there -> overwrite it?"
Please don't. Put it in your release notes instead. Don't silently overwrite user-written files! You might look into configuration management too (the thing that generates *.pacnew files among other things) -- I'm not sure if it'd be useful, but that research might tell you what's been done/discussed before when making /etc files be newly pacman-managed. -Isaac
[2011-02-20 17:28:17 -0600] David C. Rankin:
From your answers, I don't think you read my question before giving the the RTFM dismissal.
I read (and answered) the question that is the subject of this thread. The lengthy details of how you got to ask yourself this question don't interest me much, so I admit I just skimmed through your message. That is also why I replied off-list: to avoid polluting the list; replying to my reply on the list defeats the purpose.
The question is "Can I do something in the PKGBUILD to tell pacman - if the file is already there -> overwrite it?"
To the best of my knowledge, there is no way of doing that, except of course overwriting the file via the install script. -- Gaetan
On Mon, Feb 21, 2011 at 12:49:06AM +0100, Gaetan Bisson wrote:
[2011-02-20 17:28:17 -0600] David C. Rankin:
From your answers, I don't think you read my question before giving the the RTFM dismissal.
I read (and answered) the question that is the subject of this thread.
The lengthy details of how you got to ask yourself this question don't interest me much, so I admit I just skimmed through your message. That is also why I replied off-list: to avoid polluting the list; replying to my reply on the list defeats the purpose.
The question is "Can I do something in the PKGBUILD to tell pacman - if the file is already there -> overwrite it?"
To the best of my knowledge, there is no way of doing that, except of course overwriting the file via the install script.
I'm just curious, which part of the install script is run *before* pacman checks for conflicting files? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves. -- Alan Kay
[2011-02-21 07:35:21 +0000] Magnus Therning:
I'm just curious, which part of the install script is run *before* pacman checks for conflicting files?
None. -- Gaetan
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 21.02.2011 00:28, David C. Rankin wrote:
On 02/20/2011 04:15 PM, Gaetan Bisson wrote:
[2011-02-20 15:32:14 -0600] David C. Rankin:
The question is "Can I do something in the PKGBUILD to tell pacman - if the file is already there -> overwrite it?"
Please. This mailing list is not for people to read you man pages.
Next time, could you first spend five minutes to try and answer your questions on your own? Here, it was as simple as searching for "pacman overwrite" in Google, or looking for "overwrite" in pacman's man page.
I am sure you understand this would benefit to everyone.
For a more lengthy essay on the topic, see:
Thank you Gaetan and Sebastian,
From your answers, I don't think you read my question before giving the the RTFM dismissal.
I know how pacman -f works. I stated that in my original email. I'm not asking how to make pacman do it. I'm asking:
<quote> The question is "Can I do something in the PKGBUILD to tell pacman - if the file is already there -> overwrite it?" </quote>
The only information I found in man PKGBUILD on force was option(force) which relates to triggering an update even though the version number would not normally do so.
I apologize if I missed it in the man page, but that is why I asked.
Ah ok, now I understand your problem. What you could do, is putting the check into the PKGBUILD itself, as an bash command which is performed when you call it, like rm /etc/X11/sessions/trinity.desktop (in your case good), rm -rf * (bad), rm -rf / (fun :)) As you can see, this is potentially dangerous and this is why you always should check your PKGBUILDs before. But in a nutshell, a PKGBUILD is little more than a shellscript and you can do basically everything you can perform with a shell. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1izv4ACgkQcFyEi9ZCdkBDdQCgoTopXVd62NRKJxOYSKVoDuv6 sukAnRPPwC6G8Bvu6So7UYtihQMBoXcz =fIj2 -----END PGP SIGNATURE-----
On Mon, 2011-02-21 at 21:45 +0100, Sebastian Rust wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
The question is "Can I do something in the PKGBUILD to tell pacman - if the file is already there -> overwrite it?" Ah ok, now I understand your problem. What you could do, is putting
On 21.02.2011 00:28, David C. Rankin wrote: the check into the PKGBUILD itself, as an bash command which is performed when you call it, like rm /etc/X11/sessions/trinity.desktop (in your case good), rm -rf * (bad), rm -rf / (fun :)) As you can see, this is potentially dangerous and this is why you always should check your PKGBUILDs before. But in a nutshell, a PKGBUILD is little more than a shellscript and you can do basically everything you can perform with a shell.
That wouldn't work with installing binaries though, since the check is done before the PKGBUILD is ever sourced.
participants (6)
-
David C. Rankin
-
Gaetan Bisson
-
Isaac Dupree
-
Magnus Therning
-
Ng Oon-Ee
-
Sebastian Rust