aura 3.1.4 → 3.1.5
raw patch · 16 files changed
+169/−150 lines, 16 filesdep ~rioPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: rio
API changes (from Hackage documentation)
+ Aura.Languages: translators :: Map Language Text
- Aura.Pkgbuild.Security: BannedTerm :: Text -> BanCategory -> BannedTerm
+ Aura.Pkgbuild.Security: BannedTerm :: !Text -> !BanCategory -> BannedTerm
- Aura.Settings: Colour :: ColourMode -> CommonSwitch
+ Aura.Settings: Colour :: !ColourMode -> CommonSwitch
- Aura.Settings: Head :: Word -> Truncation
+ Aura.Settings: Head :: !Word -> Truncation
- Aura.Settings: Overwrite :: Text -> CommonSwitch
+ Aura.Settings: Overwrite :: !Text -> CommonSwitch
- Aura.Settings: Tail :: Word -> Truncation
+ Aura.Settings: Tail :: !Word -> Truncation
- Aura.Settings.External: AuraConfig :: Maybe Language -> Maybe FilePath -> Maybe User -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> Maybe BuildSwitch -> AuraConfig
+ Aura.Settings.External: AuraConfig :: !Maybe Language -> !Maybe FilePath -> !Maybe User -> !Maybe FilePath -> !Maybe FilePath -> !Maybe FilePath -> !Maybe BuildSwitch -> AuraConfig
- Aura.Settings.External: [acASPath] :: AuraConfig -> Maybe FilePath
+ Aura.Settings.External: [acASPath] :: AuraConfig -> !Maybe FilePath
- Aura.Settings.External: [acAnalyse] :: AuraConfig -> Maybe BuildSwitch
+ Aura.Settings.External: [acAnalyse] :: AuraConfig -> !Maybe BuildSwitch
- Aura.Settings.External: [acBuildPath] :: AuraConfig -> Maybe FilePath
+ Aura.Settings.External: [acBuildPath] :: AuraConfig -> !Maybe FilePath
- Aura.Settings.External: [acEditor] :: AuraConfig -> Maybe FilePath
+ Aura.Settings.External: [acEditor] :: AuraConfig -> !Maybe FilePath
- Aura.Settings.External: [acLang] :: AuraConfig -> Maybe Language
+ Aura.Settings.External: [acLang] :: AuraConfig -> !Maybe Language
- Aura.Settings.External: [acUser] :: AuraConfig -> Maybe User
+ Aura.Settings.External: [acUser] :: AuraConfig -> !Maybe User
- Aura.Settings.External: [acVCSPath] :: AuraConfig -> Maybe FilePath
+ Aura.Settings.External: [acVCSPath] :: AuraConfig -> !Maybe FilePath
- Aura.Types: AtLeast :: Versioning -> VersionDemand
+ Aura.Types: AtLeast :: !Versioning -> VersionDemand
- Aura.Types: BrokenProvides :: PkgName -> Provides -> PkgName -> DepError
+ Aura.Types: BrokenProvides :: !PkgName -> !Provides -> !PkgName -> DepError
- Aura.Types: Build :: Buildable -> InstallType
+ Aura.Types: Build :: !Buildable -> InstallType
- Aura.Types: FromAUR :: Buildable -> Package
+ Aura.Types: FromAUR :: !Buildable -> Package
- Aura.Types: FromRepo :: Prebuilt -> Package
+ Aura.Types: FromRepo :: !Prebuilt -> Package
- Aura.Types: Ignored :: Doc AnsiStyle -> DepError
+ Aura.Types: Ignored :: !Doc AnsiStyle -> DepError
- Aura.Types: LessThan :: Versioning -> VersionDemand
+ Aura.Types: LessThan :: !Versioning -> VersionDemand
- Aura.Types: MoreThan :: Versioning -> VersionDemand
+ Aura.Types: MoreThan :: !Versioning -> VersionDemand
- Aura.Types: MustBe :: Versioning -> VersionDemand
+ Aura.Types: MustBe :: !Versioning -> VersionDemand
- Aura.Types: NonExistant :: PkgName -> PkgName -> DepError
+ Aura.Types: NonExistant :: !PkgName -> !PkgName -> DepError
- Aura.Types: Pacman :: PkgName -> InstallType
+ Aura.Types: Pacman :: !PkgName -> InstallType
- Aura.Types: VerConflict :: Doc AnsiStyle -> DepError
+ Aura.Types: VerConflict :: !Doc AnsiStyle -> DepError
- Aura.Utils: Pattern :: Text -> Text -> Pattern
+ Aura.Utils: Pattern :: !Text -> !Text -> Pattern
- Aura.Utils: [_pattern] :: Pattern -> Text
+ Aura.Utils: [_pattern] :: Pattern -> !Text
- Aura.Utils: [_target] :: Pattern -> Text
+ Aura.Utils: [_target] :: Pattern -> !Text
Files
- CHANGELOG.md +10/−0
- aura.cabal +2/−2
- exec/Aura/Commands/L.hs +4/−4
- exec/Aura/Flags.hs +72/−70
- exec/Aura/Settings/Runtime.hs +1/−2
- exec/aura.hs +1/−2
- lib/Aura/Core.hs +0/−1
- lib/Aura/Dependencies.hs +14/−9
- lib/Aura/Install.hs +10/−3
- lib/Aura/Languages.hs +31/−31
- lib/Aura/Pacman.hs +1/−2
- lib/Aura/Pkgbuild/Security.hs +2/−1
- lib/Aura/Settings.hs +2/−2
- lib/Aura/Settings/External.hs +8/−8
- lib/Aura/Types.hs +10/−11
- lib/Aura/Utils.hs +1/−2
CHANGELOG.md view
@@ -1,5 +1,15 @@ # Aura Changelog +## 3.1.5 (2020-07-15)++#### Changed++- Updated Spanish translations. Thank you, Max Ferrer!++#### Fixed++- Provide better output when a listed dependency doesn't exist.+ ## 3.1.4 (2020-06-11) #### Fixed
aura.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: aura-version: 3.1.4+version: 3.1.5 synopsis: A secure package manager for Arch Linux and the AUR. description: Aura is a package manager for Arch Linux. It connects to both the@@ -44,7 +44,7 @@ , bytestring ^>=0.10 , containers ^>=0.6 , megaparsec >=7 && <9- , rio ^>=0.1.16+ , rio ^>=0.1.17 , text ^>=1.2 , versions ^>=3.5.4
exec/Aura/Commands/L.hs view
@@ -32,10 +32,10 @@ newtype Log = Log [Text] data LogEntry = LogEntry- { name :: PkgName- , firstInstall :: Text- , upgrades :: Word- , recent :: [Text] }+ { name :: !PkgName+ , firstInstall :: !Text+ , upgrades :: !Word+ , recent :: ![Text] } -- | Pipes the pacman log file through a @less@ session. viewLogFile :: RIO Env ()
exec/Aura/Flags.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE OverloadedLists #-}+ module Aura.Flags ( Program(..), opts , PacmanOp( Sync ), SyncOp( SyncUpgrade ), SyncSwitch(..), MiscOp@@ -23,27 +25,27 @@ -- | A description of a run of Aura to attempt. data Program = Program {- _operation :: Either (PacmanOp, Set MiscOp) AuraOp+ _operation :: !(Either (PacmanOp, Set MiscOp) AuraOp) -- ^ Whether Aura handles everything, or the ops and input are just passed down to Pacman.- , _commons :: CommonConfig+ , _commons :: !CommonConfig -- ^ Settings common to both Aura and Pacman.- , _buildConf :: BuildConfig+ , _buildConf :: !BuildConfig -- ^ Settings specific to building packages.- , _language :: Maybe Language+ , _language :: !(Maybe Language) -- ^ The human language of text output.- , _logLevel :: LogLevel+ , _logLevel :: !LogLevel -- ^ The default RIO logging level. } deriving (Show) -- | Inherited operations that are fed down to Pacman. data PacmanOp- = Database (Either DatabaseOp (NonEmpty PkgName))- | Files (Set FilesOp)- | Query (Either QueryOp (Set QueryFilter, Set PkgName))- | Remove (Set RemoveOp) (NonEmpty PkgName)- | Sync (Either (NonEmpty SyncOp) (Set PkgName)) (Set SyncSwitch)- | TestDeps (NonEmpty Text)- | Upgrade (Set UpgradeSwitch) (NonEmpty PkgName)+ = Database !(Either DatabaseOp (NonEmpty PkgName))+ | Files !(Set FilesOp)+ | Query !(Either QueryOp (Set QueryFilter, Set PkgName))+ | Remove !(Set RemoveOp) !(NonEmpty PkgName)+ | Sync !(Either (NonEmpty SyncOp) (Set PkgName)) !(Set SyncSwitch)+ | TestDeps !(NonEmpty Text)+ | Upgrade !(Set UpgradeSwitch) !(NonEmpty PkgName) deriving (Show) instance Flagable PacmanOp where@@ -60,8 +62,8 @@ data DatabaseOp = DBCheck- | DBAsDeps (NonEmpty Text)- | DBAsExplicit (NonEmpty Text)+ | DBAsDeps !(NonEmpty Text)+ | DBAsExplicit !(NonEmpty Text) deriving (Show) instance Flagable DatabaseOp where@@ -70,9 +72,9 @@ asFlag (DBAsExplicit ps) = "--asexplicit" : asFlag ps data FilesOp- = FilesList (NonEmpty Text)- | FilesOwns Text- | FilesSearch Text+ = FilesList !(NonEmpty Text)+ | FilesOwns !Text+ | FilesSearch !Text | FilesRegex | FilesRefresh | FilesMachineReadable@@ -87,14 +89,14 @@ asFlag FilesMachineReadable = ["--machinereadable"] data QueryOp- = QueryChangelog (NonEmpty Text)- | QueryGroups (NonEmpty Text)- | QueryInfo (NonEmpty Text)- | QueryCheck (NonEmpty Text)- | QueryList (NonEmpty Text)- | QueryOwns (NonEmpty Text)- | QueryFile (NonEmpty Text)- | QuerySearch Text+ = QueryChangelog !(NonEmpty Text)+ | QueryGroups !(NonEmpty Text)+ | QueryInfo !(NonEmpty Text)+ | QueryCheck !(NonEmpty Text)+ | QueryList !(NonEmpty Text)+ | QueryOwns !(NonEmpty Text)+ | QueryFile !(NonEmpty Text)+ | QuerySearch !Text deriving (Show) instance Flagable QueryOp where@@ -139,12 +141,12 @@ data SyncOp = SyncClean- | SyncGroups (NonEmpty Text)- | SyncInfo (NonEmpty Text)- | SyncList Text- | SyncSearch (NonEmpty Text)- | SyncUpgrade (Set Text)- | SyncDownload (NonEmpty Text)+ | SyncGroups !(NonEmpty Text)+ | SyncInfo !(NonEmpty Text)+ | SyncList !Text+ | SyncSearch !(NonEmpty Text)+ | SyncUpgrade !(Set Text)+ | SyncDownload !(NonEmpty Text) deriving (Eq, Ord, Show) instance Flagable SyncOp where@@ -158,9 +160,9 @@ data SyncSwitch = SyncRefresh- | SyncIgnore (Set PkgName)- | SyncIgnoreGroup (Set PkgGroup)- | SyncOverwrite Text+ | SyncIgnore !(Set PkgName)+ | SyncIgnoreGroup !(Set PkgGroup)+ | SyncOverwrite !Text deriving (Eq, Ord, Show) instance Flagable SyncSwitch where@@ -172,9 +174,9 @@ data UpgradeSwitch = UpgradeAsDeps | UpgradeAsExplicit- | UpgradeIgnore (Set PkgName)- | UpgradeIgnoreGroup (Set PkgGroup)- | UpgradeOverwrite Text+ | UpgradeIgnore !(Set PkgName)+ | UpgradeIgnoreGroup !(Set PkgGroup)+ | UpgradeOverwrite !Text deriving (Eq, Ord, Show) instance Flagable UpgradeSwitch where@@ -186,20 +188,20 @@ -- | Flags common to several Pacman operations. data MiscOp- = MiscArch FilePath- | MiscAssumeInstalled Text- | MiscColor Text+ = MiscArch !FilePath+ | MiscAssumeInstalled !Text+ | MiscColor !Text | MiscConfirm | MiscDBOnly- | MiscDBPath FilePath- | MiscGpgDir FilePath- | MiscHookDir FilePath+ | MiscDBPath !FilePath+ | MiscGpgDir !FilePath+ | MiscHookDir !FilePath | MiscNoDeps | MiscNoProgress | MiscNoScriptlet | MiscPrint- | MiscPrintFormat Text- | MiscRoot FilePath+ | MiscPrintFormat !Text+ | MiscRoot !FilePath | MiscVerbose deriving (Eq, Ord, Show) @@ -222,12 +224,12 @@ -- | Operations unique to Aura. data AuraOp- = AurSync (Either AurOp (NonEmpty PkgName)) (Set AurSwitch)- | Backup (Maybe BackupOp)- | Cache (Either CacheOp (NonEmpty PkgName))- | Log (Maybe LogOp)- | Orphans (Maybe OrphanOp)- | Analysis (Maybe AnalysisOp)+ = AurSync !(Either AurOp (NonEmpty PkgName)) !(Set AurSwitch)+ | Backup !(Maybe BackupOp)+ | Cache !(Either CacheOp (NonEmpty PkgName))+ | Log !(Maybe LogOp)+ | Orphans !(Maybe OrphanOp)+ | Analysis !(Maybe AnalysisOp) | Version | Languages | ViewConf@@ -238,18 +240,18 @@ _AurSync _ x = pure x data AurOp- = AurDeps (NonEmpty PkgName)- | AurInfo (NonEmpty PkgName)- | AurPkgbuild (NonEmpty PkgName)- | AurSearch Text- | AurUpgrade (Set PkgName)- | AurJson (NonEmpty PkgName)- | AurTarball (NonEmpty PkgName)+ = AurDeps !(NonEmpty PkgName)+ | AurInfo !(NonEmpty PkgName)+ | AurPkgbuild !(NonEmpty PkgName)+ | AurSearch !Text+ | AurUpgrade !(Set PkgName)+ | AurJson !(NonEmpty PkgName)+ | AurTarball !(NonEmpty PkgName) deriving (Show) data AurSwitch- = AurIgnore (Set PkgName)- | AurIgnoreGroup (Set PkgGroup)+ = AurIgnore !(Set PkgName)+ | AurIgnoreGroup !(Set PkgGroup) | AurRepoSync deriving (Eq, Ord, Show) @@ -262,30 +264,30 @@ _AurIgnoreGroup _ x = pure x data BackupOp- = BackupClean Word+ = BackupClean !Word | BackupRestore | BackupList deriving (Show) data CacheOp- = CacheBackup FilePath- | CacheClean Word+ = CacheBackup !FilePath+ | CacheClean !Word | CacheCleanNotSaved- | CacheSearch Text+ | CacheSearch !Text deriving (Show) data LogOp- = LogInfo (NonEmpty PkgName)- | LogSearch Text+ = LogInfo !(NonEmpty PkgName)+ | LogSearch !Text deriving (Show) data OrphanOp = OrphanAbandon- | OrphanAdopt (NonEmpty PkgName)+ | OrphanAdopt !(NonEmpty PkgName) deriving (Show) data AnalysisOp- = AnalysisFile FilePath- | AnalysisDir FilePath+ = AnalysisFile !FilePath+ | AnalysisDir !FilePath | AnalysisAudit deriving (Show) @@ -559,7 +561,7 @@ manyArgs' = S.fromList <$> many (argument str (metavar "PACKAGES" <> hidden)) language :: Parser Language-language = foldr1 (<|>) $ map (\(f, v) -> flag' v (long f <> hidden)) langs+language = foldr1 (<|>) $ NEL.map (\(f, v) -> flag' v (long f <> hidden)) langs where langs = [ ( "japanese", Japanese ), ( "日本語", Japanese ) , ( "polish", Polish ), ( "polski", Polish ) , ( "croatian", Croatian ), ( "hrvatski", Croatian )
exec/Aura/Settings/Runtime.hs view
@@ -34,10 +34,9 @@ import Aura.Shell import Aura.Types import Aura.Utils-import Data.Bifunctor (Bifunctor(..)) import Network.HTTP.Client (newManager) import Network.HTTP.Client.TLS (tlsManagerSettings)-import RIO hiding (first)+import RIO import RIO.Lens (each, _Left, _Right) import qualified RIO.Map as M import qualified RIO.Set as S
exec/aura.hs view
@@ -51,11 +51,10 @@ import Aura.Settings.Runtime import Aura.Types import Aura.Utils (nes)-import Data.Bifunctor (first) import Data.Text.Prettyprint.Doc import Data.Text.Prettyprint.Doc.Render.Terminal import Options.Applicative (execParser)-import RIO hiding (first)+import RIO import RIO.FilePath import qualified RIO.Set as S import System.Process.Typed (proc, runProcess)
lib/Aura/Core.hs view
@@ -40,7 +40,6 @@ import Aura.Types import Aura.Utils import Control.Monad.Trans.Maybe-import Data.Bifunctor (bimap) import Data.Text.Prettyprint.Doc import Data.Text.Prettyprint.Doc.Render.Terminal import RIO hiding ((<>))
lib/Aura/Dependencies.hs view
@@ -34,8 +34,8 @@ -- | The results of dependency resolution. data Resolution = Resolution- { toInstall :: Map PkgName Package- , satisfied :: Set PkgName }+ { toInstall :: !(Map PkgName Package)+ , satisfied :: !(Set PkgName) } deriving (Generic) toInstallL :: Lens' Resolution (Map PkgName Package)@@ -51,13 +51,18 @@ -- Deeper layers of the result list (generally) depend on the previous layers. resolveDeps :: Repository -> NonEmpty Package -> RIO Env (NonEmpty (NonEmpty Package)) resolveDeps repo ps = do+ logDebug "resolveDeps: Entered." ss <- asks settings- res <- liftIO $ (Just <$> resolveDeps' ss repo ps) `catchAny` const (pure Nothing)- Resolution m s <- maybe (throwM $ Failure connectFailure_1) pure res+ res <- liftIO (Right <$> resolveDeps' ss repo ps) `catchAny` handleError+ Resolution m s <- either throwM pure res+ logDebug "resolveDeps: Successful recursive dep lookup." unless (length ps == length m) $ putText "\n" let de = conflicts ss m s unless (null de) . throwM . Failure $ missingPkg_2 de either throwM pure $ sortInstall m+ where+ handleError :: SomeException -> RIO Env (Either Failure a)+ handleError e = pure . Left . Failure . dependencyLookup_1 $ tshow e -- | Solve dependencies for a set of `Package`s assumed to not be -- installed/satisfied.@@ -97,16 +102,16 @@ f :: NonEmpty Dep -> Set PkgName f = S.fromList . NEL.toList . NEL.map dName - -- TODO What about if `repoLookup` reports deps that don't exist?- -- i.e. the left-hand side of the tuple. -- | Lookup unsatisfied deps and recurse the entire lookup process. lookups :: Resolution -> Unsatisfied -> IO Resolution lookups r (Unsatisfied ds) = do let names = NEL.map dName ds repoLookup repo ss names >>= \case- Nothing -> throwString "AUR Connection Error"- Just (_, could) -> case nes could of- Nothing -> throwString "Non-existant deps"+ Nothing -> throwString "Unexpected AUR Connection Error"+ Just (bads, could) -> case nes could of+ Nothing -> do+ let badNames = unwords . map (T.unpack . pnName) $ S.toList bads+ throwString $ "Non-existant deps: " <> badNames Just goods -> resolve r goods conflicts :: Settings -> Map PkgName Package -> Set PkgName -> [DepError]
lib/Aura/Install.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE BangPatterns #-}+{-# LANGUAGE LambdaCase #-} {-# LANGUAGE ViewPatterns #-} -- |@@ -117,7 +118,7 @@ bs' = foldMap NEL.toList bs g :: NonEmpty Buildable -> Maybe (NonEmpty Buildable)- g = NEL.nonEmpty . L.nub . NEL.filter (\b -> bName b `S.member` goods)+ g = NEL.nonEmpty . nubOrd . NEL.filter (\b -> bName b `S.member` goods) f :: Buildable -> Buildable -> Buildable f a b | bName a == bBase a = a@@ -182,14 +183,20 @@ -- | Display dependencies. The result of @-Ad@. displayPkgDeps :: NonEmpty PkgName -> RIO Env () displayPkgDeps ps = do+ logDebug "-Ad: Checking dependencies." rpstry <- asks repository ss <- asks settings let f :: NonEmpty Buildable -> RIO Env () f = depsToInstall rpstry >=> reportDeps (switch ss LowVerbosity) . partitionPkgs - (_, goods) <- liftMaybeM (Failure connectFailure_1) . liftIO $ aurLookup (managerOf ss) ps- traverse_ f $ nes goods+ liftIO (aurLookup (managerOf ss) ps) >>= \case+ Nothing -> do+ logDebug "-Ad: Receiving `Nothing` from `aurLookup`."+ throwM $ Failure connectFailure_1+ Just (_, goods) -> do+ logDebug "-Ad: Initial AUR lookup successful."+ traverse_ f $ nes goods where reportDeps :: Bool -> ([Prebuilt], [NonEmpty Buildable]) -> RIO Env () reportDeps True = liftIO . uncurry reportListOfDeps
lib/Aura/Languages.hs view
@@ -14,25 +14,6 @@ -- All output strings that a user can be shown. -- All normal restrictions on line length do not apply for this file, and this file only. -{- AURA TRANSLATORS - Thank you all-Chris "Kwpolska" Warrick | Polish-Denis Kasak / "stranac" | Croatian-Fredrik Haikarainen / Daniel Beecham | Swedish-Lukas Niederbremer / Jonas Platte | German-Alejandro Gómez / Sergio Conde / Max Ferrer | Spanish-Henry Kupty / Thiago Perrotta / Wagner Amaral | Portuguese-Ma Jiehong / Fabien Dubosson | French-Kyrylo Silin | Russian-Bob Valantin / Cristian Tentella | Italian-Filip Brcic | Serbian-"chinatsun" | Norwegian-"pak tua Greg" | Indonesia-Kai Zhang | Chinese-Onoue Takuro | Japanese-Zachary "Ghosy" Matthews | Esperanto-Joris Blanken | Dutch--}- module Aura.Languages where import Aura.Colour@@ -49,6 +30,7 @@ --- +-- | Thank you all! translators :: Map Language Text translators = M.fromList [ (Polish, "Chris Warrick")@@ -229,11 +211,13 @@ buildPackages_2 :: Language -> Doc AnsiStyle buildPackages_2 = \case- _ -> "'--allsource' detected. No actual installable packages will be built."+ Spanish -> "'--allsource' detectado. No se construirán paquetes instalables reales."+ _ -> "'--allsource' detected. No actual installable packages will be built." buildPackages_3 :: FilePath -> Language -> Doc AnsiStyle buildPackages_3 fp = \case- _ -> "All .src.tar.gz files were built and copied to: " <> pretty fp+ Spanish -> "Todos los archivos .src.tar.gz fueron construidos y copiados a: " <> pretty fp+ _ -> "All .src.tar.gz files were built and copied to: " <> pretty fp buildFail_5 :: Language -> Doc AnsiStyle buildFail_5 = \case@@ -330,7 +314,8 @@ buildFail_12 :: Language -> Doc AnsiStyle buildFail_12 = \case- _ -> "Failed to 'git pull' the latest updates."+ Spanish -> "Error al 'git pull' las últimas actualizaciones."+ _ -> "Failed to 'git pull' the latest updates." ------------------------------ -- Aura/Dependencies functions@@ -418,6 +403,7 @@ missingPkg_5 :: PkgName -> Language -> Doc AnsiStyle missingPkg_5 (PkgName p) = \case+ Spanish -> bt p <> " no existe." Italian -> bt p <> " non esiste." Dutch -> bt p <> " bestaat niet." _ -> bt p <> " does not exist."@@ -1176,11 +1162,13 @@ cleanCache_7 :: Word -> Word -> Language -> Doc AnsiStyle cleanCache_7 (bt . tshow -> ps) (bt . tshow -> bytes) = \case- _ -> "The cache contains " <> ps <> " packages, consuming " <> bytes <> " megabytes."+ Spanish -> "La caché contiene " <> ps <> " paquetes, consumiendo " <> bytes <> " megabytes."+ _ -> "The cache contains " <> ps <> " packages, consuming " <> bytes <> " megabytes." cleanCache_8 :: Word -> Language -> Doc AnsiStyle cleanCache_8 (bt . tshow -> bytes) = \case- _ -> bytes <> " megabytes freed."+ Spanish -> bytes <> " megabytes liberados."+ _ -> bytes <> " megabytes freed." -- NEEDS TRANSLATION cleanNotSaved_1 :: Language -> Doc AnsiStyle@@ -1263,15 +1251,21 @@ Dutch -> "Contact opnemen met de AUR mislukt. Heeft U een internet connectie?" _ -> "Failed to contact the AUR. Do you have an internet connection?" +dependencyLookup_1 :: Text -> Language -> Doc AnsiStyle+dependencyLookup_1 t = \case+ _ -> vsep ["There was an issue during recursive dependency lookup:", pretty t]+ miscAURFailure_1 :: Language -> Doc AnsiStyle miscAURFailure_1 = \case+ Spanish -> "El contacto con el AUR falló de alguna manera desconocida." Italian -> "C'è stato un errore sconosciuto nel contattare l'AUR." Dutch -> "Contact opnemen met de AUR is op een onbekende manier mislukt." _ -> "Contacting the AUR failed in some unknown way." miscAURFailure_3 :: Language -> Doc AnsiStyle miscAURFailure_3 = \case- _ -> "The JSON returned from the AUR server could not be decoded."+ Spanish -> "El JSON devuelto por el servidor AUR no se pudo decodificar."+ _ -> "The JSON returned from the AUR server could not be decoded." infoFields :: Language -> [Text] infoFields = sequence [ Fields.repository@@ -1506,11 +1500,13 @@ hotEdit_2 :: Language -> Doc AnsiStyle hotEdit_2 = \case- _ -> "Would you like to edit the .install file?"+ Spanish -> "¿Desea editar el archivo .install?"+ _ -> "Would you like to edit the .install file?" hotEdit_3 :: FilePath -> Language -> Doc AnsiStyle hotEdit_3 fp = \case- _ -> "Would you like to edit " <> pretty fp <> "?"+ Spanish -> "¿Desea editar " <> pretty fp <> "?"+ _ -> "Would you like to edit " <> pretty fp <> "?" ------------------------------ -- Pkgbuild Security functions@@ -1587,19 +1583,23 @@ security_11 :: Language -> Doc AnsiStyle security_11 = \case- _ -> "That PKGBUILD is too complex to parse - it may be obfuscating malicious code."+ Spanish -> "Éste PKGBUILD es demasiado complejo para analizar, puede estar ofuscando código malicioso."+ _ -> "That PKGBUILD is too complex to parse - it may be obfuscating malicious code." security_12 :: Language -> Doc AnsiStyle security_12 = \case- _ -> "Potential PKGBUILD vulnerabilities detected."+ Spanish -> "Posibles vulnerabilidades de PKGBUILD detectadas."+ _ -> "Potential PKGBUILD vulnerabilities detected." security_13 :: Word -> Language -> Doc AnsiStyle security_13 (bt -> w) = \case- _ -> "Checking" <+> w <+> "PKGBUILDs for vulnerabilities..."+ Spanish -> "Comprobando" <+> w <+> "PKGBUILDs por vulnerabilidades..."+ _ -> "Checking" <+> w <+> "PKGBUILDs for vulnerabilities..." security_14 :: Language -> Doc AnsiStyle security_14 = \case- _ -> "No vulnerabilities detected."+ Spanish -> "No se detectaron vulnerabilidades."+ _ -> "No vulnerabilities detected." ----------------------- -- Aura/Utils functions
lib/Aura/Pacman.hs view
@@ -31,8 +31,7 @@ import Aura.Languages import Aura.Settings.External import Aura.Types-import Data.Bifunctor (first)-import RIO hiding (first, some, try)+import RIO hiding (some, try) import qualified RIO.ByteString as BS import qualified RIO.ByteString.Lazy as BL import RIO.FilePath
lib/Aura/Pkgbuild/Security.hs view
@@ -32,7 +32,8 @@ -- | A bash term which should never appear in a PKGBUILD. If one does, it's -- either a sign of maintainer negligence or malicious behaviour.-data BannedTerm = BannedTerm Text BanCategory deriving (Eq, Ord, Show, Generic)+data BannedTerm = BannedTerm !Text !BanCategory+ deriving (Eq, Ord, Show, Generic) banCatL :: Lens' BannedTerm BanCategory banCatL f (BannedTerm t bc) = BannedTerm t <$> f bc
lib/Aura/Settings.hs view
@@ -36,7 +36,7 @@ --- -- | How @-As@ should truncate its results.-data Truncation = None | Head Word | Tail Word deriving (Eq, Show)+data Truncation = None | Head !Word | Tail !Word deriving (Eq, Show) -- | CLI flags that will be passed down to @makepkg@ when building packages. data Makepkg = IgnoreArch | AllSource | SkipInteg | SkipPGP deriving (Eq, Ord, Show)@@ -71,7 +71,7 @@ -- | Yes/No-style switches that are common to both Aura and Pacman. -- Aura acts on them first, then passes them down to @pacman@ if necessary.-data CommonSwitch = NoConfirm | NeededOnly | Debug | Colour ColourMode | Overwrite Text+data CommonSwitch = NoConfirm | NeededOnly | Debug | Colour !ColourMode | Overwrite !Text deriving (Eq, Ord, Show) instance Flagable CommonSwitch where
lib/Aura/Settings/External.hs view
@@ -23,7 +23,7 @@ import Aura.Languages (langFromLocale) import Aura.Settings import Aura.Types-import RIO hiding (first, some, try)+import RIO hiding (some, try) import qualified RIO.ByteString as BS import RIO.Directory import qualified RIO.Map as M@@ -36,13 +36,13 @@ -- Aura-specific Configuration data AuraConfig = AuraConfig- { acLang :: Maybe Language- , acEditor :: Maybe FilePath- , acUser :: Maybe User- , acBuildPath :: Maybe FilePath- , acASPath :: Maybe FilePath- , acVCSPath :: Maybe FilePath- , acAnalyse :: Maybe BuildSwitch }+ { acLang :: !(Maybe Language)+ , acEditor :: !(Maybe FilePath)+ , acUser :: !(Maybe User)+ , acBuildPath :: !(Maybe FilePath)+ , acASPath :: !(Maybe FilePath)+ , acVCSPath :: !(Maybe FilePath)+ , acAnalyse :: !(Maybe BuildSwitch) } deriving stock (Show) defaultAuraConf :: FilePath
lib/Aura/Types.hs view
@@ -42,7 +42,6 @@ import Aura.Utils import Data.Aeson (FromJSONKey, ToJSONKey)-import Data.Bitraversable import Data.Text.Prettyprint.Doc hiding (list, space) import Data.Text.Prettyprint.Doc.Render.Terminal import Data.Versions hiding (Traversal')@@ -65,7 +64,7 @@ asFlag = foldMap asFlag -- | A package to be installed.-data Package = FromRepo Prebuilt | FromAUR Buildable deriving (Eq)+data Package = FromRepo !Prebuilt | FromAUR !Buildable deriving (Eq) -- | The name of a `Package`. pname :: Package -> PkgName@@ -154,10 +153,10 @@ asT Anything = "" -- | The versioning requirement of some package's dependency.-data VersionDemand = LessThan Versioning- | AtLeast Versioning- | MoreThan Versioning- | MustBe Versioning+data VersionDemand = LessThan !Versioning+ | AtLeast !Versioning+ | MoreThan !Versioning+ | MustBe !Versioning | Anything deriving (Eq, Ord) @@ -177,7 +176,7 @@ _VersionDemand _ p = pure p -- | The installation method.-data InstallType = Pacman PkgName | Build Buildable deriving (Eq)+data InstallType = Pacman !PkgName | Build !Buildable deriving (Eq) -- | A package name with its version number. data SimplePkg = SimplePkg@@ -266,10 +265,10 @@ deriving (Eq, Enum, Bounded, Ord, Show) -- | The various ways that dependency resolution can fail.-data DepError = NonExistant PkgName PkgName- | VerConflict (Doc AnsiStyle)- | Ignored (Doc AnsiStyle)- | BrokenProvides PkgName Provides PkgName+data DepError = NonExistant !PkgName !PkgName+ | VerConflict !(Doc AnsiStyle)+ | Ignored !(Doc AnsiStyle)+ | BrokenProvides !PkgName !Provides !PkgName -- | Some failure message that when given the current runtime `Language` -- will produce a human-friendly error.
lib/Aura/Utils.hs view
@@ -37,7 +37,6 @@ , partNonEmpty ) where -import Data.Bifunctor import Network.HTTP.Client import Network.HTTP.Types.Status (statusCode) import RIO@@ -54,7 +53,7 @@ -- STRING --------- -- | For regex-like find-and-replace in some `Text`.-data Pattern = Pattern { _pattern :: Text, _target :: Text }+data Pattern = Pattern { _pattern :: !Text, _target :: !Text } -- | Find lines which contain some given `Text`. searchLines :: Text -> [Text] -> [Text]