[SOLVED] slackware-current+slackpkg: even with DEFAULT_ANSWER=y , This happens .
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
No changes in ChangeLog.txt between your last update and now.
Do you really want to download all other files (y/N)? ^[[?25h^[[?0c
Looking for NEW packages to install. Please wait... DONE
No packages match the pattern for install. Try:"
All I want is for the script(s) to continue & download the other files instead (Why do) I get freaking escape codes , What option am I missing to allow (Which used to work flawlessly with out it) this script to funtcion in an automated manner ?
It "might" be nice to have a tad more Documentation on the slackpkg "[options]" as there isn't any descriptions of what the options do in the man pages , Some aren't even there . Please help .
Hold off till tomorrow all , I may have found the config option I'll know more tomorrow . ie: BATCH=
Tia , JimL
Last edited by babydr; 03-15-2021 at 08:59 PM.
Reason: Re-Scanned the slackpkg.conf file & noticed batch=
Hello All , The script (slackpkg) ran well last night with the "BATCH=on" entered into the slackpkg.conf file .
except Now there's new output relating to .new files .
The slackpkg.conf (prior to adding the BATCH=on) & the update script , did not until moving to the new slackpkg produce any warnings or Errors , I have been running them from 9.1 thru to slackware-current's latest slackpkg update .
The command line is used from a crontab , Incased in a bash script . AND slackpkg.conf .
Which I Tried to attach for your info ... The Manage attachments function is not allowing me to browse for the files .
To NOTE: this is for a "Automated daily update & install new" of slackware-current , Please see the files below after Tia .
# New message after adding 'BATCH=on' to config file ...
"Searching for NEW configuration files
Some packages had new configuration files installed (12 new files):
stty: 'standard input': Inappropriate ioctl for device
/etc/ca-certificates.conf.new
Press SPACE for more, ENTER to skip"
Tia , JimL
# Crontab entry ...
#MIN HOUR DAY MONTH DAYOFWEEK COMMAND
# nightly: slackpkg for updates at 1:20 every day .
20 1 * * * /root/bin/do-slackpkg-for-updates.sh 2>&1
# Below which will produce all the non-defaults (I hope) .
# cat slackpkg.conf | egrep -v '^(#|$|[[:space:]]*$)'
# Tell us what version of slackware/slamd64 we are running
#
echo -en "\n`cat /etc/slackware-version`\n\n"
#
# Update the program database .
#
slackpkg update
#
# Install any NEW programs and update all installed ones .
#
slackpkg -batch=on -default_answer=y install-new
slackpkg -batch=on -default_answer=y upgrade-all
#
# Remove all old packages from the cache .
#
#rm -f /var/cache/packages/*.tgz*
rm -rf /var/cache/packages/*
No changes in ChangeLog.txt between your last update and now.
Do you really want to download all other files (y/N)? ^[[?25h^[[?0c
You shouldn't be seeing those escape codes. Is this a full install? Did you answer "y"?
The "[163/163]" shouldn't be there either.
Quote:
Looking for NEW packages to install. Please wait... DONE
No packages match the pattern for install. Try:"
This look to be from 'slackpkg install-new'. This action will only look in ChangeLog.txt for "Added." pacakges and install them if not already installed.
Quote:
It "might" be nice to have a tad more Documentation on the slackpkg "[options]" as there isn't any descriptions of what the options do in the man pages , Some aren't even there . Please help .
In addition to man slackpkg, there is man slackpkg.conf and the slackpkg.conf is self is loaded with comments on each option.
Last edited by chrisretusn; 03-17-2021 at 05:36 AM.
Hello All , And not to just pick on @chrisretusn , But how many of you actually read the Whole documents that have been posted ? Some of you Must as you'd not reach a level of "Senior Member" .
The response of Yesterday @13:57 from me in response to chrisretusn has not to my sight been noticed .
In there is a Wide Eye opening ...
stty: 'standard input': Inappropriate ioctl for device
Which is also not supposed to be seen .
And TO NOTE: that this is from a Cron AUTOMATED script that was functioning BEFORE the slackpkg-15.0-noarch-3 install on "Feb 15" to my system . Feb 15 was Patch Sunday .
The only change I made was to the slackpkg.conf file by adding "BATCH=on" , Which was already part of the shell script (ie: slackpkg -batch=on -default_answer=y upgrade-all) , Which is just boggling my mind .
I still have not run up against the condition that started this thread which is that there are "No changes in ChangeLog.txt between your last update and now." , In order to see if the present config file & scripting will still produce the "... files (y/N)? ^[[?25h^[[?0c" and skipping BOTH the "-default_answer=y" & "DEFAULT_ANSWER=y" .
Sorry for my TARTness . But I'd not expect so much beating around the bush .
AND I Do THANK ALL who have responed .
I have read your post several times. Until you posted the script, I was not sure what your were getting at. You never answered my questions. You finally mentioned the version of slackpkg you are using in the post above.
I don't have a fix for your issues. I don't see what you are seeing. I tried what you are doing, I don't see those things you are seeing. I suspect you are missing something in slackware -current; which is why I asked if this is a full install.
You script does not include 'slackpkg clean-system', unless you are running that separately from the script. Not running this "clean-system" will leave packages that have been removed on your system that have been removed from slackware -current. This could cause issues. To be picky, your script does not need the "rm -rf /var/cache/packages/*", your have "DELALL=on" in slackpkg.conf, so those files should be deleted after the update is compete.
I mentioned that automating the updating of slackware -current is not a good idea because there have been a lot of things changes and comments on the ChangeLog.txt that need to be read before updating. Perhaps you are doing this. Then good. That said I still think automated upgraded to current is not a good idea. Kind of hard to pin point an issue if several updates have gone by. That is my opinion, take it or leave it, it is your system, do as you want.
slackpkg 2.83.0 was upgraded to 15.0 on Mon Feb 8 05:13:26 UTC 2021 here is that ChangeLog.txt entry:
Code:
ap/slackpkg-15.0-noarch-1.txz: Upgraded.
These are some of the important changes (see the ChangeLog for more):
Note that this slackpkg release contains a backwards-incompatible change to
the blacklisting syntax (e.g. glibc ---> glibc-*). This changes the prior
behavior of the blacklist function; previously, adding "glibc" to the
blacklist would cause glibc, glibc-profile, glibc-zoneinfo, et al to be
ignored by slackpkg. The new behavior is that *only* the glibc package is
ignored. If you want to blacklist all packages whose names begin with glibc,
you would need to add "glibc.*" to the blacklist now. Also note that any
special characters, e.g. "+", will need to be escaped in the blacklist file.
To blacklist entire package sets, a trailing slash is now required: e.g. kde/
Another backwards-incompatibility warning: check-updates will now return 1 if
there are updates available - this will make it easier to use this feature
with cron (thanks to Peter Hyman).
Added support for Slackware-AArch64 (thanks to Stuart Winter).
Added aaa_glibc-solibs and aaa_libraries to the "do these first" routine.
Thanks to Robby Workman for the new slackpkg release!
I am currently running your script on one of my test machines, that is a bit behind in updates, I am logging it to see if any of your issues come up.
Last edited by chrisretusn; 03-17-2021 at 09:43 PM.
stty: 'standard input': Inappropriate ioctl for device
There is now 'stty size' in /usr/libexec/slackpkg/functions.d/post-functions.sh checking the size of the terminal, but your input is not connected to the terminal when running from cron.
@chrisretusn , Thank you , For your insights & comments .
Now to answer the one remaining question ...
YES this was a FULL install WELL BEFORE the change to slackpkg .
I had not noticed the additional command of "clean-system"
I do notice that the manpage says ,
"This action removes all of the packages that don't belong to a standard Slackware installation. With this option, you can clean up your system, removing third-party packages as well as any packages that were removed from the official Slackware package set.
If you have some third party (or custom built) packages that you would like to keep, you can temporarily add them to the list of blacklisted packages before you run the 'clean-system' action."
So OUCH , If one adds "third party" pkgs . Which I do , Regularly .
I had read the Change.log for slackpkg & at the time I read it there were no changes that should have effected the configuration nor the script as presently executing . And at this moment with the config as posted there is none of the cavaets that should create either of my posted Warnings or Errors .
Fyi , I did post all the requested information , Except the FULL install method , Now corrected above , In my note dated "2021-03-16 13:57" , But your response only mentions the partial details from the first message of "2021-03-15 17:54" . Which lead to further confusion on my part as too why the updated information as requested was not being discussed in Your Conversation dated "Yesterday 00:13" (ie: 2021-03-17 00:13) .
Again I apologise for my tirade .
@"Petri Kaukasoina" , My biggest question concerning the 'stty size' , Is why is it being run even if the scripting above it are being run in headless Cron ? The running from cron is relatively easy to determine during execution . Not asking of you why this is so Hoping that the maintainers will !-)
@"Slackpkg Maintainers" , I Hoping that there will be a '-n' option to slackpkg to show what would be done but NOT actually doing it . Just to verify what I doing won't lose some package I am interested in . Because at this moment there isn't such an option . Thank you for this tool and all the work done maintaining it , For it has until recently been without issues through out many versions of Slackware .
@chrisretusn , Thank you , For your insights & comments .
Now to answer the one remaining question ...
YES this was a FULL install WELL BEFORE the change to slackpkg .
I had not noticed the additional command of "clean-system"
I do notice that the manpage says ,
"This action removes all of the packages that don't belong to a standard Slackware installation. With this option, you can clean up your system, removing third-party packages as well as any packages that were removed from the official Slackware package set.
If you have some third party (or custom built) packages that you would like to keep, you can temporarily add them to the list of blacklisted packages before you run the 'clean-system' action."
So OUCH , If one adds "third party" pkgs . Which I do , Regularly .
Add those third party packages to /etc/slackpkg/blacklist and leave them there. I does not have to be temporarily. This is my blacklist.
Code:
#### My stuff starts here.
kernel-generic
kernel-huge
kernel-modules
kernel-headers
kernel-source
# My nonslack packages
[0-9]+cgs
[0-9]+aliencompat32
# Alien Bob and multilib packages
[0-9]+alien
[0-9]+compat32
# Other
slackpkg\+
slackpkg
[0-9]+mt
steam-launcher-1.0.0.68-i386-1cgs
# Temporary listed until a proper SlackBuild is created.
dmg2img
I plan to try your script as a cron job later. The test I ran earlier worked out fine, no issues.
@chrisretusn , Thank You , Sorry for taking so long to respond but I was waiting for an instance from a cron run of the script that CHECKSUMS.md5.asc was NOT changed . That happened this morning AND FYI: that run that I was waiting for ran WITHOUT the mentioned errors or garbage as shown below .
I am in the process of trying to see how I can enable the 'blacklist' to be used with hand compiled installed tools . Which is of more concern (mostly) than with any 3rd party pkg's . Your provided blacklist was greatly appreciated .
In doing a on command line execute of my script & it completed fully and correctly . None of the output from below was issued into that runs log file . And the CHECKSUMS.md5.asc was NOT changed .
So I setup a run thru crontab . The CHECKSUMS.md5.asc was STILL NOT changed and it went thru per the 'Y' response in BOTH slackpkg.conf & command line option in the script , ie: -default_answer=y(script) & DEFAULT_ANSWER=Y(.conf) .
And this produces , With cavaets noted below ...
Code:
2021-03-30 13:20:02 (80.4 MB/s) - '/tmp/slackpkg.AMvIFV/CHECKSUMS.md5.asc' saved [163/163]
No changes in ChangeLog.txt between your last update and now.
Do you really want to download all other files (y/N)? y
And wouldn't you know it , There was an update in progress and the below was captured by the Cron run ...
Code:
http://mirrors.slackware.com/slackwa...6_64-1.txz.asc...
URL transformed to HTTPS due to an HSTS policy
--2021-03-30 13:21:00--
https://mirrors.slackware.com/slackw...6_64-1.txz.asc
Resolving mirrors.slackware.com (mirrors.slackware.com)... 207.223.116.213
Connecting to mirrors.slackware.com (mirrors.slackware.com)|207.223.116.213|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2021-03-30 13:21:00 ERROR 404: Not Found.
ERROR - Package not installed! md5sum error!
... And Just after that ...
Code:
Searching for NEW configuration files...
stty: 'standard input': Inappropriate ioctl for device
Some packages had new configuration files installed (22 new files):
/usr/libexec/slackpkg/functions.d/post-functions.sh: line 182: [: 36: unary operator expected
/etc/ca-certificates.conf.new
^[[1A^[[K^[[1A^[[K
What do you want (K/O/R/P)?
There are still the non-supposed to be output errors/warnings ...
The ...
"stty: 'standard input': Inappropriate ioctl for device"
Which "Petri Kaukasoina" mentioned) is still being ejected .
And a NEW one (because of the actual lack of updates ie: (packages) , Which seems to be relating to the check for *.new files ...
/usr/libexec/slackpkg/functions.d/post-functions.sh: line 182: [: 36: unary operator expected
. . . ie: ...
Code:
182 if [ $(( newcount + TEXTLINES )) -lt $ROWS ]; then
183 # All files will fit on screen.
184 printf "%s\n" "$FILES"
185 else
186 # Won't all fit, so scroll a screenfull at a time.
187 # No. of lines minus 'Searching for' + 'Press SPACE...'
And the escape sequences we are NOT supposed to be seeing when the "BATCH=on" or "-batch=on" are configured , I think may still be associated with the check of .new files . I am unable to ascertain if this suppostion is a fact .
"^[[1A^[[K^[[1A^[[K"
Tia , JimL
Last edited by babydr; 03-30-2021 at 05:40 PM.
Reason: Didn't mention that the run I was waiting for ran WITHOUT the mentioned errors of garbage . chg a word
As @Petri Kaukasoina has pointed out, the errors are caused by the lack of a tty when running from a cron job. Based on the last answer here, I propose this patch to post-functions.sh
Code:
--- post-functions.sh.orig 2021-03-31 13:04:57.775808845 +1100
+++ post-functions.sh 2021-03-31 13:08:48.626805418 +1100
@@ -154,7 +154,11 @@
if [ -n "$FILES" ]; then
newcount=$( echo "$FILES" | wc -l )
- SIZE=$( stty size )
+ if [ "$(tty)" != "not a tty" ]; then
+ SIZE=$( stty size )
+ else
+ SIZE="40 80"
+ fi
ROWS=${SIZE% *}
# Set here so we can count the No. of lines
@allend , Thank You , That did in fact remove the "/usr/libexec/slackpkg/functions.d/post-functions.sh: line 182: [: 36: unary operator expected" And "stty: 'standard input': Inappropriate ioctl for device" and "^[[1A^[[K^[[1A^[[K" .
@ALL
I would still like to understand why the (From my original message) ...
Code:
"No changes in ChangeLog.txt between your last update and now.
Do you really want to download all other files (y/N)? ^[[?25h^[[?0c"
was occuring while the script (show below) was confgiured with ,
Code:
slackpkg -batch=on -default_answer=y upgrade-all
BUT did not return after putting BATCH=ON into the .conf file .
Thank you all for your comments & Suggestions .
JimL
@allend , Thank You , That did in fact remove the "/usr/libexec/slackpkg/functions.d/post-functions.sh: line 182: [: 36: unary operator expected" And "stty: 'standard input': Inappropriate ioctl for device" and "^[[1A^[[K^[[1A^[[K" .
@ALL
I would still like to understand why the (From my original message) ...
Code:
"No changes in ChangeLog.txt between your last update and now.
Do you really want to download all other files (y/N)? ^[[?25h^[[?0c"
was occuring while the script (show below) was confgiured with ,
Code:
slackpkg -batch=on -default_answer=y upgrade-all
BUT did not return after putting BATCH=ON into the .conf file .
Thank you all for your comments & Suggestions .
JimL
Your script:
Quote:
Originally Posted by babydr
# cat do-slackpkg-for-updates.sh.txt
# Tell us what version of slackware/slamd64 we are running
#
echo -en "\n`cat /etc/slackware-version`\n\n"
#
# Update the program database .
# slackpkg update
#
# Install any NEW programs and update all installed ones .
#
slackpkg -batch=on -default_answer=y install-new
slackpkg -batch=on -default_answer=y upgrade-all
#
# Remove all old packages from the cache .
#
#rm -f /var/cache/packages/*.tgz*
rm -rf /var/cache/packages/*[/code]
Simple: 'slackpkg update' should have been 'slackpkg batch=on -default_answer=y update'
Setting BATCH=on in slackpkg.conf removed the need for that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.