fbrnch 1.8.1 → 1.8.2
raw patch · 9 files changed
+85/−66 lines, 9 files
Files
- CHANGELOG.md +8/−0
- README.md +1/−1
- fbrnch.cabal +2/−3
- src/Branches.hs +34/−30
- src/Cmd/Autospec.hs +7/−4
- src/Cmd/Copr.hs +1/−1
- src/Cmd/Mock.hs +8/−6
- src/Main.hs +3/−1
- src/Package.hs +21/−20
CHANGELOG.md view
@@ -1,5 +1,13 @@ # Changelog +## 1.8.2 (2026-06-03)+- 'autospec': don't switch to rawhide and pass pkg spec file to convert+- 'copr': filter out canceled builds from existing builds+- 'mock': add --no-pull and --config-options+- 'mock': use target branch for srpm and build disttag+- 'nvr': fix for epel10 disttag with autorelease+- Branches listOfBranches: do eol/branched checks for all BranchesReq+ ## 1.8.1 (2026-03-20) - new native watchtask implementation and command - local build.log's now generated with 'script' tool instead of tee pipe
README.md view
@@ -270,7 +270,7 @@ `$ fbrnch --version` ```-1.8.1+1.8.2 ``` `$ fbrnch --help`
fbrnch.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: fbrnch-version: 1.8.1+version: 1.8.2 synopsis: Fedora packager tool to build package branches description: fbrnch (fedora branch or "f-branch" for short) is@@ -36,7 +36,7 @@ tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.8, GHC == 9.4.8, GHC == 9.6.7, GHC == 9.8.4, GHC == 9.10.3,- GHC == 9.12.3+ GHC == 9.12.4 source-repository head type: git@@ -112,7 +112,6 @@ build-depends: aeson, async,- -- pretty-terminal depends on base >= 4.9 (ghc8) base >= 4.9 && < 5, bodhi, bugzilla-redhat >= 1.0.1,
src/Branches.hs view
@@ -207,56 +207,60 @@ osPrefix s = s -- FIXME should be NonEmpty Branch-listOfBranches :: Bool -> Bool -> BranchesReq -> IO [Branch]-listOfBranches distgit _active (BranchOpt AllBranches) =+listOfBranches' :: Bool -> BranchesReq -> IO [Branch]+listOfBranches' distgit (BranchOpt AllBranches) = if distgit then fedoraBranches (localBranches False) else getActiveBranches-listOfBranches distgit _active (BranchOpt AllFedora) =+listOfBranches' distgit (BranchOpt AllFedora) = filter isFedoraBranch <$> if distgit then fedoraBranches (localBranches False) else getActiveBranches-listOfBranches distgit _active (BranchOpt AllEPEL) =+listOfBranches' distgit (BranchOpt AllEPEL) = filter isEPELBranch <$> if distgit then fedoraBranches (localBranches False) else getActiveBranches-listOfBranches distgit _ (BranchOpt (ExcludeBranches brs)) = do+listOfBranches' distgit (BranchOpt (ExcludeBranches brs)) = do branches <- if distgit then fedoraBranches (localBranches False) else getActiveBranches return $ branches \\ brs-listOfBranches distgit active (Branches brs) =+listOfBranches' distgit (Branches brs) = if null brs then pure <$> if distgit then getReleaseBranch else systemBranch- else do- activeBrs <- getActiveBranches- forM_ brs $ \ br ->- if active- then do- unless (br `elem` activeBrs) $- error' $ showBranch br +-+ "is not an active branch"- rel <- branchRelease br- let meol = releaseEOL rel- whenJust meol $ \eol -> do- let date = read eol- today <- utctDay <$> getCurrentTime- let diff = diffDays date today- when (diff <= 7) $- warning $ "EOL for" +-+ showBranch br +-+ "is" +-+ show diff +-+ "days away!"- else- case br of- Fedora _ -> do- let latest = maximum (delete Rawhide activeBrs)- when (br > latest) $- error' $ showBranch br +-+ "is newer than latest branch"- -- FIXME also check for too new EPEL- _ -> return ()- return brs+ else return brs++listOfBranches :: Bool -> Bool -> BranchesReq -> IO [Branch]+listOfBranches distgit active breq = do+ brs <- listOfBranches' distgit breq+ activeBrs <- getActiveBranches+ forM_ brs $ \ br ->+ if active+ then do+ unless (br `elem` activeBrs) $+ error' $ showBranch br +-+ "is not an active branch"+ rel <- branchRelease br+ let meol = releaseEOL rel+ whenJust meol $ \eol -> do+ let date = read eol+ today <- utctDay <$> getCurrentTime+ let diff = diffDays date today+ when (diff <= 7) $+ warning $ "EOL for" +-+ showBranch br +-+ "is" +-+ show diff +-+ "days away!"+ else+ case br of+ Fedora _ -> do+ let latest = maximum (delete Rawhide activeBrs)+ when (br > latest) $+ error' $ showBranch br +-+ "is newer than latest branch"+ -- FIXME also check for too new EPEL+ _ -> return ()+ return brs listOfAnyBranches :: Bool -> Bool -> BranchesReq -> IO [AnyBranch] listOfAnyBranches distgit active breq =
src/Cmd/Autospec.hs view
@@ -5,6 +5,7 @@ where import Control.Monad.Extra (unlessM, when)+import Data.Maybe (maybeToList) import SimpleCmd (cmd, cmd_) import System.Directory (doesFileExist, removeFile) @@ -14,9 +15,9 @@ -- FIXME! calculate baserelease: calculate bumped release and count back to last version bump commit -- FIXME add --stash-autospecCmd :: Bool -> [String] -> IO ()-autospecCmd force pkgs =- withPackagesByBranches HeaderMay False cleanGitFetchActive ExactlyOne autospecPkg (Branches [Rawhide], pkgs)+autospecCmd :: Bool -> (Maybe Branch, [String]) -> IO ()+autospecCmd force (mbr,pkgs) =+ withPackagesMaybeBranch HeaderMay False cleanGitFetchActive autospecPkg (mbr, pkgs) where autospecPkg :: Package -> AnyBranch -> IO () autospecPkg _pkg br = do@@ -33,7 +34,9 @@ git_ "add" [changelogfile] git_ "commit" ["-m", "Refresh changelog"] else putStrLn "'changelog' file already exists"- else cmd_ "rpmautospec" ["convert"]+ else do+ mspec <- maybeFindSpecfile+ cmd_ "rpmautospec" $ "convert" : maybeToList mspec unautospecCmd :: (BranchesReq, [String]) -> IO () unautospecCmd =
src/Cmd/Copr.hs view
@@ -274,7 +274,7 @@ let pkgmonitor = fromMaybe [] $ lookup actualpkg monitorPkgs let buildingChroots = filterTasks verrel (`elem` coprProcessingStates) pkgmonitor- builds = filterTasks verrel (`notElem` ["failed","skipped"]) pkgmonitor+ builds = filterTasks verrel (`notElem` ["failed","skipped","canceled"]) pkgmonitor if null buildingChroots then return builds else do
src/Cmd/Mock.hs view
@@ -31,9 +31,10 @@ -- FIXME add repo/copr for build -- FIXME handle non-release branches (on-branch works) -- FIXME option for --shell without rebuild-mockCmd :: Bool -> Maybe NoClean -> Bool -> Bool -> Maybe MockMode- -> Maybe Branch -> Maybe String -> (BranchesReq, [String]) -> IO ()-mockCmd dryrun mnoclean network reinstall mockmode mroot march (breq, ps) = do+mockCmd :: Bool -> Maybe NoClean -> Bool -> Maybe String -> Bool -> Bool+ -> Maybe MockMode -> Maybe Branch -> Maybe String+ -> (BranchesReq, [String]) -> IO ()+mockCmd dryrun mnoclean noPull mconfigOptions network reinstall mockmode mroot march (breq, ps) = do pkggit <- isPkgGitRepo branches <- case breq of@@ -50,7 +51,7 @@ where mockBuildPkgs :: Bool -> Bool -> [String] -> Branch -> IO () mockBuildPkgs pkggit noswitch pkgs br = do- srpms <- mapM (prepSrpm (RelBranch br)) pkgs+ srpms <- mapM (prepSrpm (RelBranch $ fromMaybe br mroot)) pkgs putNewLn -- FIXME? is it better just to fail asking for target branch? rootBr <- maybe (if pkggit then getReleaseBranch else return br) return mroot@@ -69,7 +70,8 @@ Just NoCleanAll -> ["--no-clean", "--no-cleanup-after"] Just MockShortCircuit -> ["--short-circuit", "install"] mockopts_common c = [c, "--root", mockRoot rootBr march] ++ noclean ++ ["--enable-network" | network]- mockbuild_opts = mockopts_common command ++ ["--config-opts=cleanup_on_failure=False" | mnoclean `elem` [Nothing, Just NoCleanBefore]] ++ resultdir ++ srpms+ config_opts = ["cleanup_on_failure=False" | mnoclean `elem` [Nothing, Just NoCleanBefore]] ++ ["buildroot_image_skip_pull=True" | noPull] ++ maybe [] words mconfigOptions+ mockbuild_opts = mockopts_common command ++ ["--config-opts=" ++ unwords config_opts | not (null config_opts)] ++ resultdir ++ srpms mockshell_opts = mockopts_common "--shell" ++ ["--no-clean" | "--no-clean" `notElem` noclean] if dryrun then do@@ -104,7 +106,7 @@ unless noswitch $ gitSwitchBranch rbr spec <- findSpecfile- generateSrpm Nothing spec+ generateSrpm (Just rbr) spec mockInstall :: String -> IO () mockInstall pkg = do
src/Main.hs view
@@ -267,6 +267,8 @@ mockCmd <$> dryrunOpt "Do not build (but creates srpm)" <*> optional nocleanOpt+ <*> switchLongWith "no-pull" "Do not pull latest buildroot image"+ <*> optional (strOptionLongWith "config-options" "'OPTION=VALUE ..'" "Set mock config_opts") <*> switchWith 'N' "network" "Use network during build" <*> switchLongWith "reinstall" "Allow reinstallation with --install" <*> optional (flagLongWith' ShellOnly "shell-only" "Skip mock build" <|>@@ -445,7 +447,7 @@ , Subcommand "autospec" "Convert package to use rpmautospec" $ autospecCmd <$> forceOpt "Refresh changelog file to current"- <*> manyPackages+ <*> maybeBranchPackages False , Subcommand "unautospec" "Unconvert rpmautospec package" $ unautospecCmd <$> branchesPackages
src/Package.hs view
@@ -425,27 +425,28 @@ hostdist <- cmd "rpm" ["--eval", "%{dist}"] -- FIXME more precise regexp with "Release:" autorelease <- isAutoRelease spec- nvrs <- do- if autorelease+ if autorelease+ then do+ pkggit <- isPkgGitRepo+ if pkggit then do- pkggit <- isPkgGitRepo- if pkggit- then do- mfedpkg <- findExecutable "fedpkg"- when (isNothing mfedpkg) $- error' "requires fedpkg.."- cmdLines "fedpkg" ["verrel"]- else- if strict- then error' "cannot determine NVR accurately for autorelease outside dist-git"- else return []- else rpmspec ["--srpm"] (Just "%{name}-%{version}-%{release}") spec- seq disttag $- return $- case nvrs of- [] -> Nothing- [nvr] -> maybeNVR (replace hostdist disttag nvr)- _ -> error' "could not determine unique nvr"+ mfedpkg <- findExecutable "fedpkg"+ when (isNothing mfedpkg) $+ error' "requires fedpkg.."+ maybeNVR <$> cmd "fedpkg" ["verrel"]+ else+ if strict+ then error' "cannot determine NVR accurately for autorelease outside dist-git"+ else return Nothing+ else+ seq disttag $+ do+ nvrs <- rpmspec ["--srpm"] (Just "%{name}-%{version}-%{release}") spec+ return $+ case nvrs of+ [] -> Nothing+ [nvr] -> maybeNVR (replace hostdist disttag nvr)+ _ -> error' "could not determine unique nvr" pkgNameVerRel' :: Branch -> FilePath -> IO NVR pkgNameVerRel' br spec = do