Skip to content

Commit

Permalink
Merge pull request #107 from FyraLabs/fix-deleteRPM-tetsudou
Browse files Browse the repository at this point in the history
fix(server): generate tetsudou.json when deleteRPM
  • Loading branch information
korewaChino authored Jan 18, 2025
2 parents c92e919 + fbed77c commit 0d84c5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions server/repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,10 @@ func (router *reposRouter) deleteRPM(w http.ResponseWriter, r *http.Request) {
panic(err)
}
}

if err := rpm.WriteTetsudouMetadata(targetDirectory); err != nil {
panic(err)
}

w.WriteHeader(http.StatusNoContent)

Expand Down
6 changes: 3 additions & 3 deletions server/rpm/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func CreateRepo(repoPath string) error {
return err
}

if err := writeTetsudouMetadata(repoPath); err != nil {
if err := WriteTetsudouMetadata(repoPath); err != nil {
return err
}

Expand Down Expand Up @@ -57,14 +57,14 @@ func UpdateRepo(repoPath string) error {
return err
}

if err := writeTetsudouMetadata(repoPath); err != nil {
if err := WriteTetsudouMetadata(repoPath); err != nil {
return err
}

return nil
}

func writeTetsudouMetadata(repoPath string) error {
func WriteTetsudouMetadata(repoPath string) error {
// We calculate and write some metadata for Tetsudou, which is our mirroring system
// This is not strictly necessary for the repo to function, but it's useful for our use case (and possibly others)
repomd, err := os.Open(path.Join(repoPath, "repodata/repomd.xml"))
Expand Down

0 comments on commit 0d84c5f

Please sign in to comment.