Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decrease deb-get update verbositty #758

Closed
yermulnik opened this issue Feb 14, 2023 · 0 comments · Fixed by #760
Closed

Decrease deb-get update verbositty #758

yermulnik opened this issue Feb 14, 2023 · 0 comments · Fixed by #760

Comments

@yermulnik
Copy link
Contributor

yermulnik commented Feb 14, 2023

Requesting a new feature 🧑‍💻

Apparently since the change in #737 PR deb-get started to output extraneous info to stderr from wget and curl («fetching non-github repo») and to stdout from cd - command (all within update_repos() function) — the output between [+] Updating /etc/deb-get/01-main and [---cut---] lines (which is where starts usual informational output which are not related to this request):

> deb-get update
  [+] Updating /etc/deb-get/01-main
/etc/deb-get/01-main.rep 100%[==================================>]   2,70K  --.-KB/s    in 0s
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  102k  100  102k    0     0   172k      0 --:--:-- --:--:-- --:--:--  172k
/home/giermulnik
[---cut---]

My use case is as simple as this — I want the list of packages pending updates to be emailed to me:

45 9 * * * root deb-get update | fgrep 'has an update pending.'

though I don't want extra output to be emailed every deb-get cron job run. I also would prefer to not redirect stderr to /dev/null or a file as this would hide any potential errors which may occur during cron job run.

Can this output be silenced or enabled on-demand please?

How to fix (or make output optional via e.g. new deb-get update cmdline parameter):

  • Removing --show-progress from wget cmdline prevents it from outputting download progress (this option forces the progress bar to be printed when --quiet/-q option is set)
  • Adding -Ss to curl cmdline prevents it from outputting download progress (while still showing error messages)
  • Replacing cd - with cd ~- prevents cd from outputting extra info about previous directory in stack while chdir'ing into it (UPD: Make update_repos cd quietly #759)

Expected behavior

Actual behavior

New extra output between [+] Updating /etc/deb-get/01-main and [---cut---] lines (which is where starts usual informational output which are not related to this request):

> deb-get update
  [+] Updating /etc/deb-get/01-main
/etc/deb-get/01-main.rep 100%[==================================>]   2,70K  --.-KB/s    in 0s
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  102k  100  102k    0     0   172k      0 --:--:-- --:--:-- --:--:--  172k
/home/giermulnik
[---cut---]

Steps to reproduce

Run the below and find extra output:

deb-get update | 'has an update pending.'

System information

Run the following a paste the output below:

/etc/os-release

> cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

/etc/lsb-release

> cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.5 LTS"

deb-get version

> deb-get version
0.3.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant