koji-tool 1.1 → 1.1.1
raw patch · 9 files changed
+66/−33 lines, 9 files
Files
- ChangeLog.md +6/−0
- README.md +35/−16
- TODO +2/−1
- koji-tool.cabal +4/−4
- src/Builds.hs +1/−1
- src/Install.hs +8/−6
- src/Progress.hs +4/−0
- src/Tasks.hs +5/−4
- src/Time.hs +1/−1
ChangeLog.md view
@@ -1,5 +1,11 @@ # Version history of koji-tool +## 1.1.1 (2023-10-20)+- 'builds': reformat short build result to align better+- 'install': detect ostree with "/sysroot/ostree" not rpm-ostree+- 'tasks': reorder output format for better alignment+- Time compactZonedTime: add space before timezone+ ## 1.1 (2023-07-22) - tasks: now shows children of 'build' task - install: correctly handle arch for installed packages (#4)
README.md view
@@ -21,10 +21,13 @@ shows the last successful build with a url and other details. ## Commands-```shellsession-$ koji-tool --version-1.1-$ koji-tool --help+`$ koji-tool --version`+```+1.1.1+```++`$ koji-tool --help`+``` Query and track Koji tasks, and install rpms from Koji. Usage: koji-tool [--version] COMMAND@@ -65,8 +68,8 @@ By default lists up to 10 Fedora Koji builds. -```shellsession-$ koji-tool builds --help+`$ koji-tool builds --help`+``` Usage: koji-tool builds [-H|--hub HUB] [(-u|--user USER) | (-M|--mine)] [(-L|--latest) | (-l|--limit INT)] [-s|--state STATE] [(-B|--before TIMESTAMP) | (-F|--from TIMESTAMP)]@@ -132,8 +135,8 @@ By default it lists 10 most recent Fedora Koji buildArch tasks. -```shellsession-$ koji-tool tasks --help+`$ koji-tool tasks --help`+``` Usage: koji-tool tasks [-H|--hub HUB] [(-u|--user USER) | (-M|--mine)] [(-L|--latest) | (-l|--limit INT)] [-s|--state STATE] [-a|--arch ARCH]@@ -268,8 +271,8 @@ Subpackage selection has only been tested so far for a single build/task. ### Help-```shellsession-$ koji-tool install --help+`$ koji-tool install --help`+``` Usage: koji-tool install [-n|--dry-run] [-D|--debug] [-y|--yes] [-H|--hub HUB] [-P|--packages-url URL] [-l|--list] [-L|--latest] [-t|--check-remote-time]@@ -355,7 +358,7 @@ This is useful for monitoring the build progress of large packages that take a long time to complete for which some arch's may take considerably longer. -By default it shows progress of the user's builds.+By default it shows progress of the user's open build tasks. ### Usage @@ -382,12 +385,28 @@ ## Installation koji-tool is packaged in Fedora -## Build-`cabal-rpm builddep && cabal install || stack install`+## Building from git/source+Either use `cabal-install` or `stack`.+Either way you need a ghc compiler installed, of course. +### Build from source with cabal++With cabal, you can save a lot of time by first running `cabal-rpm builddep`+to install distro deps, and then:++```+$ cabal install+```++### Build from source with stack++```+$ stack init --resolver lts+$ stack install+```+ ## Contributing koji-tool is distributed under a BSD license. -Bug reports and contributions are welcomed:-please report issues and suggestions at:-https://github.com/juhp/koji-tool/+Bug reports, suggestions and contributions are welcomed:+please open an issue at: https://github.com/juhp/koji-tool/
TODO view
@@ -9,6 +9,7 @@ # misc - api-version command+- swap '-M' (--mine) and '-m' (--method) ? # install - autodetect nvr@@ -64,7 +65,7 @@ # install - put package lists into Set's -# misc+# other - list binary packages (install does this, but not obvious) - diff build command - diff root.log
koji-tool.cabal view
@@ -1,5 +1,5 @@ name: koji-tool-version: 1.1+version: 1.1.1 synopsis: Koji CLI tool for querying tasks and installing builds description: koji-tool is a CLI interface to Koji with commands to query@@ -23,9 +23,9 @@ || == 8.8.4 || == 8.10.7 || == 9.0.2- || == 9.2.7- || == 9.4.5- || == 9.6.2+ || == 9.2.8+ || == 9.4.7+ || == 9.6.3 source-repository head type: git
src/Builds.hs view
@@ -104,7 +104,7 @@ Just (start,mend) -> compactZonedTime tz $ fromMaybe start mend mbid = lookupStruct "build_id" bld- return $ nvr +-+ show state +-+ date +-+ maybe "" (buildinfoUrl hub) mbid+ return $ date +-+ maybe "" (buildinfoUrl hub) mbid +-+ show state +-+ nvr setupQuery = do mdatestring <-
src/Install.hs view
@@ -488,6 +488,8 @@ data InstallType = ReInstall | Install +-- FIXME support options per build: install ibus imsettings -i plasma+-- (or don't error if multiple packages) installRPMs :: Bool -> Bool -> Maybe PkgMgr -> Yes -> [(FilePath,[(Existence,NVRA)])] -> IO () installRPMs _ _ _ _ [] = return ()@@ -505,12 +507,12 @@ case mmgr of Just m -> return m Nothing -> do- mostree <- findExecutable "rpm-ostree"- case mostree of- Just _ -> return OSTREE- Nothing -> do- mdnf5 <- findExecutable "dnf5"- return $ maybe DNF3 (const DNF5) mdnf5+ ostree <- doesDirectoryExist "/sysroot/ostree"+ if ostree+ then return OSTREE+ else do+ mdnf5 <- findExecutable "dnf5"+ return $ maybe DNF3 (const DNF5) mdnf5 let pkgmgr = case mgr of DNF3 -> "dnf-3"
src/Progress.hs view
@@ -44,6 +44,7 @@ -- FIXME if failure and no more, then stop -- FIXME catch HTTP exception for connection timeout -- FIXME pick up new user builds (if none specified)+-- FIXME noarch tasks shown with build arch progressCmd :: Bool -> QueryOpts -> TaskReq -> IO () progressCmd modules queryopts@QueryOpts{..} taskreq = do tasks <- do@@ -125,6 +126,9 @@ case lookupStruct "parent" taskinfo of Nothing -> error' $ "no parent found for " ++ displayID tid Just par -> TaskId par+ -- FIXME support newrepo+ -- https://koji.fedoraproject.org/koji/taskinfo?taskID=104446426+ -- https://kojipkgs.fedoraproject.org//work/tasks/6426/104446426/ _ -> error' $ "unsupported method: " ++ method children <- sortOn (\t -> lookupStruct "arch" t :: Maybe String) <$> kojiGetTaskChildren fedoraKojiHub parent True
src/Tasks.hs view
@@ -292,11 +292,12 @@ Nothing -> maybe "" (compactZonedTime tz) mstart in unwords $- [showPackage pkg ++ if method == "buildArch" then '.' : arch ++ replicate (8 - length arch) ' ' else ' ' : method,- show state,- time] +++ [time,+ taskinfoUrl hub taskid] ++ ["(" ++ renderDuration True dur ++ ")" | Just start <- [mstart], Just end <- [mend], let dur = diffUTCTime end start] ++- [taskinfoUrl hub taskid]+ [show state,+ showPackage pkg ++ if method == "buildArch" then '.' : arch ++ replicate (8 - length arch) ' ' else ' ' : method]+ -- FIXME show task owner formatTaskResult :: String -> Maybe UTCTime -> TimeZone -> TaskResult -> [String]
src/Time.hs view
@@ -27,7 +27,7 @@ compactZonedTime :: TimeZone -> UTCTime -> String compactZonedTime tz =- formatTime defaultTimeLocale "%Y-%m-%d %H:%M:%S%Z" . utcToZonedTime tz+ formatTime defaultTimeLocale "%Y-%m-%d %H:%M:%S %Z" . utcToZonedTime tz data TimeEvent = CreateEvent | StartEvent | CompletionEvent