You are not logged in.
Is there an easy way to manipulate repos inside /etc/pacman.conf without manually editing the file ? Should I just use sed and friends and make myself a script ?
Last edited by buttcake (2017-05-20 16:10:02)
Offline
Include = /etc/pacman.d/custompacconf --repo=foo --repo=bar (...) > /etc/pacman.d/customMods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
Offline
Ohh, sorry for not being more explicit. I was thinking more along the lines of adding and deleting unnoficial repos.
Offline
"without manually editing the file"
Full stop. If something changed pacman.conf automatically, I would be pretty unhappy.
Offline
"If something changed pacman.conf automatically, I would be pretty unhappy.
Copy that.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
Ohh, sorry for not being more explicit. I was thinking more along the lines of adding and deleting unnoficial repos.
Put all of them in some separate file you point pacconf to, then redirect the output to the include file. But this sounds like an xy problem, so tell us why you're actually trying to do this.
Last edited by Alad (2017-05-18 19:48:18)
Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
Offline
Definitely an XY Problem. Why is "manually editting" a file of 1-2 dozen lines a problem? Instead of just opening it in $EDITOR, you'd rather write some script to edit it for you? Why??
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I'm trying to make a post install script which I can run to configure and install most of the stuff I use on a daily basis.
I need vim-tiny from the herecura repo and qt development packages from kde-unstable so at the end I'd have to have [kde-unstable],[herecura-testing],[testing],[herecura],[core],[extra],[community-testing] and [community] enabled in that order.
Offline
So just copy a pacman.conf over to the new system. Or use a heredocument and just overwrite the existing conf.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Yeah but pacman.conf defaults change over time don't they ? Wouldn't it be safer to automatically modify a new one instead of overwriting with an old copy ?
Offline
They usually do not change. Here is the history: https://git.archlinux.org/svntogit/pack … ges/pacman
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
You could use awk to delete 3 (or comment 2) lines every time it finds a line beginning with [ (to remove all existing active repos) and then append your repo list to the end of the file.
Last edited by Slithery (2017-05-20 12:18:21)
Offline
Or just delete all repos, and add back whatever you want in watever order
sed -i '/^\[c/,$d' /etc/pacman.conf
cat <<EOF >> /etc/pacman.conf
[myrepo1]
Server = https://whate.ver/repo
[core]
Include = ...
EOF"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
What other option could you possibly be looking for other than having scripts to add or remove lines from the file? And if you know that answer, then problem solves ![]()
Offline
Sorry for making this confusing for everyone. I was just wondering if there's a streamlined tool or an option available in one of the tools available for arch. I will go the sed way, probably the way Trilby suggested. Thank you for the help.
Offline
Yes, there is... as I indicated already in post #2/6. But nothing prevents you from taking the hard way. ![]()
Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
Offline