Giter VIP home page Giter VIP logo

Comments (26)

KopfKrieg avatar KopfKrieg commented on May 28, 2024 2

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.

masterodie avatar masterodie commented on May 28, 2024 1

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.

steven-omaha avatar steven-omaha commented on May 28, 2024 1

@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

  1. this violates pikaur's goal of "minimal dependencies",
  2. the wrapper does not integrate so nicely into pikaur itself,
  3. 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,
  4. archnews has 600 LOC compared to 160 in my solution.

from pikaur.

tyilo avatar tyilo commented on May 28, 2024

I have thought about creating this issue myself, as I think it is a good idea.

from pikaur.

actionless avatar actionless commented on May 28, 2024

i think i need more opinions on designing this feature, there are some interesting aspects of implementing it:

  1. should the last upgrade date have to be taken into account (ie showing arch news only released after the last upgrade datetime)
  2. 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
  3. something else?

from pikaur.

masterodie avatar masterodie commented on May 28, 2024

Maybe just wrap your call to pacman with pacmatic for this if it is installed.

from pikaur.

actionless avatar actionless commented on May 28, 2024

but i need only one quite small part from there:
https://github.com/keenerd/pacmatic/blob/master/pacmatic#L114-L145

from pikaur.

actionless avatar actionless commented on May 28, 2024

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.

masterodie avatar masterodie commented on May 28, 2024

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.

actionless avatar actionless commented on May 28, 2024

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.

actionless avatar actionless commented on May 28, 2024

or it can be done as config option, to be more uniform with already existing functionality

from pikaur.

actionless avatar actionless commented on May 28, 2024

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.

Bundy01 avatar Bundy01 commented on May 28, 2024

The news option is a very good idea. I hope she will be in pikaur very soon. Good continuation :)

from pikaur.

steven-omaha avatar steven-omaha commented on May 28, 2024

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.

actionless avatar actionless commented on May 28, 2024

why not to use xml lib for rss parsing?

from pikaur.

steven-omaha avatar steven-omaha commented on May 28, 2024

Didn't know that xml was part of core python. That makes it easier.

from pikaur.

steven-omaha avatar steven-omaha commented on May 28, 2024

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.

actionless avatar actionless commented on May 28, 2024

looks good from the first glance, you were rapid on this!

suggestions to improve:

  1. use type hints for variables
  2. use coloring/bold font from pikaur.pprint

from pikaur.

actionless avatar actionless commented on May 28, 2024
  1. get initial date (if dat-file not present) from last installed local package from the repo

from pikaur.

actionless avatar actionless commented on May 28, 2024
  1. take max_width from pikaur.pprint.get_term_width()

from pikaur.

actionless avatar actionless commented on May 28, 2024

also see pikaur.pprint.format_paragraph and pikaur.pprint.range_printable

from pikaur.

steven-omaha avatar steven-omaha commented on May 28, 2024

Will do. All commits will take place in my news branch.

from pikaur.

actionless avatar actionless commented on May 28, 2024

better open a PR with a [WIP] tag, it's easier to review

from pikaur.

steven-omaha avatar steven-omaha commented on May 28, 2024

Like so?

from pikaur.

actionless avatar actionless commented on May 28, 2024

yup, thanks!

from pikaur.

Bundy01 avatar Bundy01 commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.