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 04-12-2018, 06:40 AM   #31
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656

Quote:
Originally Posted by upnort View Post
Perhaps some people want that, but that was not the original focus of this (my) thread. My focus was a request for a simple scriptable way to distinguish a stable release from current. Something in /etc/os-release would suffice and be simple and is what I requested. Pat is a veteran hacker with these things. I am sure if he provides a solution the method will be simple.
Ah, that is much simpler than I was imagining. Pat would just need to update /etc/os-release and /etc/slackware-version the update after a stable release to change the versions to current and then the last update with the announcement of a stable release, he changes those versions to whatever the new stable number is.

I can definitely see the benefit behind that...
 
Old 04-12-2018, 08:09 AM   #32
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,969

Rep: Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548
I have a virtual machine that has not been update in a while. I simply looked at /var/lib/slackpkg/ChangeLog.txt and determined that the last update was "Tue Nov 28 06:20:03 UTC 2017". Also noted the newest files in /var/log/packages was Nov 29 22:47, which means that the update was applied. Of course this is a manual way, not a scripted way.

I think the best place would be to use /etc/slackware-version. An example. On release of 14.2, it was set to "Slackware 14.2" On the first batch up updates to Slackware 14.2, now a new -current, set it to "Slackware-current 14.2" This way one knows this -current is based on 14.2. One could also just set it to Slackware-current and rely on os-version to determine what version -current is based on.
 
Old 04-12-2018, 10:40 AM   #33
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
Quote:
That's one scenario. It's not the only one, but it's the one that came to mind when I saw this thread.
Thanks for sharing. Kind of hints toward a similar discussion about using Slackware in business.

Quote:
I simply looked at /var/lib/slackpkg/ChangeLog.txt
Yes, but as mentioned in the original post, not all Slackers use slackpkg. Some folks update systems only with pkgtools.
 
Old 04-12-2018, 12:12 PM   #34
ttk
Senior Member
 
Registered: May 2012
Location: Sebastopol, CA
Distribution: Slackware64
Posts: 1,038
Blog Entries: 27

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by upnort View Post
Thanks for sharing. Kind of hints toward a similar discussion about using Slackware in business.
Quite welcome. The matter of Slackware in business (and particularly in the enterprise) is one close to my heart.

The notes I linked to from the topic you linked are still there, and I've updated them from time to time -- http://ciar.org/ttk/public/enterprise-slackware.html

A lot of the work enumerated there has already been done, and components "just" need to be installed and configured. Still, installing and configuring them represents a lot of work in its own right.

I dream of implementing a turnkey solution someday, but am already buried under a pile of neglected projects.
 
2 members found this post helpful.
Old 04-12-2018, 12:43 PM   #35
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,753

