LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 12-12-2017, 04:02 PM   #1
cwizardone
LQ Veteran
 
Registered: Feb 2007
Distribution: Slackware64-current with "True Multilib" and KDE4Town.
Posts: 9,095

Rep: Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273
Execute by File Date?


For the last hour or so I've been searching the 'Net to see if
it is possible to upgrade or install a package by its file date
instead of its file name.
I've never had much luck using search engines for whatever reason,
and today is no different. Regardless of what combination of words I enter, the results are usually about using the "date" command.
So, is it possible to execute a package by its file date?
Many Thanks.


(Something I should have learned twenty years ago. )
 
Old 12-12-2017, 04:14 PM   #2
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
I do not understand.

So, you have a series of packages, with identical name, but you want them sorted by date?

And how you manage to have a series of files with the same name?

The names should be unique for files, as I know.
 
1 members found this post helpful.
Old 12-12-2017, 04:54 PM   #3
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Something like this might get you started.
Code:
find /srv/slackware/slackware64-current/slackware64/ -name "*.t?z" -type f -printf "%T@ %p\n" | sort -k1,1n
Then process the list as needed.
 
2 members found this post helpful.
Old 12-12-2017, 05:50 PM   #4
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
Quote:
So, is it possible to execute a package by its file date?
Yes, if by 'date' you mean previous versions. All Slackware packages use a naming convention to distinguish versions, which is the same as distinguishing by file date.

With Slackware the installpkg and upgradepkg commands do not check for dependencies. Users can install or replace any version of a package. The commands will not complain or resist.

That said, you need a copy of the older or newer package you want to replace. One challenge is most Slackware mirrors do not retain previous versions. After you find and copy the version of the package you want locally, the installpkg and upgradepkg will work the same.

Often I have thought the upgradepkg command should be named replacepkg.
 
1 members found this post helpful.
Old 12-12-2017, 07:51 PM   #5
cwizardone
LQ Veteran
 
Registered: Feb 2007
Distribution: Slackware64-current with "True Multilib" and KDE4Town.
Posts: 9,095

Original Poster
Rep: Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273
Many thanks to everyone for their replies.
For example, let us say I just downloaded half a dozen different packages into a directory containing various other packages, including some with the same name, but a earlier version.
What I want to do is run upgradepkg or installpkg on the most recently downloaded files all at the same time.
So, I might issue something like,

upgradepkg --reinstall --install-new

and then on the same line whatever option needed along with the date, so it would be something like,

upgradepkg --reinstall --install-new --option-12.12.2017

Last edited by cwizardone; 12-12-2017 at 07:52 PM.
 
Old 12-12-2017, 09:14 PM   #6
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
That thing does not exists in PKGTOOLS, as you know.

Otherwise, IF you intend to propose an extension to PKGTOOLS, better look first to my own mega-thread, where was just about four lines code addition. And optionally a ton of work. BUT, only optionally.

IF you want us to talk theoretically, honestly I will look suspicious at idea to leave upgradepkg to mess with what it like in the "range" of 12.12.2017

Last edited by Darth Vader; 12-12-2017 at 10:20 PM.
 
Old 12-12-2017, 10:18 PM   #7
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
I don't think this is possible without some ls -la piped into greps, uniq, xargs and possibly (probably) more. If you give an example of your ls -la output and what packages you'd want to install, something might be able to be worked up by people here.
 
Old 12-13-2017, 02:47 AM   #8
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
upgradepkg expects as target a package or a list of packages with their paths given as arguments, period.

You could use the date to choose which packages to upgrade, in other words which ones you will make targets of upgradepkg, but in my opinion this is risky, as an "older" package can be rebuilt at a later time that a "newer" one.

I fail to see why you want to put in the same directory several packages with the same base name, maybe you could shed some light on your rationale doing so?
 
Old 12-13-2017, 03:55 AM   #9
cwizardone
LQ Veteran
 
Registered: Feb 2007
Distribution: Slackware64-current with "True Multilib" and KDE4Town.
Posts: 9,095

Original Poster
Rep: Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273Reputation: 7273
As it is not possible, I've marked this thread as, "Solved."
Thanks to everyone for their remarks.
 
Old 12-13-2017, 05:28 AM   #10
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,783

Rep: Reputation: 1459Reputation: 1459Reputation: 1459Reputation: 1459Reputation: 1459Reputation: 1459Reputation: 1459Reputation: 1459Reputation: 1459Reputation: 1459
Quote:
Originally Posted by cwizardone View Post
For example, let us say I just downloaded half a dozen different packages into a directory containing various other packages, including some with the same name, but a earlier version.
What I want to do is run upgradepkg or installpkg on the most recently downloaded files all at the same time.
So, I might issue something like,

upgradepkg --reinstall --install-new

and then on the same line whatever option needed along with the date, so it would be something like,

upgradepkg --reinstall --install-new --option-12.12.2017
Would this work?
Code:
upgradepkg --reinstall --install-new  $(find *.t?z -ctime 0 -maxdepth 0)
 
Old 12-13-2017, 06:39 AM   #11
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
To make the date explicit, you could create a temporary file with the required date and time stamp.
Code:
touch -t 201712010000 /tmp/mydate.tmp
upgradepkg --reinstall --install-new $(find /var/cache -name "*.t?z" -newer /tmp/mydate.tmp)
rm /tmp/mydate.tmp
 
1 members found this post helpful.
Old 12-13-2017, 07:15 AM   #12
FlinchX
Member
 
Registered: Nov 2017
Distribution: Slackware Linux
Posts: 666

Rep: Reputation: Disabled
Since you don't want to use a package manager, but prefer to manually scan downloaded packages for date, perhaps you can do one more manual step and just grab a list of existing packages in your local directory every time before downloading new ones, do it again after you add new content, sort those lists, compute the diff, and just install the new ones?
 
1 members found this post helpful.
  


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] date cannot execute [Arg list too long] Kalaso Linux - Newbie 7 07-28-2016 08:42 AM
[SOLVED] Will receive two file on same date but i need to extract only one file with date like spatil20 Linux - General 7 07-01-2015 01:16 AM
crontab execute correctly, but date in script fails skylord Linux - Server 6 04-17-2011 01:56 AM
[SOLVED] BASH: Keep original mod date of a file and 'date' it back to same file? SilversleevesX Programming 4 07-16-2010 11:12 AM
shell script to find modified date and last accessed date of any file. parasdua Linux - Newbie 6 04-22-2008 09:59 AM

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

All times are GMT -5. The time now is 03:47 AM.

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