mirror of
https://github.com/Jguer/yay
synced 2024-08-31 05:39:29 +00:00
test(news): add tests for news package
This commit is contained in:
parent
2cc72685ad
commit
37372c883f
20
cmd.go
20
cmd.go
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
alpm "github.com/Jguer/go-alpm"
|
||||
"github.com/leonelquinteros/gotext"
|
||||
|
@ -195,6 +196,23 @@ func handleVersion() {
|
|||
fmt.Printf("yay v%s - libalpm v%s\n", yayVersion, alpm.Version())
|
||||
}
|
||||
|
||||
func lastBuildTime(alpmHandle *alpm.Handle) time.Time {
|
||||
pkgs, _, _, _, err := query.FilterPackages(alpmHandle)
|
||||
if err != nil {
|
||||
return time.Now()
|
||||
}
|
||||
|
||||
var lastTime time.Time
|
||||
for _, pkg := range pkgs {
|
||||
thisTime := pkg.BuildDate()
|
||||
if thisTime.After(lastTime) {
|
||||
lastTime = thisTime
|
||||
}
|
||||
}
|
||||
|
||||
return lastTime
|
||||
}
|
||||
|
||||
func handlePrint(cmdArgs *settings.Arguments, alpmHandle *alpm.Handle) (err error) {
|
||||
switch {
|
||||
case cmdArgs.ExistsArg("d", "defaultconfig"):
|
||||
|
@ -208,7 +226,7 @@ func handlePrint(cmdArgs *settings.Arguments, alpmHandle *alpm.Handle) (err erro
|
|||
case cmdArgs.ExistsArg("w", "news"):
|
||||
double := cmdArgs.ExistsDouble("w", "news")
|
||||
quiet := cmdArgs.ExistsArg("q", "quiet")
|
||||
err = news.PrintNewsFeed(alpmHandle, config.SortMode, double, quiet)
|
||||
err = news.PrintNewsFeed(lastBuildTime(alpmHandle), config.SortMode, double, quiet)
|
||||
case cmdArgs.ExistsDouble("c", "complete"):
|
||||
err = completion.Show(alpmHandle, config.AURURL, config.Runtime.CompletionPath, config.CompletionInterval, true)
|
||||
case cmdArgs.ExistsArg("c", "complete"):
|
||||
|
|
11
pkg/news/.snapshots/TestPrintNewsFeed-all-quiet
Normal file
11
pkg/news/.snapshots/TestPrintNewsFeed-all-quiet
Normal file
|
@ -0,0 +1,11 @@
|
|||
[1m[35m2019-12-20[0m[0m [1mXorg cleanup requires manual intervention[0m
|
||||
[1m[35m2020-01-04[0m[0m [1mNow using Zstandard instead of xz for package compression[0m
|
||||
[1m[35m2020-01-15[0m[0m [1mrsync compatibility[0m
|
||||
[1m[35m2020-02-17[0m[0m [1msshd needs restarting after upgrading to openssh-8.2p1[0m
|
||||
[1m[35m2020-02-22[0m[0m [1mPlanet Arch Linux migration[0m
|
||||
[1m[35m2020-02-24[0m[0m [1mThe Future of the Arch Linux Project Leader[0m
|
||||
[1m[35m2020-03-01[0m[0m [1mfirewalld>=0.8.1-2 update requires manual intervention[0m
|
||||
[1m[35m2020-03-19[0m[0m [1mhplip 3.20.3-2 update requires manual intervention[0m
|
||||
[1m[35m2020-04-13[0m[0m [1mnss>=3.51.1-1 and lib32-nss>=3.51.1-1 updates require manual intervention[0m
|
||||
[1m[35m2020-04-14[0m[0m [1mzn_poly 0.9.2-2 update requires manual intervention[0m
|
||||
|
114
pkg/news/.snapshots/TestPrintNewsFeed-all-verbose
Normal file
114
pkg/news/.snapshots/TestPrintNewsFeed-all-verbose
Normal file
|
@ -0,0 +1,114 @@
|
|||
[1m[35m2019-12-20[0m[0m [1mXorg cleanup requires manual intervention[0m
|
||||
In the process of Xorg cleanup the update requires manual
|
||||
intervention when you hit this message:
|
||||
|
||||
[36m:: installing xorgproto (2019.2-2) breaks dependency 'inputproto' required by lib32-libxi
|
||||
:: installing xorgproto (2019.2-2) breaks dependency 'dmxproto' required by libdmx
|
||||
:: installing xorgproto (2019.2-2) breaks dependency 'xf86dgaproto' required by libxxf86dga
|
||||
:: installing xorgproto (2019.2-2) breaks dependency 'xf86miscproto' required by libxxf86misc
|
||||
[0m
|
||||
when updating, use: [36mpacman -Rdd libdmx libxxf86dga libxxf86misc && pacman -Syu[0m to perform the upgrade.
|
||||
[0m
|
||||
[1m[35m2020-01-04[0m[0m [1mNow using Zstandard instead of xz for package compression[0m
|
||||
As announced on the mailing list, on Friday, Dec 27 2019, our package compression scheme has changed from xz (.pkg.tar.xz) to zstd (.pkg.tar.zst).
|
||||
|
||||
zstd and xz trade blows in their compression ratio. Recompressing all packages to zstd with our options yields a total ~0.8% increase in package size on all of our packages combined, but the decompression time for all packages saw a ~1300% speedup.
|
||||
|
||||
We already have more than 545 zstd-compressed packages in our repositories, and as packages get updated more will keep rolling in. We have not found any user-facing issues as of yet, so things appear to be working.
|
||||
|
||||
As a packager, you will automatically start building .pkg.tar.zst packages if you are using the latest version of devtools (>= 20191227).
|
||||
As an end-user no manual intervention is required, assuming that you have read and followed the news post from late last year.
|
||||
|
||||
If you nevertheless haven't updated libarchive since 2018, all hope is not lost! Binary builds of pacman-static are available from Eli Schwartz' personal repository (or direct link to binary), signed with their Trusted User keys, with which you can perform the update.
|
||||
[0m
|
||||
[1m[35m2020-01-15[0m[0m [1mrsync compatibility[0m
|
||||
Our [36mrsync[0m package was shipped with bundled [36mzlib[0m to provide compatibility
|
||||
with the old-style [36m--compress[0m option up to version 3.1.0. Version 3.1.1 was
|
||||
released on 2014-06-22 and is shipped by all major distributions now.
|
||||
|
||||
So we decided to finally drop the bundled library and ship a package with
|
||||
system [36mzlib[0m. This also fixes security issues, actual ones and in future. Go
|
||||
and blame those running old versions if you encounter errors with [36mrsync
|
||||
3.1.3-3[0m.
|
||||
[0m
|
||||
[1m[35m2020-02-17[0m[0m [1msshd needs restarting after upgrading to openssh-8.2p1[0m
|
||||
After upgrading to openssh-8.2p1, the existing SSH daemon will be unable to accept new connections. (See FS#65517.) When upgrading remote hosts, please make sure to restart the SSH daemon using [36msystemctl restart sshd[0m right after running [36mpacman -Syu[0m. If you are upgrading to openssh-8.2p1-3 or higher, this restart will happen automatically.
|
||||
[0m
|
||||
[1m[35m2020-02-22[0m[0m [1mPlanet Arch Linux migration[0m
|
||||
The software behind planet.archlinux.org was implemented in Python 2 and is no longer maintained upstream. This functionality has now been implemented in archlinux.org's archweb backend which is actively maintained but offers a slightly different experience.
|
||||
|
||||
The most notable changes are the offered feeds and the feed location. Archweb only offers an Atom feed which is located at here.
|
||||
[0m
|
||||
[1m[35m2020-02-24[0m[0m [1mThe Future of the Arch Linux Project Leader[0m
|
||||
Hello everyone,
|
||||
|
||||
Some of you may know me from the days when I was much more involved in Arch, but most of you probably just know me as a name on the website. I’ve been with Arch for some time, taking the leadership of this beast over from Judd back in 2007. But, as these things often go, my involvement has slid down to minimal levels over time. It’s high time that changes.
|
||||
|
||||
Arch Linux needs involved leadership to make hard decisions and direct the project where it needs to go. And I am not in a position to do this.
|
||||
|
||||
In a team effort, the Arch Linux staff devised a new process for determining future leaders. From now on, leaders will be elected by the staff for a term length of two years. Details of this new process can be found here
|
||||
|
||||
In the first official vote with Levente Polyak (anthraxx), Gaetan Bisson (vesath), Giancarlo Razzolini (grazzolini), and Sven-Hendrik Haase (svenstaro) as candidates, and through 58 verified votes, a winner was chosen:
|
||||
|
||||
Levente Polyak (anthraxx) will be taking over the reins of this ship. Congratulations!
|
||||
|
||||
Thanks for everything over all these years,
|
||||
Aaron Griffin (phrakture)
|
||||
[0m
|
||||
[1m[35m2020-03-01[0m[0m [1mfirewalld>=0.8.1-2 update requires manual intervention[0m
|
||||
The firewalld package prior to version 0.8.1-2 was missing the compiled python modules. This has been fixed in 0.8.1-2, so the upgrade will need to overwrite the untracked pyc files created. If you get errors like these
|
||||
|
||||
[36mfirewalld: /usr/lib/python3.8/site-packages/firewall/__pycache__/__init__.cpython-38.pyc exists in filesystem
|
||||
firewalld: /usr/lib/python3.8/site-packages/firewall/__pycache__/client.cpython-38.pyc exists in filesystem
|
||||
firewalld: /usr/lib/python3.8/site-packages/firewall/__pycache__/dbus_utils.cpython-38.pyc exists in filesystem
|
||||
...many more...
|
||||
[0m
|
||||
when updating, use
|
||||
|
||||
[36mpacman -Suy --overwrite /usr/lib/python3.8/site-packages/firewall/\*
|
||||
[0m
|
||||
to perform the upgrade.
|
||||
[0m
|
||||
[1m[35m2020-03-19[0m[0m [1mhplip 3.20.3-2 update requires manual intervention[0m
|
||||
The hplip package prior to version 3.20.3-2 was missing the compiled
|
||||
python modules. This has been fixed in 3.20.3-2, so the upgrade will
|
||||
need to overwrite the untracked pyc files that were created. If you get errors
|
||||
such as these
|
||||
|
||||
[36mhplip: /usr/share/hplip/base/__pycache__/__init__.cpython-38.pyc exists in filesystem
|
||||
hplip: /usr/share/hplip/base/__pycache__/avahi.cpython-38.pyc exists in filesystem
|
||||
hplip: /usr/share/hplip/base/__pycache__/codes.cpython-38.pyc exists in filesystem
|
||||
...many more...
|
||||
[0m
|
||||
when updating, use
|
||||
|
||||
[36mpacman -Suy --overwrite /usr/share/hplip/\*
|
||||
[0m
|
||||
to perform the upgrade.
|
||||
[0m
|
||||
[1m[35m2020-04-13[0m[0m [1mnss>=3.51.1-1 and lib32-nss>=3.51.1-1 updates require manual intervention[0m
|
||||
The nss and lib32-nss packages prior to version 3.51.1-1 were missing a soname link each. This has been fixed in 3.51.1-1, so the upgrade will need to overwrite the untracked files created by ldconfig. If you get any of these errors
|
||||
|
||||
[36mnss: /usr/lib/p11-kit-trust.so exists in filesystem
|
||||
lib32-nss: /usr/lib32/p11-kit-trust.so exists in filesystem
|
||||
[0m
|
||||
when updating, use
|
||||
|
||||
[36mpacman -Syu --overwrite /usr/lib\*/p11-kit-trust.so
|
||||
[0m
|
||||
to perform the upgrade.
|
||||
[0m
|
||||
[1m[35m2020-04-14[0m[0m [1mzn_poly 0.9.2-2 update requires manual intervention[0m
|
||||
The zn_poly package prior to version 0.9.2-2 was missing a soname link.
|
||||
This has been fixed in 0.9.2-2, so the upgrade will need to overwrite the
|
||||
untracked files created by ldconfig. If you get an error
|
||||
|
||||
[36mzn_poly: /usr/lib/libzn_poly-0.9.so exists in filesystem
|
||||
[0m
|
||||
when updating, use
|
||||
|
||||
[36mpacman -Syu --overwrite usr/lib/libzn_poly-0.9.so
|
||||
[0m
|
||||
to perform the upgrade.
|
||||
[0m
|
||||
|
3
pkg/news/.snapshots/TestPrintNewsFeed-latest-quiet
Normal file
3
pkg/news/.snapshots/TestPrintNewsFeed-latest-quiet
Normal file
|
@ -0,0 +1,3 @@
|
|||
[1m[35m2020-04-13[0m[0m [1mnss>=3.51.1-1 and lib32-nss>=3.51.1-1 updates require manual intervention[0m
|
||||
[1m[35m2020-04-14[0m[0m [1mzn_poly 0.9.2-2 update requires manual intervention[0m
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
[1m[35m2020-04-14[0m[0m [1mzn_poly 0.9.2-2 update requires manual intervention[0m
|
||||
[1m[35m2020-04-13[0m[0m [1mnss>=3.51.1-1 and lib32-nss>=3.51.1-1 updates require manual intervention[0m
|
||||
|
|
@ -11,9 +11,6 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Jguer/go-alpm"
|
||||
|
||||
"github.com/Jguer/yay/v10/pkg/query"
|
||||
"github.com/Jguer/yay/v10/pkg/settings"
|
||||
"github.com/Jguer/yay/v10/pkg/text"
|
||||
)
|
||||
|
@ -62,7 +59,7 @@ type rss struct {
|
|||
Channel channel `xml:"channel"`
|
||||
}
|
||||
|
||||
func PrintNewsFeed(alpmHandle *alpm.Handle, sortMode int, double, quiet bool) error {
|
||||
func PrintNewsFeed(cutOffDate time.Time, sortMode int, all, quiet bool) error {
|
||||
resp, err := http.Get("https://archlinux.org/feeds/news")
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -82,42 +79,19 @@ func PrintNewsFeed(alpmHandle *alpm.Handle, sortMode int, double, quiet bool) er
|
|||
return err
|
||||
}
|
||||
|
||||
buildTime, err := lastBuildTime(alpmHandle)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if sortMode == settings.BottomUp {
|
||||
for i := len(rssGot.Channel.Items) - 1; i >= 0; i-- {
|
||||
rssGot.Channel.Items[i].print(buildTime, double, quiet)
|
||||
rssGot.Channel.Items[i].print(cutOffDate, all, quiet)
|
||||
}
|
||||
} else {
|
||||
for i := 0; i < len(rssGot.Channel.Items); i++ {
|
||||
rssGot.Channel.Items[i].print(buildTime, double, quiet)
|
||||
rssGot.Channel.Items[i].print(cutOffDate, all, quiet)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func lastBuildTime(alpmHandle *alpm.Handle) (time.Time, error) {
|
||||
var lastTime time.Time
|
||||
|
||||
pkgs, _, _, _, err := query.FilterPackages(alpmHandle)
|
||||
if err != nil {
|
||||
return lastTime, err
|
||||
}
|
||||
|
||||
for _, pkg := range pkgs {
|
||||
thisTime := pkg.BuildDate()
|
||||
if thisTime.After(lastTime) {
|
||||
lastTime = thisTime
|
||||
}
|
||||
}
|
||||
|
||||
return lastTime, nil
|
||||
}
|
||||
|
||||
// Crude html parsing, good enough for the arch news
|
||||
// This is only displayed in the terminal so there should be no security
|
||||
// concerns
|
||||
|
|
122
pkg/news/news_test.go
Normal file
122
pkg/news/news_test.go
Normal file
|
@ -0,0 +1,122 @@
|
|||
package news
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/bradleyjkemp/cupaloy"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"gopkg.in/h2non/gock.v1"
|
||||
)
|
||||
|
||||
const sampleNews = `<?xml version="1.0" encoding="utf-8"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Arch Linux: Recent news updates</title><link>https://www.archlinux.org/news/</link><description>The latest and greatest news from the Arch Linux distribution.</description><atom:link href="https://www.archlinux.org/feeds/news/" rel="self"></atom:link><language>en-us</language><lastBuildDate>Tue, 14 Apr 2020 16:30:32 +0000</lastBuildDate><item><title>zn_poly 0.9.2-2 update requires manual intervention</title><link>https://www.archlinux.org/news/zn_poly-092-2-update-requires-manual-intervention/</link><description><p>The zn_poly package prior to version 0.9.2-2 was missing a soname link.
|
||||
This has been fixed in 0.9.2-2, so the upgrade will need to overwrite the
|
||||
untracked files created by ldconfig. If you get an error</p>
|
||||
<pre><code>zn_poly: /usr/lib/libzn_poly-0.9.so exists in filesystem
|
||||
</code></pre>
|
||||
<p>when updating, use</p>
|
||||
<pre><code>pacman -Syu --overwrite usr/lib/libzn_poly-0.9.so
|
||||
</code></pre>
|
||||
<p>to perform the upgrade.</p></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Antonio Rojas</dc:creator><pubDate>Tue, 14 Apr 2020 16:30:30 +0000</pubDate><guid isPermaLink="false">tag:www.archlinux.org,2020-04-14:/news/zn_poly-092-2-update-requires-manual-intervention/</guid></item><item><title>nss>=3.51.1-1 and lib32-nss>=3.51.1-1 updates require manual intervention</title><link>https://www.archlinux.org/news/nss3511-1-and-lib32-nss3511-1-updates-require-manual-intervention/</link><description><p>The nss and lib32-nss packages prior to version 3.51.1-1 were missing a soname link each. This has been fixed in 3.51.1-1, so the upgrade will need to overwrite the untracked files created by ldconfig. If you get any of these errors</p>
|
||||
<pre><code>nss: /usr/lib/p11-kit-trust.so exists in filesystem
|
||||
lib32-nss: /usr/lib32/p11-kit-trust.so exists in filesystem
|
||||
</code></pre>
|
||||
<p>when updating, use</p>
|
||||
<pre><code>pacman -Syu --overwrite /usr/lib\*/p11-kit-trust.so
|
||||
</code></pre>
|
||||
<p>to perform the upgrade.</p></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jan Alexander Steffens</dc:creator><pubDate>Mon, 13 Apr 2020 00:35:58 +0000</pubDate><guid isPermaLink="false">tag:www.archlinux.org,2020-04-13:/news/nss3511-1-and-lib32-nss3511-1-updates-require-manual-intervention/</guid></item><item><title>hplip 3.20.3-2 update requires manual intervention</title><link>https://www.archlinux.org/news/hplip-3203-2-update-requires-manual-intervention/</link><description><p>The hplip package prior to version 3.20.3-2 was missing the compiled
|
||||
python modules. This has been fixed in 3.20.3-2, so the upgrade will
|
||||
need to overwrite the untracked pyc files that were created. If you get errors
|
||||
such as these</p>
|
||||
<pre><code>hplip: /usr/share/hplip/base/__pycache__/__init__.cpython-38.pyc exists in filesystem
|
||||
hplip: /usr/share/hplip/base/__pycache__/avahi.cpython-38.pyc exists in filesystem
|
||||
hplip: /usr/share/hplip/base/__pycache__/codes.cpython-38.pyc exists in filesystem
|
||||
...many more...
|
||||
</code></pre>
|
||||
<p>when updating, use</p>
|
||||
<pre><code>pacman -Suy --overwrite /usr/share/hplip/\*
|
||||
</code></pre>
|
||||
<p>to perform the upgrade.</p></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Andreas Radke</dc:creator><pubDate>Thu, 19 Mar 2020 06:53:30 +0000</pubDate><guid isPermaLink="false">tag:www.archlinux.org,2020-03-19:/news/hplip-3203-2-update-requires-manual-intervention/</guid></item><item><title>firewalld>=0.8.1-2 update requires manual intervention</title><link>https://www.archlinux.org/news/firewalld081-2-update-requires-manual-intervention/</link><description><p>The firewalld package prior to version 0.8.1-2 was missing the compiled python modules. This has been fixed in 0.8.1-2, so the upgrade will need to overwrite the untracked pyc files created. If you get errors like these</p>
|
||||
<pre><code>firewalld: /usr/lib/python3.8/site-packages/firewall/__pycache__/__init__.cpython-38.pyc exists in filesystem
|
||||
firewalld: /usr/lib/python3.8/site-packages/firewall/__pycache__/client.cpython-38.pyc exists in filesystem
|
||||
firewalld: /usr/lib/python3.8/site-packages/firewall/__pycache__/dbus_utils.cpython-38.pyc exists in filesystem
|
||||
...many more...
|
||||
</code></pre>
|
||||
<p>when updating, use</p>
|
||||
<pre><code>pacman -Suy --overwrite /usr/lib/python3.8/site-packages/firewall/\*
|
||||
</code></pre>
|
||||
<p>to perform the upgrade.</p></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jan Alexander Steffens</dc:creator><pubDate>Sun, 01 Mar 2020 16:36:48 +0000</pubDate><guid isPermaLink="false">tag:www.archlinux.org,2020-03-01:/news/firewalld081-2-update-requires-manual-intervention/</guid></item><item><title>The Future of the Arch Linux Project Leader</title><link>https://www.archlinux.org/news/the-future-of-the-arch-linux-project-leader/</link><description><p>Hello everyone,</p>
|
||||
<p>Some of you may know me from the days when I was much more involved in Arch, but most of you probably just know me as a name on the website. I’ve been with Arch for some time, taking the leadership of this beast over from Judd back in 2007. But, as these things often go, my involvement has slid down to minimal levels over time. It’s high time that changes.</p>
|
||||
<p>Arch Linux needs involved leadership to make hard decisions and direct the project where it needs to go. And I am not in a position to do this.</p>
|
||||
<p>In a team effort, the Arch Linux staff devised a new process for determining future leaders. From now on, leaders will be elected by the staff for a term length of two years. Details of this new process can be found <a href="https://wiki.archlinux.org/index.php/DeveloperWiki:Project_Leader">here</a></p>
|
||||
<p>In the first official vote with Levente Polyak (anthraxx), Gaetan Bisson (vesath), Giancarlo Razzolini (grazzolini), and Sven-Hendrik Haase (svenstaro) as candidates, and through 58 verified votes, a winner was chosen:</p>
|
||||
<p><strong>Levente Polyak (anthraxx) will be taking over the reins of this ship. Congratulations!</strong></p>
|
||||
<p><em>Thanks for everything over all these years,<br />
|
||||
Aaron Griffin (phrakture)</em></p></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Aaron Griffin</dc:creator><pubDate>Mon, 24 Feb 2020 15:56:28 +0000</pubDate><guid isPermaLink="false">tag:www.archlinux.org,2020-02-24:/news/the-future-of-the-arch-linux-project-leader/</guid></item><item><title>Planet Arch Linux migration</title><link>https://www.archlinux.org/news/planet-arch-linux-migration/</link><description><p>The software behind planet.archlinux.org was implemented in Python 2 and is no longer maintained upstream. This functionality has now been implemented in archlinux.org's archweb backend which is actively maintained but offers a slightly different experience.</p>
|
||||
<p>The most notable changes are the offered feeds and the feed location. Archweb only offers an Atom feed which is located at <a href="https://archlinux.org/feeds/planet">here</a>.</p></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jelle van der Waa</dc:creator><pubDate>Sat, 22 Feb 2020 22:43:00 +0000</pubDate><guid isPermaLink="false">tag:www.archlinux.org,2020-02-22:/news/planet-arch-linux-migration/</guid></item><item><title>sshd needs restarting after upgrading to openssh-8.2p1</title><link>https://www.archlinux.org/news/sshd-needs-restarting-after-upgrading-to-openssh-82p1/</link><description><p>After upgrading to openssh-8.2p1, the existing SSH daemon will be unable to accept new connections. (See <a href="https://bugs.archlinux.org/task/65517">FS#65517</a>.) When upgrading remote hosts, please make sure to restart the SSH daemon using <code>systemctl restart sshd</code> right after running <code>pacman -Syu</code>. If you are upgrading to openssh-8.2p1-3 or higher, this restart will happen automatically.</p></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Gaetan Bisson</dc:creator><pubDate>Mon, 17 Feb 2020 01:35:04 +0000</pubDate><guid isPermaLink="false">tag:www.archlinux.org,2020-02-17:/news/sshd-needs-restarting-after-upgrading-to-openssh-82p1/</guid></item><item><title>rsync compatibility</title><link>https://www.archlinux.org/news/rsync-compatibility/</link><description><p>Our <code>rsync</code> package was shipped with bundled <code>zlib</code> to provide compatibility
|
||||
with the old-style <code>--compress</code> option up to version 3.1.0. Version 3.1.1 was
|
||||
released on 2014-06-22 and is shipped by all major distributions now.</p>
|
||||
<p>So we decided to finally drop the bundled library and ship a package with
|
||||
system <code>zlib</code>. This also fixes security issues, actual ones and in future. Go
|
||||
and blame those running old versions if you encounter errors with <code>rsync
|
||||
3.1.3-3</code>.</p></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian Hesse</dc:creator><pubDate>Wed, 15 Jan 2020 20:14:43 +0000</pubDate><guid isPermaLink="false">tag:www.archlinux.org,2020-01-15:/news/rsync-compatibility/</guid></item><item><title>Now using Zstandard instead of xz for package compression</title><link>https://www.archlinux.org/news/now-using-zstandard-instead-of-xz-for-package-compression/</link><description><p>As announced on the <a href="https://lists.archlinux.org/pipermail/arch-dev-public/2019-December/029752.html">mailing list</a>, on Friday, Dec 27 2019, our package compression scheme has changed from xz (.pkg.tar.xz) to <a href="https://lists.archlinux.org/pipermail/arch-dev-public/2019-December/029778.html">zstd (.pkg.tar.zst)</a>.</p>
|
||||
<p>zstd and xz trade blows in their compression ratio. Recompressing all packages to zstd with our options yields a total ~0.8% increase in package size on all of our packages combined, but the decompression time for all packages saw a ~1300% speedup.</p>
|
||||
<p>We already have more than 545 zstd-compressed packages in our repositories, and as packages get updated more will keep rolling in. We have not found any user-facing issues as of yet, so things appear to be working.</p>
|
||||
<p>As a packager, you will automatically start building .pkg.tar.zst packages if you are using the latest version of devtools (&gt;= 20191227).<br />
|
||||
As an end-user no manual intervention is required, assuming that you have read and followed the news post <a href="https://www.archlinux.org/news/required-update-to-recent-libarchive/">from late last year</a>.</p>
|
||||
<p>If you nevertheless haven't updated libarchive since 2018, all hope is not lost! Binary builds of pacman-static are available from Eli Schwartz' <a href="https://wiki.archlinux.org/index.php/Unofficial_user_repositories#eschwartz">personal repository</a> (or direct link to <a href="https://pkgbuild.com/~eschwartz/repo/x86_64-extracted/">binary</a>), signed with their Trusted User keys, with which you can perform the update.</p></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robin Broda</dc:creator><pubDate>Sat, 04 Jan 2020 20:35:55 +0000</pubDate><guid isPermaLink="false">tag:www.archlinux.org,2020-01-04:/news/now-using-zstandard-instead-of-xz-for-package-compression/</guid></item><item><title>Xorg cleanup requires manual intervention</title><link>https://www.archlinux.org/news/xorg-cleanup-requires-manual-intervention/</link><description><p>In the process of <a href="https://bugs.archlinux.org/task/64892">Xorg cleanup</a> the update requires manual
|
||||
intervention when you hit this message:</p>
|
||||
<pre><code>:: installing xorgproto (2019.2-2) breaks dependency 'inputproto' required by lib32-libxi
|
||||
:: installing xorgproto (2019.2-2) breaks dependency 'dmxproto' required by libdmx
|
||||
:: installing xorgproto (2019.2-2) breaks dependency 'xf86dgaproto' required by libxxf86dga
|
||||
:: installing xorgproto (2019.2-2) breaks dependency 'xf86miscproto' required by libxxf86misc
|
||||
</code></pre>
|
||||
<p>when updating, use: <code>pacman -Rdd libdmx libxxf86dga libxxf86misc &amp;&amp; pacman -Syu</code> to perform the upgrade.</p></description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Andreas Radke</dc:creator><pubDate>Fri, 20 Dec 2019 13:37:40 +0000</pubDate><guid isPermaLink="false">tag:www.archlinux.org,2019-12-20:/news/xorg-cleanup-requires-manual-intervention/</guid></item></channel></rss>
|
||||
`
|
||||
|
||||
func TestPrintNewsFeed(t *testing.T) {
|
||||
layout := "2006-01-02"
|
||||
str := "2020-04-13"
|
||||
lastNewsTime, _ := time.Parse(layout, str)
|
||||
|
||||
type args struct {
|
||||
cutOffDate time.Time
|
||||
sortMode int
|
||||
all bool
|
||||
quiet bool
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
wantErr bool
|
||||
}{
|
||||
{name: "all-verbose", args: args{cutOffDate: time.Now(), all: true, quiet: false}, wantErr: false},
|
||||
{name: "all-quiet", args: args{cutOffDate: lastNewsTime, all: true, quiet: true}, wantErr: false},
|
||||
{name: "latest-quiet", args: args{cutOffDate: lastNewsTime, all: false, quiet: true}, wantErr: false},
|
||||
{name: "latest-quiet-topdown", args: args{sortMode: 1, cutOffDate: lastNewsTime, all: false, quiet: true}, wantErr: false},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
defer gock.Off()
|
||||
|
||||
gock.New("https://archlinux.org").
|
||||
Get("/feeds/news").
|
||||
Reply(200).
|
||||
BodyString(sampleNews)
|
||||
rescueStdout := os.Stdout
|
||||
r, w, _ := os.Pipe()
|
||||
os.Stdout = w
|
||||
|
||||
err := PrintNewsFeed(tt.args.cutOffDate, tt.args.sortMode, tt.args.all, tt.args.quiet)
|
||||
assert.NoError(t, err)
|
||||
|
||||
w.Close()
|
||||
out, _ := ioutil.ReadAll(r)
|
||||
cupaloy.SnapshotT(t, out)
|
||||
os.Stdout = rescueStdout
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue