diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2021-10-31 03:26:16 +0100 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2021-10-31 05:38:18 +0100 |
commit | e2d0c0467fb8f5da527f38aa04b2288dbce00a4e (patch) | |
tree | fd34c8d18491bbff6b7541e15a0a933db01ecbf5 /urpm/sys.pm | |
parent | cc60ebdcb51aaa33b212c6161e1706ef4df0c8f3 (diff) | |
download | urpmi-e2d0c0467fb8f5da527f38aa04b2288dbce00a4e.tar urpmi-e2d0c0467fb8f5da527f38aa04b2288dbce00a4e.tar.gz urpmi-e2d0c0467fb8f5da527f38aa04b2288dbce00a4e.tar.bz2 urpmi-e2d0c0467fb8f5da527f38aa04b2288dbce00a4e.tar.xz urpmi-e2d0c0467fb8f5da527f38aa04b2288dbce00a4e.zip |
Convert rpmdb to sqlite also when not chrooted
This is needed for live upgrades, either using urpmi or mgaonline (mga#29364).
Two changes are needed:
- fix detecting rpm version
- fix converting rpmdb when not in a chroot
Diffstat (limited to 'urpm/sys.pm')
-rw-r--r-- | urpm/sys.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/urpm/sys.pm b/urpm/sys.pm index bffb7ced..ce2ab3ae 100644 --- a/urpm/sys.pm +++ b/urpm/sys.pm @@ -317,7 +317,7 @@ sub migrate_rpmdb_to_sqlite { $urpm->{info}("migrating db from bdb to sqlite (rpm >= 4.16)"); # Whatever is the default backend: URPM::add_macro('_db_backend sqlite'); - if (system('chroot', $root, 'rpm', '--rebuilddb') == 0) { + if (system('rpm', '--rebuilddb', ($urpm->{root} ? ('--dbpath', "$urpm->{root}/var/lib/rpm") : @{[]})) == 0) { $urpm->{log}("rpm db converted to sqlite successfully"); } else { $urpm->{error}("rpm db conversion failed. You will not be able to run rpm >= 4.17"); |