Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor AURPKGBUILDRepos and Fix Localization Command in Makefile #2313

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ $(PACKAGE): $(BIN) $(RELEASE_DIR) ${MOFILES}
locale:
xgotext -in . -out po
for lang in ${LANGS}; do \
test -f po/$$lang.po || msginit -l po/$$lang.po -i po/${POTFILE} -o po/$$lang.po \
test -f po/$$lang.po || msginit --no-translator -l po/$$lang.po -i po/${POTFILE} -o po/$$lang.po; \
msgmerge -U po/$$lang.po po/${POTFILE}; \
touch po/$$lang.po; \
done
Expand Down
26 changes: 15 additions & 11 deletions pkg/download/aur.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,30 +63,34 @@ func AURPKGBUILDRepos(

for _, target := range targets {
sem <- 1

wg.Add(1)

go func(target string) {
newClone, err := AURPKGBUILDRepo(ctx, cmdBuilder, aurURL, target, dest, force)
defer func() {
<-sem
wg.Done()
}()

progress := 0
newClone, err := AURPKGBUILDRepo(ctx, cmdBuilder, aurURL, target, dest, force)

mux.Lock()
progress := len(cloned)
if err != nil {
errs.Add(err)
} else {
mux.Lock()
cloned[target] = newClone
progress = len(cloned)
mux.Unlock()
logger.OperationInfoln(
gotext.Get("(%d/%d) Failed to download PKGBUILD: %s",
progress, len(targets), text.Cyan(target)))
return
}

cloned[target] = newClone
progress = len(cloned)
mux.Unlock()

logger.OperationInfoln(
gotext.Get("(%d/%d) Downloaded PKGBUILD: %s",
progress, len(targets), text.Cyan(target)))

<-sem

wg.Done()
}(target)
}

Expand Down
Loading