Rep: Reputation: Disabled
Quote:
Originally Posted by upnort View Post
Yes, but as mentioned in the original post, not all Slackers use slackpkg. Some folks update systems only with pkgtools.
Guess I'm one of those pkgtool users. I tag a kernel, so when a script needs to know, it looks up there for clues.
Liked the idea of sticking time and date into /etc/* anyway, it's a good one.
 
Old 04-12-2018, 06:26 PM   #36
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
Code:
SLKGCC="$(gcc --version | grep gcc)"



if [ "$SLKGCC" = "gcc (GCC) 4.7.1" ]; then
  SLKUSYS="14.0"
elif [ "$SLKGCC" = "gcc (GCC) 4.8.2" ]; then
  SLKUSED="14.1"
elif [ "$SLKGCC" = "gcc (GCC) 5.5.0" ]; then
  SLKUSYS="14.2"
else
  SLKUSYS="current"
fi
echo $SLKUSYS
echo $SLKGCC
Here is a script I use for grabbing Alien Bob's Packages.
helps you install the correct ones and lets you download any you want for any version.

Code:
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi

while true; do

# Ask the user for the Program name
echo -e "\e[1;33m what Alian Bob program do you need?\e[0m"
read prgname
echo -e "\e[1;34m It's ok lets download or install $prgname \e[0m"
sleep 2
PROGNM=$prgname 


# Need the version of Slackware you are running
echo -e "\e[1;33m Enter the version number of Slackware you need to download ? \e[0m"
read slackwareversion
echo -e "\e[1;34m You chose slackware version $slackwareversion \e[0m"
sleep 2
SLKVER=$slackwareversion



# Need the version of Slackware you are downloading
echo -e "\e[1;33m Type yes or no to install? \e[0m"
read install
echo -e "\e[1;33m Are going to install $install \e[0m"
sleep 2
INST=$install




EDITPG=vim # add you favorite editor here defaylt is vim kwrite,kate,gvim,geany.

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi



CWD=$(pwd)
TMP=${TMP:-/tmp/SBo/$SLKVER}
BOB=$TMP/$PROGNM

if [ "$ARCH" = "x86_64" ]; then
PKG="pkg64"
else
PKG="pkg"
fi

#rm -rf $BOB
mkdir -p $TMP/$PROGNM
echo going to grab slackware.uk/people/alien/slackbuilds/$PROGNM/$PKG/$SLKVER/
 sleep 5 #http://slackware.uk/people/alien/slackbuilds/
rsync -r -a -v  --delete --progress --stats rsync://slackware.uk/people/alien/slackbuilds/$PROGNM/$PKG/$SLKVER/  $TMP/$PROGNM


cd $TMP

SLKGCC="$(gcc --version | grep gcc)"



if [ "$SLKGCC" = "gcc (GCC) 4.7.1" ]; then
  SLKUSYS="14.0"
elif [ "$SLKGCC" = "gcc (GCC) 4.8.2" ]; then
  SLKUSED="14.1"
elif [ "$SLKGCC" = "gcc (GCC) 5.5.0" ]; then
  SLKUSYS="14.2"
else
  SLKUSYS="current"
fi

sleep 5
if [ "$SLKVER" = "$SLKUSYS" ]; then
   echo -e "\e[1;34m Your Installing the right program for your system \e[0m"
   sleep 3
elif [ "$INST" = "no" ]; then
   echo -e "\e[1;34m it is downloaded do not install on this system  \e[0m"
else
   echo -e '\E[37;41m'"\033[1m !!!!Unable TO Istall You are running the wrong Slackware Version !!!!\033[0m"
   sleep 5
   exit 1
fi






if [ -f   $TMP/$PROGNM/*.txz ]; then
  echo -e "\e[1;33m $PROGNM downloaded \e[0m"
  sleep 1
else
function pause(){
   read -p "$*"
}
 
# ...
  echo -e "\e[1;33m Program  Not found. Was It Spelled Right? \e[0m"
  echo -e "\e[1;33m  Would you like to look it up? press enter to see the repo \e[0m"
pause 'Press [Enter] key to continue or ctrl c to stop...'
# ...
lynx  http://slackware.uk/people/alien/slackbuilds/

fi

if [ -f  $TMP/$PROGNM/*.dep ]; then
   echo -e "\e[1;33m This Program Has Dependencies exit vim press shit>colon then type q  \e[0m"
   echo -e "\e[1;33m or a gui editor gvim kwrite  \e[0m"
    sleep 5
     $EDITPG  $TMP/$PROGNM/*.dep 
     
function pause(){
   read -p "$*"
}

# ...
   echo -e "\e[1;33m Look at them good you may need them. \e[0m"
pause 'Press [Enter] key to continue or ctrl c to stop...'
# ...
else
    echo -e "\e[1;33m No dependencies needed \e[0m"
    sleep 3
fi

if [ "$INST" = "yes" ]; then
    cd  $BOB
    upgradepkg --reinstall --install-new *.t?z
else
    echo -e "\e[1;33m your program is locate $BOB \e[0m"
    sleep 3
    
fi






function pause(){
   read -p "$*"
}
 
# ...
   echo -e "\e[1;33m Would you like to install or download another alien pkg \e[0m"
pause 'Press [Enter] key to continue or ctrl c to stop...'
# ...
# rest of the script
#

    for i in {Type In another Program}; do
        echo -e "\e[1;34m $i\e[0m"
        sleep 1
    done
done

Last edited by Drakeo; 04-12-2018 at 06:47 PM. Reason: add full script
 
1 members found this post helpful.
Old 04-12-2018, 08:20 PM   #37
cwizardone
LQ Veteran
 
Registered: Feb 2007
Distribution: Slackware64-current with "True Multilib" and KDE4Town.
Posts: 9,096

Rep: Reputation: 7275Reputation: 7275Reputation: 7275Reputation: 7275Reputation: 7275Reputation: 7275Reputation: 7275Reputation: 7275Reputation: 7275Reputation: 7275Reputation: 7275
From today's change log,

Quote:
Thu Apr 12 23:00:51 UTC 2018
a/aaa_base-14.2-x86_64-3.txz: Rebuilt.
If the system is running -current, append a "+" to /etc/slackware-version.
Identify the system as stable or current in /etc/os-release by setting
VERSION_CODENAME to either stable or current. In PRETTY_NAME, really
spell it out, e.g: PRETTY_NAME="Slackware 14.2 (pre-15.0 -current)"
 
8 members found this post helpful.
Old 04-12-2018, 08:33 PM   #38
ttk
Senior Member
 
Registered: May 2012
Location: Sebastopol, CA
Distribution: Slackware64
Posts: 1,038
Blog Entries: 27

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Yaay :-) Thanks, Pat!

self-id updated.

Last edited by ttk; 04-12-2018 at 09:06 PM.
 
Old 04-12-2018, 09:24 PM   #39
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
Quote:
From today's change log,
Pshaw, I knew Pat would come up with something simple.

SOLVED!
 
Old 04-13-2018, 10:51 AM   #40
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
From today's change log,
...

PRETTY_NAME="Slackware 14.2 (pre-15.0 -current)
Identifying -current is great. However I'd prefer to see "post-14.2 -current"

When a -current software version first appears after a stable release, Mr. Volkerding may think it will be called 14.3. But a year later, due to major changes, a release version of 15.0 may make better sense to him.

I'm not a fan of announcing the version number of the next stable release far in advance. It encourages many on LQ to refer to -current with that future version number long before it is ever released. This makes it difficult to find issues with the stable release with that version number when -current is also referenced as a stable released version number (e.g. 15.0). It makes it difficult to know which version of the software the poster is actually using.

Precision in referencing a release in a post, such as "pre-15.0", would help but the problem is caused by a poster's lack of precision with version name references in the first place. Referencing -current as pre-xx.x is actually more precise then simply -current but I don't know if LQ search can differentiate "xx.x" from "pre-xx.x" when searching for stable release "xx.x".

Sure knowledge of release dates for different software versions can help narrow the search, but needing to apply additional attributes dilutes the value of having version references.

I brought this issue up previously and it doesn't seem to be a problem for anyone else. I'm not trying to convince anyone. I'm just voicing my unshared opinion. I like to see software versions referenced unambiguously.
 
7 members found this post helpful.
Old 04-13-2018, 01:44 PM   #41
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
EDIT: Dang ! I missed the fact that TracyTiger was talking about 'the other file' ( /etc/os-release ) and the PRETTY_NAME Field )...

Never mind ...( I agree with TracyTiger )

Quote:
Originally Posted by TracyTiger View Post
Identifying -current is great. However I'd prefer to see "post-14.2 -current"

<<snip>>
TracyTiger --

I personally like the simple format of /etc/slackware-version.

The simple-yet-predictable string in the one-line file can be modified as you like via a script.

For example, this q&d script will generate your preferred format, based on the '+' suffix of the version string in /etc/slackware-version:
Code:
#!/bin/sh

TheFile="/etc/slackware-version"

gawk '
BEGIN {

   MyVer   = ""
   VerTag  = ""
   RetCode = 1
}
{
   if ( NF != 2 )
   {
      next
   }
   MyOS  = $1
   MyVer = $2

   if ( match( MyVer, /\+$/ ))
   {
      MyVer  = "post-" substr( MyVer, 1, RSTART - 1 )
      VerTag = " -current"
   }
   print MyVer VerTag
   RetCode = 0
}
END {

   exit( RetCode )

}' $TheFile
Here it is on a freshly updated Slackware64 14.2 current box ( a Slackware 14.2+ box )

Code:
~/bin/what-version      # I named the script ~/bin/what-version

post-14.2 -current
Here it is on a different slackware 14.2 box:

Code:
# ~/bin/what-version

14.2
I am sure there are better ways to do what I did but the simple '+' suffix says that my current box is Slackware Current based on the latest 14.2 ( or post-14.2-current )

HTH.

-- kjh

Last edited by kjhambrick; 04-13-2018 at 02:08 PM. Reason: missed the point :)
 
2 members found this post helpful.
Old 04-25-2018, 12:16 PM   #42
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
Although I tagged this thread as solved, my thanks to Pat for implementing the change. For years I have used my own admin shell script to synchronize certain files among all of my Slackware systems. With the new change I now can distinguish a Current system and not sync files incorrectly. Nice!
 
1 members found this post helpful.
Old 01-08-2022, 04:06 PM   #43
iluvatar1
LQ Newbie
 
Registered: Apr 2014
Posts: 26

Rep: Reputation: Disabled
Is there a way to know the actual time stamp of the current version one is using? I know this is an old thread and https://docs.slackware.com/howtos:mi...ckware_version shows how to get the slackware version, but I would also like to know the actual time stamp for the current version. The changelog shows something like
Quote:
Fri Jan 7 06:03:52 UTC 2022
a/kernel-firmware-20220106_4aa2c65-noarch-1.txz: Upgraded.
a/tcsh-6.23.02-x86_64-1.txz: Upgraded.
ap/sqlite-3.37.2-x86_64-1.txz: Upgraded.
...
so the first line would be useful to be included in /etc/os-release, if possible. I admin a computer room where I create golden images based on slackware current that are meant to be distributed by using clonezilla, but sometimes some installs fail and require manual tinkering and at the end I have several systems on "different" slackware current (different dates).
Thanks
PS: I do not mean to hijack the thread, I think this is a related question. Sorry in advance.
 
Old 01-08-2022, 04:25 PM   #44
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,356

Rep: Reputation: 4067Reputation: 4067Reputation: 4067Reputation: 4067Reputation: 4067Reputation: 4067Reputation: 4067Reputation: 4067Reputation: 4067Reputation: 4067Reputation: 4067
Quote:
Originally Posted by iluvatar1 View Post
Is there a way to know the actual time stamp of the current version one is using? I know this is an old thread and https://docs.slackware.com/howtos:mi...ckware_version shows how to get the slackware version, but I would also like to know the actual time stamp for the current version. The changelog shows something like

so the first line would be useful to be included in /etc/os-release, if possible. I admin a computer room where I create golden images based on slackware current that are meant to be distributed by using clonezilla, but sometimes some installs fail and require manual tinkering and at the end I have several systems on "different" slackware current (different dates).
Thanks
PS: I do not mean to hijack the thread, I think this is a related question. Sorry in advance.
Available entries in os-release:
https://www.linux.org/docs/man5/os-release.html
 
Old 01-08-2022, 04:41 PM   #45
iluvatar1
LQ Newbie
 
Registered: Apr 2014
Posts: 26

Rep: Reputation: Disabled
Quote:
Originally Posted by marav View Post
Available entries in os-release:
https://www.linux.org/docs/man5/os-release.html
Hmm yeah, I did not want to suggest what fields to use, but now that you cited the docs, maybe VARIANT or VARIANT_ID would be useful tags ...
According to the link I already posted (https://docs.slackware.com/howtos:mi...ckware_version), there is no currently a way to distinguish among current versions.
 
  


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
[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 06:54 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