Comments (4)
@karjonas thanks for reporting this bug. I am able to reproduce it.
@pbrisbin a fix for this might be relevant to #158 (comment). Right now we are using "manual" approaches with sed
to augment the IgnorePkg
directive. An external tool for updatiing pacman.conf
, similar to pacman-conf
for querying, would be super helpful here. I will look through the docs again to see if anything already exists.
from downgrade.
I googled a bit for the best way to parse an ini file from Bash... There seems to be no standalone coreutil-ish thing we could use, so the options would be to either improve/exted our bespoke handling (possibly copying some StackOverflow monstrosity) or somehow use python
.
I agree if we're going to increase the complexity of our own "parsing", slicing off a distinct executable would be helpful as a new testable/readable boundary -- however, I'd like to slightly tweak my "contribute upstream" suggestion. I didn't realize at the time that pacman-conf
existed (it may not have), hence my suggestion of a new tool in the pacutils
space.
An external tool for updatiing pacman.conf, similar to pacman-conf for querying, would be super helpful here
I feel like, ideally, pacman-conf
should just be that tool -- i.e. contribute "update in place" support to that tool itself. It would probably be prudent to find an email list to ask if they'd be open to such a contribution first, and I'd imagine that tool is in C, which could be a hurdle.
But again, that'd be the ideal "best for the world given unlimited effort" option, and simply improving our current approach in Bash, to solve only this bug in particular, sounds perfectly reasonable.
from downgrade.
Thoughts
I feel like, ideally, pacman-conf should just be that tool
that'd be the ideal "best for the world given unlimited effort" option
That would indeed be the best case scenario. Here is the GitLab repo for pacman
: https://gitlab.archlinux.org/pacman/pacman/
And indeed, pacman-conf
is implemented in C
: https://gitlab.archlinux.org/pacman/pacman/-/blob/master/src/pacman/pacman-conf.c
prudent to find an email list
Yes, we could do that here: https://lists.archlinux.org/listinfo/pacman-dev
I was trying to search the archives for similar discussions but could not find a centralized way of searching: https://lists.archlinux.org/pipermail/pacman-dev/
In any case, it would be nice to get this discussion into the mailing list for feedback
simply improving our current approach in Bash, to solve only this bug in particular, sounds perfectly reasonable.
Agree that this would be a good short-term fix using bash
alone, with the long-term fix being a patch upstream.
(possibly copying some StackOverflow monstrosity)
😆
Ideas
Proposed workflow for solving this issue:
-
We perform a quick fix by modifying our workflow in
downgrade
. One example could be by adding an additional if-block above line 125. In this additional if-block, we could check for the existence of the[options]
header and then augment theIgnorePkg
directive directly below the header:ln="$(grep -n '^ *\[options\]' "$PACMAN_CONF" | cut -d : -f 1)" if [ -n "$ln" ]; then sed -i "$ln s/.*/&\\nIgnorePkg = $pkg/" "$PACMAN_CONF" continue fi printf "IgnorePkg = %s\\n" "$pkg" >>"$PACMAN_CONF"
-
We search the mailing list archives and issues for possible duplicates of this discussion. If there are none, we send out an email to the
pacman-dev
and/orpacman-contrib
(https://lists.archlinux.org/listinfo/pacman-contrib) mailing list requesting for their feedback on a possible patch. The reason I addpacman-contrib
here is that it might be easier (effort and approval-time wise; see several old issues related toIgnorePkg
) to submit a newpacignore
script there rather than overhaulpacman-conf
altogether with "editing" features on top of the existing querying ones. We leave this issue open until we resolve the discussion upstream.
WDYT?
from downgrade.
1- SGTM. I would make sure we get good tests in place, and that we're covering this Issue. Then, the "how" of it is less important to me.
2- Defer to you. I didn't realize pacman-conf
was in pacman
proper, and not also -contrib
. It makes sense it might be easier to get a new thing into -contrib
than a change into pacman
, but it does seem like more of a pacman-conf
responsibility to me so I'd personally try the -dev
ML first and 🤞 they're receptive.
from downgrade.
Related Issues (20)
- fzf as optional dependency HOT 4
- Use `getopts` to handle CLI arguments in lower-level scripts HOT 1
- Packages with a slash in the name cannot be downgraded HOT 4
- Does not handle multile architectures in pacman.conf HOT 2
- v12 roadmap
- Downgrade somehow bricked my entire system HOT 3
- `downgrade-11.2.0-1` does not appear to build with `paru HOT 5
- Downgrade with dependencies HOT 6
- Downgrade system upgrade from pacman log HOT 3
- Option to not ask to add IgnorePkg HOT 1
- Help with cram test function HOT 6
- Should the default config show all options or defaults? HOT 1
- Ability to add a package to ignored regardless of the keyboard layout HOT 3
- downgrade-11.3.0-1 package doesn't include executables HOT 3
- Force Option HOT 7
- Fzf menu keymaps HOT 3
- Add documentation for AUR package downgrading HOT 4
- After some full system update, i got "error while loading shared libraries: libalpm.so.13" HOT 5
- `-- --nodeps` ignored HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from downgrade.