Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #195396

regex in apt preferences

From David Griffith <dave@661.org>
Newsgroups linux.debian.user
Subject regex in apt preferences
Date 2018-05-07 10:30 +0200
Message-ID <vMJGW-7gh-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


In my saga of limiting the damage from remnents of systemd, I'm focusing 
in on libsystemd0.  I want to allow only libsystemd0 to be upgradable and 
forbid the installation and/or upgrading of anything else matching 
*systemd*.

Here's what I did so far:

Following http://without-systemd.org/wiki/index.php/Debian_Stretch, it 
suggests adding this entry for /etc/apt/preferences.d/systemd:

Package: *systemd*
Pin: release *
Pin-Priority: -1

This will prevent anything requiring systemd from being accidentally 
installed.  This also prevents libsystemd0 from being updated.  While I 
understand now that it's okay to leave it installed, not updating it 
bothers me.  It has also resulted in a lot of confusion over apt-get(8)'s 
response of "1 not upgraded".  So, I want to explicitly allow libsystemd0 
to be upgraded.  According to the apt_preferences(5) manpage in section 
"Regular expressions and glob(7) syntax", it seems to me that if I add a 
specific rule after the above rule, then libsystemd0 should be allowed yet 
other systemd stuff should be forbidden.  For instance:

Package: libsystemd0
Pin: release *
Pin-Priority: 1001

But that doesn't work.  All packages including libsystemd0 are blocked.

Then I tried a single entry and a regex like this on the "Package:":
 	/((?!.*libsystemd0).*systemd.*)/g or
 	(^|[^l])(^|[^i])(^|[^b])systemd([^0]|$)

Neither of these blocked anything.


-- 
David Griffith
dave@661.org

A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Back to linux.debian.user | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

regex in apt preferences David Griffith <dave@661.org> - 2018-05-07 10:30 +0200
  Re: regex in apt preferences Abdullah Ramazanoğlu <ar018@yahoo.com> - 2018-05-08 00:20 +0200
  Re: regex in apt preferences Abdullah Ramazanoğlu <ar018@yahoo.com> - 2018-05-08 00:20 +0200
    Re: regex in apt preferences David Griffith <dave@661.org> - 2018-05-08 02:40 +0200
      Re: regex in apt preferences Abdullah Ramazanoğlu <ar018@yahoo.com> - 2018-05-08 03:30 +0200

csiph-web