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.
ws1 hp-upgrade: hp-upgrade[1668]: warning: distro is not found in AUTH_TYPES
Now I don't have a printer attached to this box, but I can remember that I accidentally caught the print hot-key in an app at around the timestamp of this message in my syslog which likely triggered this message.
I *really* don't like some arbitrary bit of python code trying to update bits of my system automatically from an external site, and I especially dislike it when it is an unrequested action and outside of package-management.
I don't know whether others will also perceive this as unwelcome or a problem, but I thought it worth raising.
The function that attempts to identify the name of the distro so that it can initiate the upgrade doesn't know what file to look for on Slackware:
Code:
def get_distro_name():
os_name = None;
if utils.which('lsb_release'):
name = os.popen('lsb_release -i | cut -f 2')
os_name = name.read().strip()
name.close()
else:
name = os.popen("cat /etc/issue | awk '{print $1}' | head -n 1")
os_name = name.read().strip()
name.close()
if "redhatenterprise" in os_name.lower():
os_name = 'rhel'
elif "suse" in os_name.lower():
os_name = 'suse'
return os_name
I'm not sure why they fall back to /etc/issue because that is almost always going to have escape sequences in it instead of static strings that can be awked. Seems trivially easy to fix but then instead of getting the warning message we'll get a prompt for the root password whenever upgrade.py gets called.
Seems trivially easy to fix but then instead of getting the warning message we'll get a prompt for the root password whenever upgrade.py gets called.
And who knows what the upgrade will do, entirely outside of the packaging system? Seems better to leave it broken. I looked to see if there was a ./configure option to disable this behavior, but it appears that there is not.
Distribution: Slackware64-current with "True Multilib" and KDE4Town.
Posts: 9,097
Rep:
Not sure if this has anything at all to do with it, but since the "upgrade" I've noticed it, hplips, automatically turns on my printer whether I want it to or not.
And who knows what the upgrade will do, entirely outside of the packaging system? Seems better to leave it broken. I looked to see if there was a ./configure option to disable this behavior, but it appears that there is not.
Just did exactly the same Pat. A quick grep seems to show that that hp-upgrade gets called from all over the hplip python sources in /usr/share/hplip. Rather than leave it broken, I wonder if we could replace hp-upgrade with some sort of no-op (just a sys.exit(0) or however it's done in python - not one of my languages). Actually, why not just replace it with a symlink to /usr/bin/true.
On further inspection it seems that hplip is not capable of auto-installing on Slackware because get_distro() in installer/core_install.py doesn't have the necessary functionality to identify Slackware due to its reliance on lsb_release:
Code:
def get_distro(self):
log.debug("Determining distro...")
self.distro, self.distro_version = DISTRO_UNKNOWN, '0.0'
found = False
lsb_release = utils.which("lsb_release")
if lsb_release:
log.debug("Using 'lsb_release -is/-rs'")
cmd = os.path.join(lsb_release, "lsb_release")
status, name = utils.run(cmd + ' -is', self.passwordObj)
name = name.lower().strip()
log.debug("Distro name=%s" % name)
if name.find("redhatenterprise") > -1:
name="rhel"
.
.
.
and then the familiar fall-back to /etc/issue:
Code:
if not found:
try:
name = file('/etc/issue', 'r').read().lower().strip()
except IOError:
# Some O/Ss don't have /etc/issue (Mac)
self.distro, self.distro_version = DISTRO_UNKNOWN, '0.0'
else:
if name.find("redhatenterprise") > -1:
name="rhel"
.
.
.
The bottom line is that is_auto_installer_support() must return false:
Code:
def is_auto_installer_support(self, distro_version = DISTRO_VER_UNKNOWN):
if not self.distro_name:
self.get_distro()
self.distro_name = self.distros_index[self.distro]
if distro_version == DISTRO_VER_UNKNOWN:
distro_version = self.distro_version
if self.distro != DISTRO_UNKNOWN and distro_version != DISTRO_VER_UNKNOWN and self.get_ver_data('supported
', False,distro_version):
log.debug("Auto installation is supported for Distro =%s version =%s "%(self.distro_name, distro_versi
on))
return True
else:
log.debug("Auto installation is not supported for Distro =%s version =%s "%(self.distro_name, distro_v
ersion))
return False
So the question is, what value can Slackware users derive from having hplip accessory programs other than hp-update being able to identify the distro name? If anyone can think of some benefit, here's my patch:
Code:
--- hplip-3.13.2/base/password.py.orig 2013-02-28 09:30:57.442134662 +0200
+++ hplip-3.13.2/base/password.py 2013-02-28 10:48:43.636353992 +0200
@@ -67,6 +67,14 @@
name = os.popen("cat /etc/issue | awk '{print $1}' | head -n 1")
os_name = name.read().strip()
name.close()
+ try:
+ with open('/etc/os-release') as f: pass
+ name = os.popen("grep -w ID /etc/os-release | awk -F= '{print $2}'")
+ os_name = name.read().strip()
+ log.info(("Distro was identified as %s\n") %os_name)
+ name.close()
+ except IOError as e:
+ log.error("Could not access file named /etc/os-release\n")
if "redhatenterprise" in os_name.lower():
os_name = 'rhel'
P.S. You don't have to rebuild the hplip package, you can just edit /usr/share/hplip/base/passwd.py with the relevant changes if you like.
Thanks for that. Yes, your patch fixes the OS detection, but hplip still makes a couple of unwanted outbound connections to hp.com and sourceforge.
Here's my patch
Code:
--- upgrade.py.orig 2013-02-28 10:23:19.062450195 +0000
+++ upgrade.py 2013-02-28 10:27:38.242010423 +0000
@@ -214,9 +214,8 @@
try:
change_spinner_state(False)
core = CoreInstall(MODE_CHECK)
- if not utils.check_network_connection():
- log.error("Either Internet is not working or Wget is not installed.")
- clean_exit(0)
+ log.info("Upgrades? We don't want no stinkin' upgrades!")
+ clean_exit(0)
installed_version=sys_conf.get("hplip","version","0.0.0")
log.debug("HPLIP previous installed version =%s." %installed_version)
What kind of fix are you looking for? A similar patch to the one above was already applied to -current to disable hp-upgrade on Slackware. Actually making the feature work seems like a bad idea to me.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.