LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation
User Name
Password
Slackware - Installation This forum is for the discussion of installation issues with Slackware.

Notices


Reply
  Search this Thread
Old 01-06-2019, 11:56 AM   #1
mcandre
LQ Newbie
 
Registered: Jun 2009
Posts: 3

Rep: Reputation: 0
bad exit code when slackpkg does not find named packages


slackpkg should return a nonzero exit code when the named packages are unavailable. This helps communicate error information to downstream systems, such as automation scripts and continuous integration servers and Docker builds, so that we can detect problems earlier.
 
Old 01-16-2019, 01:23 AM   #2
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,337

Rep: Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863
Quote:
Originally Posted by mcandre View Post
slackpkg should return a nonzero exit code when the named packages are unavailable. This helps communicate error information to downstream systems, such as automation scripts and continuous integration servers and Docker builds, so that we can detect problems earlier.
Code:
commit c7216fb599374fee9833967e8a18d25e1348c4ba (origin/master)
Author: Robby Workman <rworkman@slackware.com>
Date:   Wed Jan 16 00:15:57 2019 -0600

    Catch errors and return exit status 1 if they occur
    
    Thanks to mcandre on LQ for the suggestion.

diff --git a/files/core-functions.sh b/files/core-functions.sh
index 19eebf3..fa02653 100644
--- a/files/core-functions.sh
+++ b/files/core-functions.sh
@@ -7,8 +7,10 @@
 # Clean-up tmp and lock files
 #
 function cleanup() {
+       local retval=0
        [ "$SPINNING" = "off" ] || tput cnorm
        if [ -e $TMPDIR/error.log ]; then
+               retval=1
                echo -e "         
 \n==============================================================================
 WARNING!        WARNING!        WARNING!        WARNING!        WARNING!
@@ -24,7 +26,7 @@ One or more errors occurred while slackpkg was running:
                rm $CACHEPATH/$NAMEPKG &>/dev/null
        fi              
        ( rm -f /var/lock/slackpkg.$$ && rm -rf $TMPDIR ) &>/dev/null
-       exit
+       exit ${retval}
 }
 trap 'cleanup' 2 14 15                 # trap CTRL+C and kill
 
1 members found this post helpful.
  


Reply

Tags
slackpkg


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
exit(communication error), terminated by calling exit(), return code: 255 miliboy Linux - Newbie 11 02-27-2013 02:51 PM
named does not accept queries but allow-query is {any;} in /etc/named.conf mchait Linux - Server 3 04-12-2010 01:09 AM
(bind) named: couldn't open pid file '/var/run/named/named.pid' - any help? samengr Linux - Server 6 04-01-2009 07:22 AM
file /var/lib/named/var/named/reverse/named.zero failed: file not found Toadman Linux - Software 15 03-18-2009 08:01 PM
chown -R named:named /var/named crash the system? joangopan Fedora 2 09-09-2007 03:46 AM

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

All times are GMT -5. The time now is 05:25 AM.

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