LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-08-2016, 03:31 PM   #1
yars
Member
 
Registered: Apr 2012
Location: Russia
Distribution: Slackware64-current
Posts: 242

Rep: Reputation: 24
[ENCHANCEMENT] slackpkg+: do not show the notices "pkglist is older than 24h..." and "remember to re-run 'slackpkg update''..."...


...when slackpkg was invoked with 'check-updates' or 'update' commands.
Hi zerouno!
Here is a patch to do the subject. I think it will be a good idea to not show this notices and do 'touch' the pkglist when all the repos is up-to-date. Please review it:
Code:
commit 0d8a239d2c754c81bb9852953264869a34400e54
Author: Yaroslav Shmelev <yars068@yandex.ru>
Date:   Fri Jan 8 13:53:04 2016 +0300

    Suppress the message about pkglist is older than 24h when slackpkg invoked with 'check-updates' or 'update' commands

diff --git a/src/slackpkgplus.sh b/src/slackpkgplus.sh
index f9dd484..88b0d15 100755
--- a/src/slackpkgplus.sh
+++ b/src/slackpkgplus.sh
@@ -726,17 +726,21 @@ function showlist() {
     fi
   done
 
-  if [ $[$(date +%s)-$(date -d "$(ls -l --full-time $WORKDIR/pkglist 2>/dev/null|awk '{print $6,$7,$8}')" +%s)] -gt 86400 -a "$CMD" != "update" ];then
-    echo
-    echo "NOTICE: pkglist is older than 24h; you are encouraged to re-run 'slackpkg update'"
-    echo
-    sleep 1
+  if [ "$CMD" != "update" -a "$CMD" != "check-updates" ];then
+    if [ $[$(date +%s)-$(date -d "$(ls -l --full-time $WORKDIR/pkglist 2>/dev/null|awk '{print $6,$7,$8}')" +%s)] -gt 86400 ];then
+      echo
+      echo "NOTICE: pkglist is older than 24h; you are encouraged to re-run 'slackpkg update'"
+      echo
+      sleep 1
+    fi
   fi
-  if [ $CONF/slackpkgplus.conf -nt $WORKDIR/pkglist -a "$CMD" != "update" ];then
-    echo
-    echo "NOTICE: remember to re-run 'slackpkg update' after modifying slackpkgplus.conf"
-    echo
-    sleep 5
+  if [ "$CMD" != "update" -a "$CMD" != "check-updates" ];then
+    if [ $CONF/slackpkgplus.conf -nt $WORKDIR/pkglist ];then
+      echo
+      echo "NOTICE: remember to re-run 'slackpkg update' after modifying slackpkgplus.conf"
+      echo
+      sleep 5
+    fi
   fi
 
 
@@ -1374,6 +1378,8 @@ function showlist() {
 		cat ${TMPDIR}/updated-repos.txt > ~/.slackpkg/updated-repos.txt
 	else
 		echo "No news is good news"
+                # Suppress the message about that pkglist is older than 24h 
+                touch $WORKDIR/pkglist
 	fi
 		
 	cleanup
Thanks.
 
Old 01-09-2016, 09:56 AM   #2
yars
Member
 
Registered: Apr 2012
Location: Russia
Distribution: Slackware64-current
Posts: 242

Original Poster
Rep: Reputation: 24
Patch merged to development branch on github. Solved.
 
  


Reply

Tags
slackpkg, slackpkg+, slackware


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 7 12-19-2015 01:03 AM
[SOLVED] slackpkg upgrade-all is not showing "bsd-games-2.13-i486-11.txz" piratesmack Slackware 2 05-16-2010 05:33 PM
[SOLVED] How to recover from "slackpkg remove" followed by "installpkg"? catkin Slackware 5 04-29-2010 10:54 AM
[SOLVED] slackpkg upgrade-all: highlight a package, not showing "currently installed version" GrapefruiTgirl Slackware 17 04-05-2010 12:32 PM
Why is this message after "slackpkg update" ? cola Slackware 3 12-14-2009 01:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration