LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 08-06-2018, 04:46 PM   #1
moesasji
Member
 
Registered: May 2008
Distribution: Slackware Current / OpenBSD
Posts: 322

Rep: Reputation: 104Reputation: 104
slackpkg on current - how to prevent confirmation dialog?


I'm trying to automate getting slackware current up and running using ansible.

In doing so I am hitting that slackpkg requires me to confirm that I indeed want to use a current mirror on slackware current. The problem here is that current != 14.2+ according to slackpkg, yet /etc/slackware-version reports 14.2+ for current.

Code:
ok: [192.168.1.18] => {
    "out.stdout_lines": [
        "", 
        "You have selected a mirror for Slackware -current in /etc/slackpkg/mirrors,", 
        "but Slackware version 14.2+ appears to be installed.", 
        "", 
        "Slackware -current is the development (i.e. unstable) tree.", 
        "", 
        "Is this really what you want?", 
        "", 
        "To confirm your choice, press Y, else press N. Then, press Enter: "
    ]
}
Any thoughts how I can get around that prompt as the following doesn't do the trick?

Code:
slackpkg -batch=on -default_answer=y update gpg
 
Old 08-07-2018, 10:26 AM   #2
phenixia2003
Senior Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008
Hello,

This patch should do the trick :

Code:
--- core-functions.sh.orig	2018-08-07 17:20:01.144303289 +0200
+++ core-functions.sh	2018-08-07 17:22:24.578309689 +0200
@@ -273,8 +273,10 @@
 Is this really what you want?
 
 To confirm your choice, press Y, else press N. Then, press Enter: "
-		read current
-		if [ "$current" = "Y" ] || [ "$current" = "y" ]; then
+		#read current
+		#if [ "$current" = "Y" ] || [ "$current" = "y" ]; then
+	        answer
+    	        if [ "$ANSWER" = "Y" -o "$ANSWER" = "y" ]; then
 			touch ${ROOT}/${WORKDIR}/current
 			echo -n  "
 Slackpkg will not show this warning again unless you remove the
When applied, you should get this :
Code:
$ slackpkg -batch=on -default_anwser=n update gpg

You have selected a mirror for Slackware -current in /etc/slackpkg/mirrors,
but Slackware version 14.2+ appears to be installed.

Slackware -current is the development (i.e. unstable) tree.

Is this really what you want?

To confirm your choice, press Y, else press N. Then, press Enter: n

$ slackpkg -batch=on -default_anwser=y update gpg

You have selected a mirror for Slackware -current in /etc/slackpkg/mirrors,
but Slackware version 14.2+ appears to be installed.

Slackware -current is the development (i.e. unstable) tree.

Is this really what you want?

To confirm your choice, press Y, else press N. Then, press Enter: y

Slackpkg will not show this warning again unless you remove the
/var/lib/slackpkg/current file. 

			Downloading https://mirrors.slackware.com/slackware/slackware64-current/GPG-KEY...
			Slackware Linux Project's GPG key added
--
SeB
 
1 members found this post helpful.
Old 08-07-2018, 11:24 AM   #3
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,098

Rep: Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175
Quote:
Originally Posted by moesasji View Post
In doing so I am hitting that slackpkg requires me to confirm that I indeed want to use a current mirror on slackware current.
[...]
Any thoughts how I can get around that prompt
you can also run these commands manually and it won't ask the question at all
Code:
mkdir -p ${ROOT}/var/lib/slackpkg
touch ${ROOT}/var/lib/slackpkg/current
because the whole subroutine that does that check must satisfy this condition first
Code:
if [ "$MIRROR_VERSION" = "current" ] && [ ! -f ${ROOT}/${WORKDIR}/current ]; then

Last edited by ponce; 08-07-2018 at 11:34 AM.
 
1 members found this post helpful.
Old 08-08-2018, 12:41 AM   #4
moesasji
Member
 
Registered: May 2008
Distribution: Slackware Current / OpenBSD
Posts: 322

Original Poster
Rep: Reputation: 104Reputation: 104
Thanks for that line of thinking Ponce, as creating the /var/lib/slackpkg/current file does the job. The directory already exists in a clean install, so that step is not needed.
 
  


Reply



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
KDE 4.2 Shutdown without confirmation dialog netimen Linux - Newbie 6 05-24-2009 04:26 PM
Disable execute confirmation dialog? Ken_C Linux - Newbie 5 04-16-2009 06:44 PM
Slackpkg: missing something in /usr/libexec/slackpkg/functions.d/dialog-functions.sh michelino Slackware 4 03-20-2007 12:22 PM
Problems with installation on disc1 (confirmation dialog) NEED HELP!!! SRneXus Fedora 5 02-23-2007 03:51 AM
shutdown - confirmation dialog needed in fluxbox linuxfond Linux - Newbie 0 07-09-2004 07:38 AM

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

All times are GMT -5. The time now is 03:38 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
Open Source Consulting | Domain Registration