fedora-repoquery 0.8.1 → 0.8.2
raw patch · 8 files changed
+95/−66 lines, 8 files
Files
- ChangeLog.md +7/−1
- README.md +40/−39
- fedora-repoquery.cabal +1/−1
- src/Arch.hs +1/−1
- src/Main.hs +2/−2
- src/Release.hs +36/−16
- src/Types.hs +7/−6
- test/tests.hs +1/−0
ChangeLog.md view
@@ -1,4 +1,10 @@-# Revision history for fedora-repoquery+# Version history for fedora-repoquery++## 0.8.2 (2026-05-10)+- `--all-archs`: also include source and i386+- `--koji`: map epel10 to epel10.x+- `--time` stamp: show warning if url does not exist (no Last-Modified)+- replace EPELNext with EPEL9Next and EPEL10Dot with EpelMinor ## 0.8.1 (2026-03-14) - shorter query aliases: `--wd` (--whatdepends), `--wr` (--whatrequires),
README.md view
@@ -10,7 +10,7 @@ `$ fedora-repoquery rawhide firefox` ```-firefox-148.0-1.fc45.x86_64 (fedora-rawhide)+firefox-150.0.1-1.fc45.x86_64 (fedora-rawhide) ``` (note it is shorter to write `fedora-repoquery 45`). @@ -36,7 +36,7 @@ `$ fedora-repoquery eln kernel` ```-kernel-7.0.0-0.rc3.260312g80234b5ab240.32.eln155.x86_64 (eln-BaseOS)+kernel-7.1.0-0.rc2.260507g8ab992f815d6.19.eln156.x86_64 (eln-BaseOS) ``` Without a release argument, the system yum repo configuration is used:@@ -69,8 +69,8 @@ `$ fedora-repoquery 44` ```-2026-03-13 19:08:04 +08 <https://mirror.freedif.org/fedora/fedora/linux/development/44/>-2026-03-13 09:38:02 +08 <https://mirror.freedif.org/fedora/fedora/linux/updates/testing/44/>+2026-04-24 23:40:25 +08 <https://mirror.freedif.org/fedora/fedora/linux/releases/44/>+2026-05-10 10:47:00 +08 <https://mirror.freedif.org/fedora/fedora/linux/updates/44/> ``` One can also query multiple releases (or arch's):@@ -79,8 +79,9 @@ ``` python3-3.14.0-1.fc43.x86_64 (f43)-python3-3.14.3-1.fc43.x86_64 (f43-updates)-python3-3.14.3-1.fc44.x86_64 (f44-development)+python3-3.14.4-2.fc43.x86_64 (f43-updates)+python3-3.14.3-2.fc44.x86_64 (f44)+python3-3.14.4-2.fc44.x86_64 (f44-updates) ``` There is an option to use the CloudFront cache:@@ -88,8 +89,8 @@ `$ fedora-repoquery --cf 44 rust` ```-rust-1.93.1-1.fc44.x86_64 (f44-development-cf)-rust-1.94.0-1.fc44.x86_64 (f44-updates-testing-cf)+rust-1.94.1-1.fc44.x86_64 (f44-cf)+rust-1.95.0-1.fc44.x86_64 (f44-updates-cf) ``` which may be faster than dl.fp.o and fresher than other mirrors sometimes. @@ -98,7 +99,7 @@ `$ fedora-repoquery --version` ```-0.8.1+0.8.2 ``` `$ fedora-repoquery --help`@@ -106,38 +107,38 @@ ``` fedora-repoquery tool for querying Fedora repos for packages. -Usage: fedora-repoquery [--version] [-4|--dnf4] [(-q|--quiet) | (-v|--verbose)]- [--dynamic] [-T|--time] [-K|--koji]+Usage: fedora-repoquery [--version] [-4|--dnf4] [(-q|--quiet) | (-v|--verbose)] + [--dynamic] [-T|--time] [-K|--koji] [(-m|--mirror URL) | --cf | (-d|--dl)] [-F|--all-fedora]- [(-s|--source) | (-A|--all-archs) |- [-a|--repo-arch ARCH]] [-t|--testing] [-D|--debug]- [(-z|--cache-size) | (-e|--cache-clean-empty) |- --list-releases | --help-dnf |- [--advisories ARG | --advisory-severities ARG |- --arch ARG | --available | --bugfix | --bzs ARG |- --cves ARG | --disable-modular-filtering |- --duplicates | --enhancement | --exactdeps |- --extras | (-f|--file ARG) | --installed |- --installed-from-repo ARG | --installonly |- --latest-limit ARG | --leaves | --newpackage |- --providers-of ARG | --recent | --recursive |- --security | --srpm | --unneeded | --upgrades |- --userinstalled | --whatconflicts ARG |- (--wd|--whatdepends ARG) | --whatenhances ARG |- --whatobsoletes ARG | (--whatprovides|--wp ARG) |- --whatrecommends ARG | (--whatrequires|--wr ARG) |- --whatsuggests ARG | --whatsupplements ARG |- --conflicts | --depends | --enhances | --files |- (-l|--list) | --obsoletes | (-p|--provides) |- --recommends | (-r|--requires) | --requires-pre |- --sourcerpm | --suggests | --supplements |- --location | (-i|--info) |- (--changelog|--changelogs) | --querytags |- (--qf|--queryformat ARG)]+ [(-s|--source) | (-A|--all-archs) | + [-a|--repo-arch ARCH]] [-t|--testing] [-D|--debug] + [(-z|--cache-size) | (-e|--cache-clean-empty) | + --list-releases | --help-dnf | + [--advisories ARG | --advisory-severities ARG | + --arch ARG | --available | --bugfix | --bzs ARG | + --cves ARG | --disable-modular-filtering | + --duplicates | --enhancement | --exactdeps | + --extras | (-f|--file ARG) | --installed | + --installed-from-repo ARG | --installonly | + --latest-limit ARG | --leaves | --newpackage | + --providers-of ARG | --recent | --recursive | + --security | --srpm | --unneeded | --upgrades | + --userinstalled | --whatconflicts ARG | + (--wd|--whatdepends ARG) | --whatenhances ARG | + --whatobsoletes ARG | (--whatprovides|--wp ARG) | + --whatrecommends ARG | (--whatrequires|--wr ARG) | + --whatsuggests ARG | --whatsupplements ARG | + --conflicts | --depends | --enhances | --files | + (-l|--list) | --obsoletes | (-p|--provides) | + --recommends | (-r|--requires) | --requires-pre | + --sourcerpm | --suggests | --supplements | + --location | (-i|--info) | + (--changelog|--changelogs) | --querytags | + (--qf|--queryformat ARG)] [[RELEASE]... [REPOQUERY_OPTS]... [PKGSPECIFIER]...]] - where RELEASE is {fN or N (fedora), 'rawhide', epelN, epelN-next, cN (centos- stream), 'eln'}, with N the release version number.+ where RELEASE is {fN or N (fedora), 'rawhide', epelN, epel10.x, epel9-next, cN+ (centos stream), 'eln'}, with N the release version number. <https://github.com/juhp/fedora-repoquery#readme> Available options:@@ -155,7 +156,7 @@ -d,--dl Use dl.fp.o -F,--all-fedora Query all Fedora releases -s,--source Query source repos- -A,--all-archs Query all (64 bit) arch repos+ -A,--all-archs Query all arch repos -a,--repo-arch ARCH Specify repo arch [default: x86_64] -t,--testing Fedora updates-testing -D,--debug Show some debug output
fedora-repoquery.cabal view
@@ -1,5 +1,5 @@ name: fedora-repoquery-version: 0.8.1+version: 0.8.2 synopsis: Fedora release repos package query tool description: A CLI tool for repoquerying Fedora and Centos Stream release packages:
src/Arch.hs view
@@ -21,7 +21,7 @@ deriving Eq allArchs :: [Arch]-allArchs = [X86_64, AARCH64, PPC64LE, S390X]+allArchs = [Source, X86_64, AARCH64, PPC64LE, S390X, I386] eitherArch :: String -> Either String Arch eitherArch s =
src/Main.hs view
@@ -53,7 +53,7 @@ main' = do sysarch <- getSystemArch simpleCmdArgs (Just version) "fedora-repoquery tool for querying Fedora repos for packages."- ("where RELEASE is {fN or N (fedora), 'rawhide', epelN, epelN-next, cN (centos stream), 'eln'}, with N the release version number." +-++ ("where RELEASE is {fN or N (fedora), 'rawhide', epelN, epel10.x, epel9-next, cN (centos stream), 'eln'}, with N the release version number." +-+ "<https://github.com/juhp/fedora-repoquery#readme>") $ runMain sysarch <$> switchWith '4' "dnf4" "Use dnf4 instead of dnf5 (if available)"@@ -69,7 +69,7 @@ -- FIXME: --all-epel and --all-releases <*> switchWith 'F' "all-fedora" "Query all Fedora releases" <*> (flagWith' [Source] 's' "source" "Query source repos" <|>- flagWith' allArchs 'A' "all-archs" "Query all (64 bit) arch repos" <|>+ flagWith' allArchs 'A' "all-archs" "Query all arch repos" <|> many (optionWith (eitherReader eitherArch) 'a' "repo-arch" "ARCH" ("Specify repo arch [default:" +-+ showArch sysarch ++ "]"))) <*> switchWith 't' "testing" "Fedora updates-testing" <*> switchWith 'D' "debug" "Show some debug output"
src/Release.hs view
@@ -9,13 +9,15 @@ ) where -import Control.Monad.Extra (forM_, unless, void, when, whenJust)+import Control.Monad.Extra (forM_, unless, void, when) import Data.Bifunctor (first) import qualified Data.CaseInsensitive as CI import Data.List.Extra import Data.Maybe (fromMaybe) import Data.Time.Format (defaultTimeLocale, parseTimeM, rfc822DateFormat) import Data.Time.LocalTime (utcToLocalZonedTime)+import Data.Version.Extra (readVersion, Version(..))+import qualified Distribution.Fedora.Release as F import Network.Curl (curlHead, CurlOption(..)) import Safe (tailSafe) import SimpleCmd (error', (+-+))@@ -35,6 +37,20 @@ getRelease :: Bool -> Bool -> Bool -> Bool -> RepoSource -> Release -> Arch -> Maybe Arch -> Bool -> IO [(String, URL)] getRelease debug dynredir warn checkdate reposource@(RepoSource koji _mirror) release sysarch march testing = do+ case release of+ EPEL n | n >= 10 && koji -> do+ version <- F.releaseVersion <$>+ F.getBranchRelease (show release)+ let minor =+ case readVersion version of+ Version [_maj,min'] [] -> toEnum min'+ _ -> error' $ "invalid minor branch version:" +-+ version+ getRelease' debug dynredir warn checkdate reposource (EpelMinor n minor) sysarch march testing+ _ -> getRelease' debug dynredir warn checkdate reposource release sysarch march testing+-- FIXME should warn or error if url (release) does not exist+getRelease' :: Bool -> Bool -> Bool -> Bool -> RepoSource -> Release -> Arch+ -> Maybe Arch -> Bool -> IO [(String, URL)]+getRelease' debug dynredir warn checkdate reposource@(RepoSource koji _mirror) release sysarch march testing = do let arch = fromMaybe sysarch march (url,path) <- getURL debug dynredir reposource release arch let urlpath = url +//+ path@@ -96,11 +112,11 @@ (("epel",urlpath) : [("epel-testing",url +//+ ["testing", show n]) | testing], [])- EPEL10Dot n -> return+ EpelMinor n m -> return (("epel",urlpath) :- [("epel-testing",url +//+ ["testing", "10." ++ show n]) | testing],+ [("epel-testing",url +//+ ["testing", show n ++ "." ++ show m]) | testing], [])- EPELNext _n -> return ([("epelnext",urlpath)],[])+ EPEL9Next -> return ([("epelnext",urlpath)],[]) System -> error' "showRelease: unsupported for system" rawhide <- rawhideFedoraRelease let basicrepourls =@@ -121,8 +137,8 @@ Centos _ -> ["COMPOSE_ID"] -- ["metadata","composeinfo.json"] ELN -> ["COMPOSE_ID"] EPEL _ -> ["Everything", "state"]- EPEL10Dot _ -> ["Everything", "state"]- EPELNext _ -> ["Everything", "state"]+ EpelMinor _ _ -> ["Everything", "state"]+ EPEL9Next -> ["Everything", "state"] Fedora _ -> if "updates" `isInfixOf` reponame then ["Everything", "state"] else ["COMPOSE_ID"]@@ -131,10 +147,14 @@ let composeUrl = renderUrl File composeinfo when debug $ print composeUrl mtimestr <- curlGetHeader Nothing "Last-Modified" composeUrl- whenJust mtimestr $ \timestr -> do- utc <- parseTimeM False defaultTimeLocale rfc822DateFormat timestr- date <- utcToLocalZonedTime utc- (if warn then warning else putStrLn) $ show date +-+ "<" ++ renderUrl Dir url' ++ ">"+ case mtimestr of+ Just timestr -> do+ utc <- parseTimeM False defaultTimeLocale rfc822DateFormat timestr+ date <- utcToLocalZonedTime utc+ (if warn then warning else putStrLn) $ show date +-+ "<" ++ renderUrl Dir url' ++ ">"+ Nothing ->+ -- FIXME maybe error?+ warning $ composeUrl +-+ "not found (Last-Modified)" return $ map (fmap (uncurry (+//+))) $ basicrepourls ++ morerepourls getURL :: Bool -> Bool -> RepoSource -> Release -> Arch@@ -163,8 +183,8 @@ return (URL "https://archives.fedoraproject.org/pub/archive/epel", [show n]) EPEL n -> getFedoraServer debug dynredir reposource ["epel"] [show n]- EPEL10Dot n -> getFedoraServer debug dynredir reposource ["epel"] ["10." ++ show n]- EPELNext n -> getFedoraServer debug dynredir reposource ["epel","next"] [show n]+ EpelMinor n m -> getFedoraServer debug dynredir reposource ["epel"] [show n ++ "." ++ show m]+ EPEL9Next -> getFedoraServer debug dynredir reposource ["epel","next"] ["9"] Fedora n -> do eactiverelease <- activeFedoraRelease n case eactiverelease of@@ -223,8 +243,8 @@ Centos _ -> [repo, showArch arch] ++ (if arch == Source then ["tree"] else ["os"]) ELN -> [repo, showArch arch] ++ (if arch == Source then ["tree"] else ["os"]) EPEL n -> (if n >= 8 then ("Everything" :) else id) [showArch arch] ++ ["tree" | arch == Source]- EPEL10Dot _n -> "Everything" : showArch arch : ["tree" | arch == Source]- EPELNext _n -> ["Everything", showArch arch]+ EpelMinor _n _m -> "Everything" : showArch arch : ["tree" | arch == Source]+ EPEL9Next -> ["Everything", showArch arch] Fedora _ -> ["Everything", showArch arch] ++ (if arch == Source then ["tree"] else ["os" | repo `elem` ["releases","development"]]) Rawhide -> ["Everything", showArch arch, if arch == Source then "tree" else "os"] System -> error' "repoConfigArgs: unsupported for system"@@ -239,8 +259,8 @@ then "fedora-rawhide" else show release ++ if repo == "releases" then "" else '-':repo ELN -> show release ++ '-':repo- EPEL10Dot _ -> show release ++ if repo == "epel-testing" then "-testing" else ""- EPELNext _ -> show release ++ if repo == "epelnext-testing" then "-testing" else ""+ EpelMinor _ _ -> show release ++ if repo == "epel-testing" then "-testing" else ""+ EPEL9Next -> show release ++ if repo == "epelnext-testing" then "-testing" else "" EPEL _ -> show release ++ if repo == "epel-testing" then "-testing" else "" Centos _ -> show release ++ '-':repo System -> ""
src/Types.hs view
@@ -25,7 +25,8 @@ data RepoSource = RepoSource Bool Mirror deriving Eq -data Release = EPEL10Dot Natural | EPEL Natural | EPELNext Natural+-- FIXME deal with epel11.x+data Release = EpelMinor Natural Natural | EPEL Natural | EPEL9Next | Centos Natural | Fedora Natural | ELN | Rawhide | System deriving (Eq, Ord)@@ -41,9 +42,9 @@ case lower rel of "rawhide" -> Right Rawhide -- FIXME add proper parsing:- "epel8-next" -> Right $ EPELNext 8- "epel9-next" -> Right $ EPELNext 9- ('e':'p':'e':'l':'1':'0':'.':n@(_:_)) | all isDigit n -> let br = EPEL10Dot (read n)+ "epel9-next" -> Right EPEL9Next+ -- FIXME add epel11.x+ ('e':'p':'e':'l':'1':'0':'.':n@(_:_)) | all isDigit n -> let br = EpelMinor 10 (read n) in Right br ('e':'p':'e':'l':n@(_:_)) | all isDigit n -> let br = EPEL (read n) in Right br@@ -72,9 +73,9 @@ instance Show Release where show Rawhide = "rawhide" show (Fedora n) = "f" ++ show n- show (EPEL10Dot n) = "epel10." ++ show n+ show (EpelMinor n m) = "epel" ++ show n ++ "." ++ show m show (EPEL n) = (if n <= 6 then "el" else "epel") ++ show n- show (EPELNext n) = "epel" ++ show n ++ "-next"+ show EPEL9Next = "epel9" ++ "-next" show ELN = "eln" show (Centos n) = 'c' : show n ++ "s" show System = "system"
test/tests.hs view
@@ -35,6 +35,7 @@ ,(["epel9"], Nothing) ,(["c10s"], Nothing) ,(["--cf", current], Nothing)+ ,(["-K", "epel10"], Nothing) ,(["-T", "rawhide"], Just "coreutils") ,(["--dynamic", rawhide], Just "coreutils") ,(["-T", current], Just "gtk4")