remove old rpms
authorJoey Hess <joeyh@joeyh.name>
Wed, 18 Dec 2019 18:27:47 +0000 (14:27 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 18 Dec 2019 18:27:47 +0000 (14:27 -0400)
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

index b86dc9eaf5ffed2bc5904603232a4cee77806cd8..2b2ef5b60232ff701543961e347f0cb90110e077 100644 (file)
@@ -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