LinuxQuestions.org
Help answer threads with 0 replies.
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 04-01-2018, 12:40 PM   #1
upnort
Member
 
Registered: Oct 2014
Distribution: Slackware, Proxmox, Debian, CentOS, Ubuntu MATE
Posts: 574

Rep: Reputation: Disabled
How to identify Slackware Current? (Feature Request)


Likely I am overlooking something obvious. More than possible because most days I can't see the tip of my nose!

I am looking for a scriptable way to identify a Slackware Current system and distinguish from a Slackware stable system. Mostly when supporting multiple Slackware systems.

A person using Current knows that Current is being used. A script does not know.

I created a Current VM. I was looking for something simple, such as using /etc/slackware-version and /etc/os-release. Using those files in a stable release "just works," but in Current those files remain unchanged during the development cycle. Traditionally those files do not change until heading into formal beta testing. Likewise with package name schemes.

As those two files are intended to help users identify a system, would be nice if perhaps at least PRETTY_NAME in /etc/os-release was different.

Other methods might include /etc/motd and kernel versions, but those methods could fail if a person has reason to use a different kernel version in a stable release. Other options might include comparing ChangeLog.txt, FILELIST.TXT, PACKAGES.TXT, or noting /patches/packages does not exist, or looking at the mirror used in /etc/slackpkg/mirrors -- if a person uses slackpkg.

This is not a thread about using Current (use at your own risk, blah, blah, blah). Just a simple conversation about a scriptable way to identify a Current system.

Thanks.

Last edited by upnort; 04-01-2018 at 04:02 PM.
 
Old 04-01-2018, 12:46 PM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 7,108

Rep: Reputation: 4841Reputation: 4841Reputation: 4841Reputation: 4841Reputation: 4841Reputation: 4841Reputation: 4841Reputation: 4841Reputation: 4841Reputation: 4841Reputation: 4841
I'd write a script that downloads a -current ChangeLog.txt, parses the installed packages in reverse order in /var/log/packages/ and then determine whether this computer is synced to a specific date of -current updates. You'd need to verify multiple packages to be certain - for instance all the packages attributed to a single batch of updates.
 
Old 04-01-2018, 01:26 PM   #3
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 678
Blog Entries: 3

Rep: Reputation: 203Reputation: 203Reputation: 203
Here's one way to check, relying on /etc/slackpkg/mirrors
Code:
grep -P '^(?:(?!#).)*current(.)$' /etc/slackpkg/mirrors > /dev/null && echo "current" || echo "not current"
 
Old 04-01-2018, 03:31 PM   #4
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.2
Posts: 2,970

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Quote:
Originally Posted by upnort View Post
Other methods might include /etc/motd and kernel versions, but those methods could fail if a person has reason to use a different kernel version in a stable release.
If you are using a different kernel version than -stable is using, then how can you say that you are running a -stable system?

Seems to me that you have these Slackware systems:
  • -current
  • -stable
  • user defined

"user defined" may need to look through old release kernel versions to provide a hint that perhaps you haven't upgraded your kernel. Of course, the first release of -current normally has the -stable kernel in it.

OTOH, adding VARIANT_ID=current to /etc/os-release for -current and VARIANT_ID=stable for -stable would simplify your problem. See https://www.freedesktop.org/software...s-release.html (To Whom It May Concern: Just because a string has systemd in it is no reason to become silly; that is all.)
 
1 members found this post helpful.
Old 04-01-2018, 04:02 PM   #5
upnort
Member
 
Registered: Oct 2014
Distribution: Slackware, Proxmox, Debian, CentOS, Ubuntu MATE
Posts: 574

Original Poster
Rep: Reputation: Disabled
Feature Request

Thanks for the replies.

Based on the responses looks like I am not missing anything obvious.

Seems /etc/os-release has additional options that could be used to identify Current without breaking existing variables that others might already be scripting.

BUILD_ID=
VARIANT=
VARIANT_ID=
VERSION_CODENAME=
VERSION_ID=

Or

SLACKWARE_CODENAME=

I am converting this thread into a feature request. I also added the same request in the Requests for current thread. I hope Pat is reading.

Last edited by upnort; 04-01-2018 at 04:09 PM.
 
