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 10-03-2016, 10:19 AM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Rep: Reputation: 177Reputation: 177
Can slackpkg blacklist just a single program?


I've modified a single program: kcheckpass, in the kde-workspace package. I don't want to blacklist the whole package, but I don't want my modified program to get clobbered on the next upgrade. Is there a way to blacklist a single component within a package?
 
Old 10-03-2016, 10:25 AM   #2
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,097

Rep: Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174
no, if you want to handle this via slackpkg you have to blacklist the package: slackpkg won't handle anything about the content of the packages, it uses the pkgtools utilities (installpkg, upgradepkg, etc.) for installing/upgrading.

alternatively, you can make the file immutable with chattr
Code:
chattr -i /usr/lib$LIBDIRSUFFIX/kde4/libexec/kcheckpass
so that an upgrade of kde-workspace won't overwrite it.

Last edited by ponce; 10-03-2016 at 10:27 AM.
 
3 members found this post helpful.
Old 10-03-2016, 01:16 PM   #3
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
Or, could I simple `chmod a-w /usr/lib$LIBDIRSUFFIX/kde4/libexec/kcheckpass`, rather than using chattr? I've used chattr, but not much and when I need to ultimate modify such a file I always forget that months/years ago I chattr'ed it.
 
Old 10-03-2016, 01:33 PM   #4
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
You can still remove a file that has the write permission removed. Try it yourself.

Code:
touch test
chmod -w test
rm test
It will ask if you want to remove a write-protected file, and you can hit the y to continue to remove it. removepkg would force that using the -f option of rm.
 
1 members found this post helpful.
Old 10-03-2016, 04:49 PM   #5
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
Good point! Thanks.
 
Old 10-05-2016, 07:49 PM   #6
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,639

Rep: Reputation: Disabled
Quote:
Originally Posted by ponce View Post
no, if you want to handle this via slackpkg you have to blacklist the package: slackpkg won't handle anything about the content of the packages, it uses the pkgtools utilities (installpkg, upgradepkg, etc.) for installing/upgrading.

alternatively, you can make the file immutable with chattr
Code:
chattr -i /usr/lib$LIBDIRSUFFIX/kde4/libexec/kcheckpass
so that an upgrade of kde-workspace won't overwrite it.
Shouldn't that be
Code:
 chattr +i filename
?
 
Old 10-06-2016, 12:31 AM   #7
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
the 'common' way to solve this is to put the program on a place that is before /usr/bin in you $PATH,
that is usually /usr/local/bin, which is there for such and similar reasons.
than it doesn't matter if the original binary becomes overwritten by an update. and you can easily switch both versions, if this is ever needed.
putting things to /usr/local/ will also allow you to package and manage your software via the available pkg tools
 
1 members found this post helpful.
Old 10-06-2016, 12:39 AM   #8
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,097

Rep: Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174
Quote:
Originally Posted by BCarey View Post
Shouldn't that be
Code:
 chattr +i filename
?
yes, I accidentally wrote how to do the opposite (removing the immutable attribute), thanks for pointing it out!

Last edited by ponce; 10-06-2016 at 05:09 AM.
 
Old 10-06-2016, 09:30 AM   #9
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
Quote:
Originally Posted by a4z View Post
the 'common' way to solve this is to put the program on a place that is before /usr/bin in you $PATH,
that is usually /usr/local/bin, which is there for such and similar reasons.
than it doesn't matter if the original binary becomes overwritten by an update. and you can easily switch both versions, if this is ever needed.
putting things to /usr/local/ will also allow you to package and manage your software via the available pkg tools
That is an excellent idea!! I'll try it. That would save me from having to either chattr the file, or move it elsewhere before doing the update. The problem with the chattr solution is that I still want the original to get updated because my kcheckpass script will run the 'real' program for local users. So, if I put my replacement in /user/local/bin, my script can still run /usr/lib64/kde4/libexec/kcheckpass explicitly. This solution lets me substitute the command while still retaining the original's upgradeability!

LATER ...

Although a great idea, it doesn't work in this case. Apparently the system calling program, kscreenlocker_greet, looks for kcheckpass explicitly in the /usr/lib64/kde4/libexec directory. I had to move it back to get it to work.

Last edited by mfoley; 10-06-2016 at 10:10 AM.
 
  


Reply

Tags
blacklist, slackpkg



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] slackpkg blacklist for pi(3) Tonus Slackware - ARM 5 04-07-2016 02:35 AM
[SOLVED] slackpkg blacklist question Woodsman Slackware 3 10-23-2013 04:37 PM
[SOLVED] aaa_elflibs not blacklisted in /etc/slackpkg/blacklist dmslack Slackware 3 10-22-2013 05:33 AM
Blacklist package group from slackpkg Phorize Slackware 2 08-19-2013 04:34 AM
[SOLVED] regex in blacklist for slackpkg - how to use it? markush Slackware 2 03-30-2011 05:31 PM

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

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