You are not logged in.

#1 2021-07-15 13:46:27

euphorbia
Member
Registered: 2021-07-15
Posts: 3

--downloadonly redownloads everything

-w, --downloadonly   download packages but do not install/upgrade anything

Seems pretty handy, in fact I need something like this for upgrade automation. Only problem: It doesn't just do what it says in the help. Unlike pacman -Syu, it redownloads everything, ignoring existing packages in cache. That's a huge waste of bandwidth. I only need it to download packages that are not in cache, and then refrain from installing them, so I can install them later. There's no separate flag for that behavior. "Redownload everything" and "download but don't install" are the same flag. Doesn't make sense to me - or am I overlooking something?

Offline

#2 2021-07-15 13:54:07

Scimmia
Fellow
Registered: 2012-09-01
Posts: 8,607

Re: --downloadonly redownloads everything

It doesn't for me. Example?

Offline

#3 2021-07-15 14:14:57

euphorbia
Member
Registered: 2021-07-15
Posts: 3

Re: --downloadonly redownloads everything

Oh, nevermind. It seems this problem only appears when you uncomment the wget line in your pacman.conf, which I had done. It still makes no sense because the wget command I'm using includes the -nc flag, and wget in fact doesn't overwrite the existing files, but it still pointlessly downloads them. I don't understand this either, but I guess it might not be a pacman issue. My bad.

Last edited by euphorbia (2021-07-15 14:16:21)

Offline

#4 2021-07-15 14:35:50

euphorbia
Member
Registered: 2021-07-15
Posts: 3

Re: --downloadonly redownloads everything

Ok I figured out why this happens. The %o variable pacman hands to wget has ".part" built in. That means wget thinks it's downloading a new file, and doesn't recognize the existing file without the ".part".

Edit:

Alright, I had to work around several unhelpful pacman behaviors but I finally got something working.

The -nc flag cannot actually be used because if pacman doesn't find a .part file after invoking wget, it'll time out. So I had to write a wrapper script for wget. This script checks if the file exists without ".part" and if it's in /var/cache/pacman/pkg/ (otherwise .db files will be skipped). If both conditions are met, it will skip download and rename the existing file to have a ".part" suffix, only so that pacman can remove the suffix and doesn't complain. Existing ".part" files will be overwritten.

I needed to use wget in order to be able to utilize its built-in rate-limiting feature.

Last edited by euphorbia (2021-07-15 20:07:09)

Offline

#5 2021-07-16 16:04:40

teckk
Member
Registered: 2013-02-21
Posts: 422

Re: --downloadonly redownloads everything

I needed to use wget in order to be able to utilize its built-in rate-limiting feature

agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0"
url="http://www.something.com"

curl -A "$agent" --limit-rate 200k "$url" -o file.out

wget -U "$agent" --limit-rate=200k "$url" -O file.out

Offline

#6 2021-07-16 16:16:37

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,624
Website

Re: --downloadonly redownloads everything

Why is this stickied?


Fix yo shit: journalctl -b -p warning
My Website (ipv6-only)
"Learning the hard way is the only way for many."
Advaita: Robert Adams, Francis Lucille, Rupert Spira

Offline

#7 2021-07-16 18:27:18

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 10,397
Website

Re: --downloadonly redownloads everything

ugjka wrote:

Why is this stickied?

I'm guessing one of the other mods misclicked.

Mod note: unstickying.

Last edited by WorMzy (2021-07-16 18:27:47)


Sakura:-
Mobo: MSI X299 TOMAHAWK ARCTIC // Processor: Intel Core i7-7820X 3.6GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB