[arch-general] Howto - tell pacman -S (-U) to overwrite existing file in filesystem?

Sebastian Rust harlequix at googlemail.com
Mon Feb 21 15:45:50 EST 2011


-----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:
>>
>> http://www.catb.org/~esr/faqs/smart-questions.html#before
>>
>
> 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-----



More information about the arch-general mailing list