Lines 73-78
Link Here
|
73 |
|
73 |
|
74 |
src_install() { |
74 |
src_install() { |
75 |
local db_path="/var/db/${PN}" |
75 |
local db_path="/var/db/${PN}" |
|
|
76 |
insopts -m0644 -p # preserve timestamps |
76 |
|
77 |
|
77 |
if use daemon; then |
78 |
if use daemon; then |
78 |
default |
79 |
default |
Lines 119-150
Link Here
|
119 |
if use daemon || use update_drivedb; then |
120 |
if use daemon || use update_drivedb; then |
120 |
local initial_db_file="${EPREFIX%/}/usr/share/${PN}/drivedb.h" |
121 |
local initial_db_file="${EPREFIX%/}/usr/share/${PN}/drivedb.h" |
121 |
local db_path="${EPREFIX%/}/var/db/${PN}" |
122 |
local db_path="${EPREFIX%/}/var/db/${PN}" |
|
|
123 |
local real_db_file="${db_path}/drivedb.h" |
122 |
|
124 |
|
123 |
if [[ ! -f "${db_path}/drivedb.h" ]] ; then |
125 |
if [[ -L "${real_db_file}" ]]; then |
124 |
# No initial database found |
126 |
ewarn "Preserving existing symlink '${real_db_file}'." |
125 |
cp "${initial_db_file}" "${db_path}" || die |
127 |
elif [[ -e "${real_db_file}" ]]; then |
126 |
einfo "Default drive database which was shipped with this release of ${PN}" |
128 |
if [[ "${initial_db_file}" -nt "${real_db_file}" ]]; then |
127 |
einfo "has been installed to '${db_path}'." |
129 |
einfo "This release of ${PN} ships with a newer version of" |
128 |
else |
130 |
einfo "drivedb.h than the one currently installed." |
129 |
ewarn "WARNING: There's already a drive database in '${db_path}'!" |
131 |
einfo "Installing updated '${real_db_file}'." |
130 |
ewarn "Because we cannot determine if this database is untouched" |
132 |
cp -p "${initial_db_file}" "${db_path}/" || die |
131 |
ewarn "or was modified by the user you have to manually update the" |
133 |
else |
132 |
ewarn "drive database:" |
134 |
einfo "The drivedb.h shipped with this release of ${PN} is no" |
133 |
ewarn "" |
135 |
einfo "newer than the existing '${real_db_file}'." |
134 |
ewarn "a) Replace '${db_path}/drivedb.h' by the database shipped with this" |
136 |
einfo "Preserving existing drivedb.h." |
135 |
ewarn " release which can be found in '${initial_db_file}', i.e." |
|
|
136 |
ewarn "" |
137 |
ewarn " cp \"${initial_db_file}\" \"${db_path}\"" |
138 |
ewarn "" |
139 |
ewarn "b) Run the following command as root:" |
140 |
ewarn "" |
141 |
ewarn " /usr/sbin/update-smart-drivedb" |
142 |
|
143 |
if ! use update_drivedb ; then |
144 |
ewarn "" |
145 |
ewarn "However, 'update-smart-drivedb' requires that you re-emerge ${PN}" |
146 |
ewarn "with USE='update_drivedb'." |
147 |
fi |
137 |
fi |
|
|
138 |
else |
139 |
# If there is no existing drivedb.h, just silently install ours. |
140 |
cp -p "${initial_db_file}" "${db_path}/" || die |
148 |
fi |
141 |
fi |
149 |
fi |
142 |
fi |
150 |
} |
143 |
} |