1 members found this post helpful.
Old 04-02-2018, 09:54 PM   #6
ttk
Member
 
Registered: May 2012
Location: Sebastopol, CA
Distribution: Slackware
Posts: 671
Blog Entries: 24

Rep: Reputation: 745Reputation: 745Reputation: 745Reputation: 745Reputation: 745Reputation: 745Reputation: 745
For what it's worth, I'd love an easy official way to identify -current systems as well, preferably via /etc/os-release.
 
Old 04-03-2018, 12:27 AM   #7
NoStressHQ
Member
 
Registered: Apr 2010
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 606

Rep: Reputation: 218Reputation: 218Reputation: 218
I think it could be a great insight to be able to develop more reliable, and user friendly "IT" scripts.

It's not supposed to have dangerous side effect either, so I'm supporting your request .
 
Old 04-03-2018, 04:32 AM   #8
rkfb
Member
 
Registered: Oct 2003
Location: Guildford, England
Distribution: Slackware64 -current running TWM on Toshiba Satellite L650D
Posts: 420

Rep: Reputation: 97
What determines a system running -current?

What if I upgrade to current but don't upgrade the kernel? Am I still -current?
What if I run 14.2 but install a particular package from the -current tree because I want the newest version? What if I install half a dozen packages?

I could end up running a sort of hybrid system if I was determined enough I guess. Are there certain packages that absolutely determine what a system is or is it just the case that every system is user-defined?

I should imagine that the only true current systems are the vanilla install development systems run by the likes of Pat and Eric.
 
Old 04-03-2018, 05:15 AM   #9
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 678

Rep: Reputation: 520Reputation: 520Reputation: 520Reputation: 520Reputation: 520Reputation: 520
Quote:
Originally Posted by rkfb View Post
What determines a system running -current?

What if I upgrade to current but don't upgrade the kernel? Am I still -current?
What if I run 14.2 but install a particular package from the -current tree because I want the newest version? What if I install half a dozen packages?

I could end up running a sort of hybrid system if I was determined enough I guess. Are there certain packages that absolutely determine what a system is or is it just the case that every system is user-defined?
I thought the same: a -current from a year ago that was installed and never updated, would still be flagged as being "-current"; so it depends what you want this script to achieve.
I think that the distinction would primitive: it's either a known release (indicated by a version number) which may or may not have been updated (using /patches and/or locally installed packages), or it's not (could be "-current" from any period of time).
The only other practical option I could think of would be to indicate that it's "-current" _post_ a released version, which would give you some idea of the system.

I wouldn't want to make any automated decisions based on this information though, unless the management of the machines was known in advance.
 
1 members found this post helpful.
Old 04-03-2018, 06:56 AM   #10
NoStressHQ
Member
 
Registered: Apr 2010
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 606

Rep: Reputation: 218Reputation: 218Reputation: 218
Quote:
Originally Posted by drmozes View Post
I wouldn't want to make any automated decisions based on this information though, unless the management of the machines was known in advance.
Sorry to correct you but you assume the "test" too quickly... The test might just be to automatically detects we DON'T support the -current branch. Information worth what people do about it. Never assume "usefulness" of an information, moreover when you deal with developers (/hackers). So yes, I'd make an automatic warning / abort with this information. This is automated, this is a decision.
 
Old 04-03-2018, 07:41 AM   #11
montagdude
Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 986

Rep: Reputation: 708Reputation: 708Reputation: 708Reputation: 708Reputation: 708Reputation: 708Reputation: 708
Quote:
Originally Posted by rkfb View Post
What determines a system running -current?

What if I upgrade to current but don't upgrade the kernel? Am I still -current?
What if I run 14.2 but install a particular package from the -current tree because I want the newest version? What if I install half a dozen packages?

I could end up running a sort of hybrid system if I was determined enough I guess. Are there certain packages that absolutely determine what a system is or is it just the case that every system is user-defined?

I should imagine that the only true current systems are the vanilla install development systems run by the likes of Pat and Eric.
Going along with the idea of using something like /etc/os-release to identify the Slackware version, a -current system would be one that has upgraded the package containing that file to the one from -current. The assumption would be that if you have upgraded that package, then you have probably upgraded everything else too. Is that necessarily an accurate assumption? Of course not, but in those cases the admin is expected to know that he/she has created a mixed system. This solution would at least catch the majority of cases where someone switched to a -current mirror accidentally.
 
