Skip to content

Commit

Permalink
spec: clean old fedup junk and migrate pkg cache
Browse files Browse the repository at this point in the history
If we're replacing fedup, then we should clean up old fedup junk - boot
images, bootloader entry, /system-upgrade symlink, etc. - but we should
try to keep the package cache, if possible, so the user doesn't have to
download everything again.

The easiest way to handle this is to do it in %pre, so we can move the
cache and then just tell fedup to clean up whatever's left *before* it
gets deleted.

Resolves: rhbz#1264948
  • Loading branch information
wgwoods committed Sep 22, 2015
1 parent 8432705 commit 72b9b1c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dnf-plugin-system-upgrade.spec
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ make install-plugin DESTDIR=$RPM_BUILD_ROOT PYTHON=%{__python3}
make check PYTHON=%{__python2}
make check PYTHON=%{__python3}

%pre
# if we're replacing fedup, we need to make sure it cleans up its leftovers.
# (see https://bugzilla.redhat.com/show_bug.cgi?id=1264948)
if [ "$1" == 1 -a -x /usr/bin/fedup ]; then
# save the old package cache (if the new one isn't populated)
if [ -d /var/lib/system-upgrade ]; then
mv -f -T /var/lib/system-upgrade /var/lib/dnf/system-upgrade || :
fi
# clean up everything else
/usr/bin/fedup --clean || :
fi

%files -f %{name}.lang
%license LICENSE
%doc README.md
Expand Down

0 comments on commit 72b9b1c

Please sign in to comment.