fedora-repoquery 0.8 → 0.8.1
raw patch · 7 files changed
+79/−59 lines, 7 files
Files
- ChangeLog.md +6/−0
- README.md +56/−46
- fedora-repoquery.cabal +2/−2
- src/Main.hs +7/−6
- src/Release.hs +5/−3
- src/Types.hs +1/−1
- test/tests.hs +2/−1
ChangeLog.md view
@@ -1,5 +1,11 @@ # Revision history for fedora-repoquery +## 0.8.1 (2026-03-14)+- shorter query aliases: `--wd` (--whatdepends), `--wr` (--whatrequires),+ `-p` (--provides), `-r` (--requires), `--wp` (--whatprovides)+- new `--cf` option: to use CloudFront cache as the mirror+- `--help-dnf` now correctly provides repoquery --help+ ## 0.8 (2025-09-23) - rework dnf option handling with full parsing and completions: with free ordering of arguments, releases and options
README.md view
@@ -10,8 +10,9 @@ `$ fedora-repoquery rawhide firefox` ```-firefox-143.0.1-1.fc44.x86_64 (fedora-rawhide)+firefox-148.0-1.fc45.x86_64 (fedora-rawhide) ```+(note it is shorter to write `fedora-repoquery 45`). `$ fedora-repoquery 43 --requires filesystem` @@ -35,7 +36,7 @@ `$ fedora-repoquery eln kernel` ```-kernel-6.17.0-0.rc6.250919g097a6c336d008.53.eln151.x86_64 (eln-BaseOS)+kernel-7.0.0-0.rc3.260312g80234b5ab240.32.eln155.x86_64 (eln-BaseOS) ``` Without a release argument, the system yum repo configuration is used:@@ -43,53 +44,61 @@ `$ fedora-repoquery pandoc-cli` ```-pandoc-cli-3.6.4-38.fc44.x86_64 (rawhide)+pandoc-cli-3.7.0.2-40.fc44.x86_64 (rawhide) ``` `$ fedora-repoquery --whatrequires pandoc` ```-R-reprex-2.1.1-2.fc43.noarch (rawhide)-R-rmarkdown-2.24-9.fc43.noarch (rawhide)-pandoc-pdf-3.6.4-38.fc44.x86_64 (rawhide)-python3-pypandoc-1.15-8.fc44.noarch (rawhide)+pandoc-pdf-3.7.0.2-40.fc44.x86_64 (rawhide)+python3-pypandoc-1.16.2-1.fc44.noarch (rawhide) ``` Use the --time (-T) option to display repo timestamps: ``` $ fedora-repoquery -T 43 fedrq-2025-05-07 15:57:29 +08 <https://mirror.freedif.org/fedora/fedora/linux/development/rawhide/>+2025-10-26 01:59:02 +08 <https://mirror.freedif.org/fedora/fedora/linux/releases/43/>+2026-03-12 09:53:14 +08 <https://mirror.freedif.org/fedora/fedora/linux/updates/43/> -fedrq-1.5.0-1.fc43.noarch (fedora-rawhide)+fedrq-1.5.0-5.fc43.noarch (f43) ``` Repo timestamp(s) are output when there are no query args after the release version: -`$ fedora-repoquery 42`+`$ fedora-repoquery 44` ```-2025-04-15 01:43:43 +08 <https://mirror.freedif.org/fedora/fedora/linux/releases/42/>-2025-09-23 09:11:46 +08 <https://mirror.freedif.org/fedora/fedora/linux/updates/42/>+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/> ``` One can also query multiple releases (or arch's): -`$ fedora-repoquery 42 43 python3 | grep x86_64`+`$ fedora-repoquery 43 44 python3.x86_64` ```-python3-3.13.2-2.fc42.x86_64 (f42)-python3-3.13.7-1.fc42.x86_64 (f42-updates)-python3-3.14.0~rc2-1.fc43.x86_64 (f43-development)-python3-3.14.0~rc3-1.fc43.x86_64 (f43-updates-testing)+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) ``` +There is an option to use the CloudFront cache: +`$ 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)+```+which may be faster than dl.fp.o and fresher than other mirrors sometimes.++ ## Help `$ fedora-repoquery --version` ```-0.8+0.8.1 ``` `$ fedora-repoquery --help`@@ -97,34 +106,34 @@ ``` fedora-repoquery tool for querying Fedora repos for packages. -Usage: fedora-repoquery [--version] [-4|--dnf4] [(-q|--quiet) | (-v|--verbose)] - [--dynamic] [-T|--time] [-K|--koji] - [(-m|--mirror URL) | (-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 | - --whatdepends ARG | --whatenhances ARG | - --whatobsoletes ARG | --whatprovides ARG | - --whatrecommends ARG | --whatrequires ARG | - --whatsuggests ARG | --whatsupplements ARG | - --conflicts | --depends | --enhances | --files | - (-l|--list) | --obsoletes | --provides | - --recommends | --requires | --requires-pre | - --sourcerpm | --suggests | --supplements | - --location | (-i|--info) | - (--changelog|--changelogs) | --querytags | - (--qf|--queryformat ARG)] +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)] [[RELEASE]... [REPOQUERY_OPTS]... [PKGSPECIFIER]...]] where RELEASE is {fN or N (fedora), 'rawhide', epelN, epelN-next, cN (centos@@ -142,6 +151,7 @@ -K,--koji Use Koji buildroot -m,--mirror URL Fedora mirror [default: https://download.fedoraproject.org/pub]+ --cf Use CloudFront cache -d,--dl Use dl.fp.o -F,--all-fedora Query all Fedora releases -s,--source Query source repos
fedora-repoquery.cabal view
@@ -1,5 +1,5 @@ name: fedora-repoquery-version: 0.8+version: 0.8.1 synopsis: Fedora release repos package query tool description: A CLI tool for repoquerying Fedora and Centos Stream release packages:@@ -9,7 +9,7 @@ license-file: COPYING author: Jens Petersen <petersen@redhat.com> maintainer: Jens Petersen <petersen@redhat.com>-copyright: 2021-2025 Jens Petersen <petersen@redhat.com>+copyright: 2021-2026 Jens Petersen <petersen@redhat.com> category: Utility homepage: https://github.com/juhp/fedora-repoquery bug-reports: https://github.com/juhp/fedora-repoquery/issues
src/Main.hs view
@@ -64,6 +64,7 @@ <*> (RepoSource <$> switchWith 'K' "koji" "Use Koji buildroot" <*> ((Mirror <$> strOptionWith 'm' "mirror" "URL" ("Fedora mirror [default: " ++ downloadServer ++ "]")) <|>+ flagLongWith' CloudFront "cf" "Use CloudFront cache" <|> flagWith DownloadFpo DlFpo 'd' "dl" "Use dl.fp.o")) -- FIXME: --all-epel and --all-releases <*> switchWith 'F' "all-fedora" "Query all Fedora releases"@@ -122,12 +123,12 @@ <|> dnfFlag "upgrades" <|> dnfFlag "userinstalled" <|> dnfOption "whatconflicts"- <|> dnfOption "whatdepends"+ <|> dnfOption'' "wd" "whatdepends" <|> dnfOption "whatenhances" <|> dnfOption "whatobsoletes"- <|> dnfOption "whatprovides"+ <|> dnfOption'' "wp" "whatprovides" <|> dnfOption "whatrecommends"- <|> dnfOption "whatrequires"+ <|> dnfOption'' "wr" "whatrequires" <|> dnfOption "whatsuggests" <|> dnfOption "whatsupplements" -- # FORMATTING@@ -137,9 +138,9 @@ <|> dnfFlag "files" <|> dnfFlag' 'l' "list" <|> dnfFlag "obsoletes"- <|> dnfFlag "provides"+ <|> dnfFlag' 'p' "provides" <|> dnfFlag "recommends"- <|> dnfFlag "requires"+ <|> dnfFlag' 'r' "requires" <|> dnfFlag "requires-pre" <|> dnfFlag "sourcerpm" <|> dnfFlag "suggests"@@ -157,7 +158,7 @@ CacheSize -> cacheSize CacheEmpties -> cleanEmptyCaches ReleaseList -> listVersionsCmd- DnfHelp -> cmd_ (if dnf4 then "dnf4" else "dnf") ["--help"]+ DnfHelp -> cmd_ (if dnf4 then "dnf4" else "dnf") ["repoquery", "--help"] Query opts relargs -> -- spanJust from utility-ht nicer but this gets us enough let (args,releases) = partitionEithers $ map eitherRelease relargs
src/Release.hs view
@@ -101,7 +101,7 @@ [("epel-testing",url +//+ ["testing", "10." ++ show n]) | testing], []) EPELNext _n -> return ([("epelnext",urlpath)],[])- System -> error' "showRelease: system unsupported"+ System -> error' "showRelease: unsupported for system" rawhide <- rawhideFedoraRelease let basicrepourls = map (repoConfigArgs reposource sysarch march rawhide release) basicrepos@@ -188,7 +188,7 @@ [if pending || postbeta then "development" else "releases", releasestr] Rawhide -> getFedoraServer debug dynredir reposource fedoraTop ["development", "rawhide"]- System -> error' "getURL: system unsupported"+ System -> error' "getURL: unsupported for system" where fedoraTop = -- FIXME support older archs@@ -217,6 +217,7 @@ Mirror serv -> '-' : takeWhile (/= '/') (subRegex (mkRegex "https?://") serv "") DlFpo -> "-dl.fpo"+ CloudFront -> "-cf" path = case release of Centos _ -> [repo, showArch arch] ++ (if arch == Source then ["tree"] else ["os"])@@ -226,7 +227,7 @@ EPELNext _n -> ["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: system unsupported"+ System -> error' "repoConfigArgs: unsupported for system" in (reponame, (url, path ++ ["/"])) where repoVersion :: String@@ -293,6 +294,7 @@ -- FIXME how to handle any path Mirror serv -> return (URL serv,path) DlFpo -> return (URL "https://dl.fedoraproject.org/pub" +//+ top, path)+ CloudFront -> return (URL "https://d2lzkl7pfhq30w.cloudfront.net/pub" +//+ top, path) downloadServer :: String downloadServer = "https://download.fedoraproject.org/pub"
src/Types.hs view
@@ -18,7 +18,7 @@ data Verbosity = Quiet | Normal | Verbose deriving Eq -data Mirror = DownloadFpo | DlFpo | Mirror String+data Mirror = DownloadFpo | DlFpo | CloudFront | Mirror String deriving Eq -- FIXME: True for koji make into type
test/tests.hs view
@@ -18,7 +18,7 @@ -- copied from dl-fedora branched :: Int-branched = 43+branched = 44 current, previous, prevprev, rawhide :: String current = show branched previous = show (branched - 1)@@ -34,6 +34,7 @@ ,(["eln"], Nothing) ,(["epel9"], Nothing) ,(["c10s"], Nothing)+ ,(["--cf", current], Nothing) ,(["-T", "rawhide"], Just "coreutils") ,(["--dynamic", rawhide], Just "coreutils") ,(["-T", current], Just "gtk4")