From c9a33362358b0694860b8150f12aacca4105c057 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 18 Dec 2019 14:27:47 -0400 Subject: [PATCH] remove old rpms Don't want a mass of old versions of git-annex in rpm form cluttering up my server. Also, makerepo falls over when confronted with a dangling symlink. --- Build/DistributionUpdate.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Build/DistributionUpdate.hs b/Build/DistributionUpdate.hs index b86dc9eaf5..2b2ef5b602 100644 --- a/Build/DistributionUpdate.hs +++ b/Build/DistributionUpdate.hs @@ -220,7 +220,11 @@ virusFree f buildrpms :: FilePath -> [(FilePath, Version)] -> Annex () buildrpms topdir l = do - liftIO $ createDirectoryIfMissing True rpmrepo + liftIO $ do + createDirectoryIfMissing True rpmrepo + oldrpms <- filter (".rpm" `isSuffixOf`) + <$> getDirectoryContents rpmrepo + mapM_ nukeFile oldrpms forM_ tarrpmarches $ \(tararch, rpmarch) -> forM_ (filter (isstandalonetarball tararch . fst) l) $ \(tarball, v) -> void $ liftIO $ boolSystem script