Gentoo Archives: gentoo-commits

From: "Michal Gorny (mgorny)" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/systemd/files: update-etc-systemd-symlinks.service update-etc-systemd-symlinks.path update-etc-systemd-symlinks.sh
Date: Fri, 06 Jan 2012 10:19:54
Message-Id: 20120106101944.4B0902004C@flycatcher.gentoo.org
1 mgorny 12/01/06 10:19:44
2
3 Added: update-etc-systemd-symlinks.service
4 update-etc-systemd-symlinks.path
5 update-etc-systemd-symlinks.sh
6 Log:
7 Migrate to /usr.
8
9 (Portage version: 2.2.0_alpha84/cvs/Linux x86_64)
10
11 Revision Changes Path
12 1.1 sys-apps/systemd/files/update-etc-systemd-symlinks.service
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/systemd/files/update-etc-systemd-symlinks.service?rev=1.1&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/systemd/files/update-etc-systemd-symlinks.service?rev=1.1&content-type=text/plain
16
17 Index: update-etc-systemd-symlinks.service
18 ===================================================================
19 [Unit]
20 Description=Update /etc/systemd/system symlinks for units moved to /usr
21
22 [Service]
23 Type=oneshot
24 ExecStart=/usr/libexec/systemd/update-etc-systemd-symlinks.sh
25
26
27
28 1.1 sys-apps/systemd/files/update-etc-systemd-symlinks.path
29
30 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/systemd/files/update-etc-systemd-symlinks.path?rev=1.1&view=markup
31 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/systemd/files/update-etc-systemd-symlinks.path?rev=1.1&content-type=text/plain
32
33 Index: update-etc-systemd-symlinks.path
34 ===================================================================
35 [Unit]
36 Description=Update /etc/systemd/system symlinks for units moved to /usr
37
38 [Path]
39 PathChanged=/lib/systemd/system
40
41
42
43 1.1 sys-apps/systemd/files/update-etc-systemd-symlinks.sh
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/systemd/files/update-etc-systemd-symlinks.sh?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/systemd/files/update-etc-systemd-symlinks.sh?rev=1.1&content-type=text/plain
47
48 Index: update-etc-systemd-symlinks.sh
49 ===================================================================
50 #!/bin/sh
51 # Update symlinks to systemd units moved into /usr/systemd.
52 # (c) 2012 Michał Górny
53 # Released under the terms of the 2-clause BSD license
54
55 IFS_SAVE=${IFS}
56 IFS='
57 '
58 # follow + symlink type will match broken symlinks only
59 set -- $(find -L /etc/systemd/system -type l -print)
60 IFS=${IFS_SAVE}
61
62 for f; do
63 old_path=$(readlink "${f}")
64 new_path=/usr/lib${old_path#/lib}
65 if [ -f "${new_path}" ]; then
66 ln -v -s -f "${new_path}" "${f}"
67 fi
68 done