1 members found this post helpful.
Old 04-03-2018, 08:12 AM   #12
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,964

Rep: Reputation: 1713Reputation: 1713Reputation: 1713Reputation: 1713Reputation: 1713Reputation: 1713Reputation: 1713Reputation: 1713Reputation: 1713Reputation: 1713Reputation: 1713
Quote:
I'd write a script that downloads a -current ChangeLog.txt, parses the installed packages in reverse order in /var/log/packages/ and then determine whether this computer is synced to a specific date of -current updates. You'd need to verify multiple packages to be certain - for instance all the packages attributed to a single batch of updates.
This one-liner will show matches between a -current ChangeLog.txt and installed packages.
Code:
join <(sed -n 's%^[a-z]\+/\(.*\)\.t.*:.*%\1%p' ChangeLog.txt | sort -u) <(ls -1 /var/log/packages)
 
2 members found this post helpful.
Old 04-03-2018, 08:30 AM   #13
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1 on Lenovo Thinkpad W520
Posts: 8,338

Rep: Reputation: 3114Reputation: 3114Reputation: 3114Reputation: 3114Reputation: 3114Reputation: 3114Reputation: 3114Reputation: 3114Reputation: 3114Reputation: 3114Reputation: 3114
Quote:
Originally Posted by montagdude View Post
This solution would at least catch the majority of cases where someone switched to a -current mirror accidentally.
If this was done uncommenting a -current mirror in /etc/slackpkg/mirrors, the user will be warned next time slackpkg runs if and when Robby's patched slackpkg is uploaded to -current, see lines 266-282 in this file.

Last edited by Didier Spaier; 04-03-2018 at 08:32 AM.
 
2 members found this post helpful.
Old 04-03-2018, 10:11 AM   #14
upnort
Member
 
Registered: Oct 2014
Distribution: Slackware, Proxmox, Debian, CentOS, Ubuntu MATE
Posts: 574

Original Poster
Rep: Reputation: Disabled
Thanks for the replies!

Not all Slackers use slackpkg. The slackpkg mirror would not help Slackers who use pkgtools or slapt-get.

Similar argument for change logs. Some Slackers use different tools and methods to update systems.

While Pat is not responsible for Slackware derivatives, would still be nice if the method used rolls down hill to the derivatives in a compatible way.

Basic expectations remain the same whether a person is running stable or current, modified or unmodified. What users do downstream is not the maintainers' responsibility. Maintainers must be allowed some simple presumptions. For example, a long-standing presumption when asking for help in this forum is running a full installation and if not, to be specific about what is not installed before seeking help. Nobody is required to run a full install -- I don't and haven't for many years -- but I expect myself to know the impact of what is removed.

I am thinking a single new variable in /etc/os-release would be sufficient to distinguish releases. Anyway, I am hoping Pat agrees.
 
1 members found this post helpful.
Old 04-03-2018, 10:56 AM   #15
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 14.2 + Multilib
Posts: 1,336

Rep: Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722Reputation: 722
Since we don't know the next Slackware version number when a new stable version is released, I wonder if a very simple suffix in /etc/slackware-version would work ?

Maybe for current, add some sort of predictable suffix to indicate that you're in a -current version, based on the previous stable version:

For example,
Code:
[kjh@current]$ cat /etc/slackware-version

Slackware 14.2+
And for a stable release:

Code:
[kjh@stable]$ cat /etc/slackware-version

Slackware 14.2
This way, /etc/slackware-version in -current would change once only when a new stable version is released ?

Thinking aloud ...

-- kjh
 
4 members found this post helpful.
  


Reply


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
[SOLVED] Script to build always a current ISO image of Slackware (slackware-current) robertjinx Slackware 2 12-09-2010 02:00 AM
[SOLVED] How to identify current CPU in a parallel machine Feynman Linux - Newbie 6 09-03-2010 09:57 AM
Identify current mode of a file scbops Programming 2 07-03-2006 08:41 AM
Identify Slackware as Windows rkfb Slackware 17 05-02-2004 06:52 PM

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

All times are GMT -5. The time now is 03:40 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