From 9e69ff26e29341c8b495ef1c7e3dc4fbb53bee58 Mon Sep 17 00:00:00 2001 From: zador-blood-stained Date: Sat, 18 Jun 2016 13:31:00 +0300 Subject: [PATCH] Update 40-updates MOTD script --- configuration.sh | 8 ++++---- scripts/update-motd.d/40-updates | 12 +++--------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/configuration.sh b/configuration.sh index 9c2d7a04eb..743d6d5d7e 100644 --- a/configuration.sh +++ b/configuration.sh @@ -91,7 +91,7 @@ esac PACKAGE_LIST="automake bash-completion bc bridge-utils build-essential cmake cpufrequtils device-tree-compiler \ dosfstools figlet fbset fping git hostapd ifenslave-2.6 iw libtool libwrap0-dev libssl-dev lirc fake-hwclock \ wpasupplicant libusb-dev libusb-1.0-0-dev psmisc ntp parted pkg-config rsync sudo curl dialog crda wireless-regdb \ - ncurses-term python-apt sysfsutils toilet u-boot-tools unattended-upgrades unzip usbutils wireless-tools libnl-3-dev \ + ncurses-term python3-apt sysfsutils toilet u-boot-tools unattended-upgrades unzip usbutils wireless-tools libnl-3-dev \ console-setup console-data console-common unicode-data openssh-server initramfs-tools ca-certificates" # Non-essential packages @@ -116,12 +116,12 @@ case $RELEASE in ;; jessie) PACKAGE_LIST_RELEASE="less makedev kbd libnl-genl-3-dev libpam-systemd iperf3 \ - software-properties-common python-software-properties libnss-myhostname f2fs-tools libnl-genl-3-dev" + software-properties-common libnss-myhostname f2fs-tools libnl-genl-3-dev" PACKAGE_LIST_DESKTOP="$PACKAGE_LIST_DESKTOP mozo pluma iceweasel libreoffice-writer libreoffice-java-common icedove gvfs policykit-1 policykit-1-gnome eject" ;; - trusty) + trusty) PACKAGE_LIST_RELEASE="man-db wget nano libnl-genl-3-dev software-properties-common iperf \ - python-software-properties f2fs-tools acpid" + f2fs-tools acpid" PACKAGE_LIST_DESKTOP="$PACKAGE_LIST_DESKTOP libreoffice-writer libreoffice-java-common thunderbird firefox gnome-icon-theme-full tango-icon-theme gvfs-backends" PACKAGE_LIST_EXCLUDE="ureadahead plymouth" ;; diff --git a/scripts/update-motd.d/40-updates b/scripts/update-motd.d/40-updates index 9eef5fbb01..20e74e6082 100644 --- a/scripts/update-motd.d/40-updates +++ b/scripts/update-motd.d/40-updates @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # # 40-updates - create the list of packages for update with caching # Copyright (c) 2015 Igor Pecovnik @@ -28,7 +28,6 @@ import os import os.path as path def refreshdata (): - # update procedure DISTRO = subprocess.Popen(["lsb_release", "-c", "-s"], stdout=subprocess.PIPE).communicate()[0].strip() @@ -129,7 +128,7 @@ def refreshdata (): # if the file is older than 2 days -myfile="/var/cache/apt/archives/updates.number" +myfile = os.environ['HOME'] + "/.cache/updates.number" now = time.time() twodays_ago = now - 60*60*24*2 # Number of seconds in two days lastupgrade = os.stat('/var/cache/apt/archives').st_mtime @@ -143,12 +142,7 @@ else: # display if there are some upgrades -file = open(myfile, 'r+') +file = open(myfile, 'r+') updates = int(file.read()) if updates > 0: print("[ \033[92m%d updates to install\033[0m: apt-get upgrade ]\n" % (updates)) - - - - -