only delete old rpms for arches that have a new rpm

This commit is contained in:
Joey Hess 2019-12-18 14:32:13 -04:00
parent 73c9a6e7d7
commit 6b2e471330
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -220,13 +220,12 @@ virusFree f
buildrpms :: FilePath -> [(FilePath, Version)] -> Annex ()
buildrpms topdir l = do
liftIO $ do
createDirectoryIfMissing True rpmrepo
oldrpms <- filter (".rpm" `isSuffixOf`)
<$> getDirectoryContents rpmrepo
mapM_ nukeFile oldrpms
liftIO $ createDirectoryIfMissing True rpmrepo
oldrpms <- map (rpmrepo </>) . filter (".rpm" `isSuffixOf`)
<$> getDirectoryContents rpmrepo
forM_ tarrpmarches $ \(tararch, rpmarch) ->
forM_ (filter (isstandalonetarball tararch . fst) l) $ \(tarball, v) ->
forM_ (filter (isstandalonetarball tararch . fst) l) $ \(tarball, v) -> do
mapM_ nukeFile (filter ((tararch ++ ".rpm") `isSuffixOf`) oldrpms)
void $ liftIO $ boolSystem script
[ Param rpmarch
, File tarball