Comments (26)
I'd take option number 1, only show news released after the last upgrade. I wouldn't ask the user to confirm anything, I'd just show it in the output, e.g.:
$ sudo pikaur -Syu
[…]
:: Starting full system upgrade...
:: Starting full AUR upgrade...
Reading local package database...
Reading repository package databases...
Reading AUR packages info...
:: Repository package will be installed:
python-dateutil 2.7.0-1 -> 2.7.1-1
:: News
2018-02-22 zita-resampler 1.6.0-1 -> 2 update requires manual intervention
- https://www.archlinux.org/news/zita-resampler-160-1-2-update-requires-manual-intervention/
:: Proceed with installation? [Y/n]
:: [v]iew package detail [m]anually select packages
So, just the date, the title and a link (because, if you're using a terminal in a desktop environment, you should be able to click it and open the site without any copy/pasting and/or searching).
Maybe add an option [v]iew package detail [m]anually select packages [r]ead news
or something like that if you want to provide a way to read the whole message within the terminal.
from pikaur.
I would say make it a config option. And if you want to implement it later on a check for .pacnew files would be nice too.
from pikaur.
@Bundy01 Thanks for your input. Unfortunately, I was kind of finished implementing my solution when you brought up your idea.
I don't really like the idea of having a separate tool that wraps around pikaur, because
- this violates pikaur's goal of "minimal dependencies",
- the wrapper does not integrate so nicely into pikaur itself,
- the archnews tool does a lot more than only showing news if there are some, actually parses its own arguments. The program looks like it is quite interactive, which is not really necessary here. Finally,
- archnews has 600 LOC compared to 160 in my solution.
from pikaur.
I have thought about creating this issue myself, as I think it is a good idea.
from pikaur.
i think i need more opinions on designing this feature, there are some interesting aspects of implementing it:
- should the last upgrade date have to be taken into account (ie showing arch news only released after the last upgrade datetime)
- one of alternative approaches could be showing arch news for last month and ask user to confirm what they were read and just save on the disk a file with last read date
- something else?
from pikaur.
Maybe just wrap your call to pacman with pacmatic for this if it is installed.
from pikaur.
but i need only one quite small part from there:
https://github.com/keenerd/pacmatic/blob/master/pacmatic#L114-L145
from pikaur.
i can also guide from where approximately in pikaur such function should be called, but, sorry, i don't have time working on it myself right now
from pikaur.
shouldn't be too hard too implement. just call pacmatic instead of pacman if pacmatic is found in $PATH.
or to use it as intended just call pikaur through pacmatic with export pacman_progam=pikaur
in your bashrc for example. and than run pamatic instead of pikaur.
Displays news before upgrade and does a check for .pacnew files after installation.
http://kmkeen.com/pacmatic/ for more info.
from pikaur.
what can i do here — make pikaur care of PIKAUR_PACMAN_PATH
env var to set executable of pacman, what do you think?
from pikaur.
or it can be done as config option, to be more uniform with already existing functionality
from pikaur.
but still later on it will be nice to implement arch news support in pikaur itself, since it's not quite a lot of code to write (one of project goals is to avoid depending on AUR packages to simplify bootstrapping)
from pikaur.
The news option is a very good idea. I hope she will be in pikaur very soon. Good continuation :)
from pikaur.
I think I'm gonna start working on this one. I'll try to keep the dependencies minimal, which means getting the RSS feed by a socket, some very basic RSS parsing by string manipulation, and caching the last shown news timestamp in $XDG_CACHE_HOME/pikaur/last_seen_news.dat
.
from pikaur.
why not to use xml
lib for rss parsing?
from pikaur.
Didn't know that xml
was part of core python. That makes it easier.
from pikaur.
I made a first commit for the functionality requested here. This isn't final by any means, but rather a suggestion and still quite messy. The integration with your configuration (line max_width for text wrapping, internatiolization) comes later. My code uses only python standard libraries. Feel free to to criticise.
If you run python pikaur/news.py
, it will create ~/.cache/pikaur/last_seen_news.dat
. When you change the year e.g. to 2017, and re-execute, you should be able to see some news entries.
from pikaur.
looks good from the first glance, you were rapid on this!
suggestions to improve:
- use type hints for variables
- use coloring/bold font from pikaur.pprint
from pikaur.
- get initial date (if dat-file not present) from last installed local package from the repo
from pikaur.
- take
max_width
frompikaur.pprint.get_term_width()
from pikaur.
also see pikaur.pprint.format_paragraph
and pikaur.pprint.range_printable
from pikaur.
Will do. All commits will take place in my news branch.
from pikaur.
better open a PR with a [WIP] tag, it's easier to review
from pikaur.
from pikaur.
yup, thanks!
from pikaur.
Hi,
@actionless: I see it's coming. Otherwise I found a script that might match. To modify very slightly: https://github.com/mjiricka/archnews/blob/master/archnews_wrap
What would be nice is to modify the address 'FEED_URL' in the pikaur.conf file, for different languages.
To run this script, I changed 'PACKAGE_MANAGER_FULL_PATH_DEFAULT' to /usr/bin/pikaur, the address'FEED_URL' and created an alias in .bashrc or .zshrc ...
alias pikaur='archnews_wrap' (alias to be modified according to the rewritten script name). Hoping to help with this option and that this script will inspire you :)
from pikaur.
Related Issues (20)
- pikaur fails when pacman doesn't
- pikaur produces errors installing, pressing Enter at the end to reinstall package only works HOT 4
- sudo and pty migration issues HOT 40
- Build Failure: Missing Python Dependency HOT 2
- Error with pty import in pikspect when running 1.16 HOT 2
- os.setuid to original user-id for network requests
- Pikaur prompts for sudo password twice HOT 2
- pikaur hands over `--preserve-env` to non-sudo tool HOT 5
- Unconditional `sudo --preserve-env` breaks preinst/postinst hooks HOT 5
- Request for info: how to deal with "cannot be found in AUR"? HOT 1
- Overriding repo priority per package HOT 3
- Certain messages are unexpectedly indented HOT 2
- pikaur is ignoring $EDITOR HOT 15
- not all user environment variables are bypassed into $EDITOR HOT 3
- Is not used proxy server, passed with all_proxy environment variable
- Pikaur just hangs when synchronizing packages HOT 9
- Build error: TypeError: OptionsDict.__init__() missing 1 required positional argument: 'options' HOT 4
- Compilation error with the version 1.18.3-1 HOT 6
- Compilation error with the version 1.18.3-1 HOT 3
- unexpected build failed after try to update to aur/pikaur 1.18.3-1 HOT 5
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 pikaur.