ACCC1380 commited on
Commit
b0d8e8c
1 Parent(s): 99c298a

Upload var/lib/dpkg/info/base-files.postinst with huggingface_hub

Browse files
Files changed (1) hide show
  1. var/lib/dpkg/info/base-files.postinst +177 -0
var/lib/dpkg/info/base-files.postinst ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ set -e
3
+
4
+ install_local_dir() {
5
+ if [ ! -d $1 ]; then
6
+ mkdir -p $1
7
+ fi
8
+ }
9
+
10
+ install_from_default() {
11
+ if [ ! -f $2 ]; then
12
+ cp -p /usr/share/base-files/$1 $2
13
+ fi
14
+ }
15
+
16
+ install_directory() {
17
+ if [ ! -d /$1 ]; then
18
+ mkdir /$1
19
+ chown root:$3 /$1
20
+ chmod $2 /$1
21
+ fi
22
+ }
23
+
24
+ migrate_directory() {
25
+ if [ ! -L $1 ]; then
26
+ rmdir $1
27
+ ln -s $2 $1
28
+ fi
29
+ }
30
+
31
+ update_to_current_default() {
32
+ if [ -f $2 ]; then
33
+ md5=`md5sum $2 | cut -f 1 -d " "`
34
+ if grep -q "$md5" /usr/share/base-files/$1.md5sums; then
35
+ if ! cmp -s /usr/share/base-files/$1 $2; then
36
+ cp -p /usr/share/base-files/$1 $2
37
+ echo Updating $2 to current default.
38
+ fi
39
+ fi
40
+ fi
41
+ }
42
+
43
+ if [ ! -e /etc/dpkg/origins/default ]; then
44
+ if [ -e /etc/dpkg/origins/ubuntu ]; then
45
+ ln -sf ubuntu /etc/dpkg/origins/default
46
+ fi
47
+ fi
48
+
49
+ if [ "$1" = "configure" ] && [ "$2" = "" ]; then
50
+ install_from_default dot.profile /root/.profile
51
+ install_from_default dot.bashrc /root/.bashrc
52
+ install_from_default profile /etc/profile
53
+ install_from_default networks /etc/networks
54
+ install_directory mnt 755 root
55
+ install_directory srv 755 root
56
+ install_directory opt 755 root
57
+ install_directory etc/opt 755 root
58
+ install_directory var/opt 755 root
59
+ install_directory media 755 root
60
+ install_directory var/mail 2775 mail
61
+ if [ ! -L /var/spool/mail ]; then
62
+ ln -s ../mail /var/spool/mail
63
+ fi
64
+ install_directory run/lock 1777 root
65
+ migrate_directory /var/run /run
66
+ migrate_directory /var/lock /run/lock
67
+
68
+ install_local_dir /usr/local
69
+ install_local_dir /usr/local/share
70
+ install_local_dir /usr/local/share/man
71
+ install_local_dir /usr/local/bin
72
+ install_local_dir /usr/local/games
73
+ install_local_dir /usr/local/lib
74
+ install_local_dir /usr/local/include
75
+ install_local_dir /usr/local/sbin
76
+ install_local_dir /usr/local/src
77
+ install_local_dir /usr/local/etc
78
+ ln -sf share/man /usr/local/man
79
+
80
+ if [ ! -f /var/log/wtmp ]; then
81
+ echo -n>/var/log/wtmp
82
+ fi
83
+ if [ ! -f /var/log/btmp ]; then
84
+ echo -n>/var/log/btmp
85
+ fi
86
+ if [ ! -f /var/log/lastlog ]; then
87
+ echo -n>/var/log/lastlog
88
+ fi
89
+ chown root:utmp /var/log/wtmp /var/log/btmp /var/log/lastlog
90
+ chmod 664 /var/log/wtmp /var/log/lastlog
91
+ chmod 660 /var/log/btmp
92
+ if [ ! -f /var/run/utmp ]; then
93
+ echo -n>/var/run/utmp
94
+ fi
95
+ chown root:utmp /var/run/utmp
96
+ chmod 664 /var/run/utmp
97
+ fi
98
+
99
+ if [ ! -d /var/lib/dpkg ]; then
100
+ mkdir -m 755 -p /var/lib/dpkg
101
+ fi
102
+ if [ ! -f /var/lib/dpkg/status ]; then
103
+ echo > /var/lib/dpkg/status
104
+ chmod 644 /var/lib/dpkg/status
105
+ fi
106
+
107
+ if [ ! -f /usr/info/dir ] && [ ! -f /usr/share/info/dir ]; then
108
+ install_from_default info.dir /usr/share/info/dir
109
+ chmod 644 /usr/share/info/dir
110
+ fi
111
+
112
+ if [ "$1" = "configure" ] && [ "$2" != "" ]; then
113
+ # If we're upgrading base-files, remove the upgrade-available flag
114
+ # maintained by update-manager, and rerun the release-upgrade check
115
+ # immediately (in the background) to update the flag.
116
+ rm -f /var/lib/update-notifier/release-upgrade-available
117
+ if [ -x /usr/lib/update-manager/check-new-release ]; then
118
+ /usr/lib/update-manager/check-new-release -q > /var/lib/update-notifier/release-upgrade-available &
119
+ fi
120
+
121
+ update_to_current_default profile /etc/profile
122
+ update_to_current_default dot.profile /root/.profile
123
+ if dpkg --compare-versions "$2" lt-nl "7.7"; then
124
+ install_directory mnt 755 root
125
+ fi
126
+ fi
127
+
128
+ # special case of having /etc/default/motd-news removed by hand
129
+ # signal the motd-news-config package that this happened, so that
130
+ # it does not put back the file with default contents which would
131
+ # re-enable motd-news
132
+ motd_news_config="/etc/default/motd-news"
133
+ if [ ! -e ${motd_news_config} ]; then
134
+ if [ ! -e ${motd_news_config}.dpkg-remove ]; then
135
+ if [ ! -e ${motd_news_config}.dpkg-backup ]; then
136
+ touch ${motd_news_config}.wasremoved
137
+ fi
138
+ fi
139
+ fi
140
+
141
+ # Automatically added by dh_systemd_enable/12.10ubuntu1
142
+ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
143
+ # This will only remove masks created by d-s-h on package removal.
144
+ deb-systemd-helper unmask 'motd-news.timer' >/dev/null || true
145
+
146
+ # was-enabled defaults to true, so new installations run enable.
147
+ if deb-systemd-helper --quiet was-enabled 'motd-news.timer'; then
148
+ # Enables the unit on first installation, creates new
149
+ # symlinks on upgrades if the unit file has changed.
150
+ deb-systemd-helper enable 'motd-news.timer' >/dev/null || true
151
+ else
152
+ # Update the statefile to add new symlinks (if any), which need to be
153
+ # cleaned up on purge. Also remove old symlinks.
154
+ deb-systemd-helper update-state 'motd-news.timer' >/dev/null || true
155
+ fi
156
+ fi
157
+ # End automatically added section
158
+ # Automatically added by dh_systemd_start/12.10ubuntu1
159
+ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
160
+ if [ -d /run/systemd/system ]; then
161
+ systemctl --system daemon-reload >/dev/null || true
162
+ deb-systemd-invoke start 'motd-news.timer' >/dev/null || true
163
+ fi
164
+ fi
165
+ # End automatically added section
166
+ # Automatically added by dh_systemd_start/12.10ubuntu1
167
+ if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
168
+ if [ -d /run/systemd/system ]; then
169
+ systemctl --system daemon-reload >/dev/null || true
170
+ deb-systemd-invoke start 'motd-news.service' >/dev/null || true
171
+ fi
172
+ fi
173
+ # End automatically added section
174
+ # Automatically added by dh_installdeb/12.10ubuntu1
175
+ dpkg-maintscript-helper rm_conffile /etc/default/motd-news 11ubuntu5.2~ base-files -- "$@"
176
+ # End automatically added section
177
+