update: use the new package manager

This commit is contained in:
ngn 2024-08-15 04:17:49 +03:00
parent 0caafc793b
commit 22364da8be
3 changed files with 20 additions and 20 deletions

View File

@ -14,7 +14,7 @@ dist/xcfg: $(CSRCS) $(HEADERS)
mkdir -p dist
$(CC) $(CFLAGS) $(CSRCS) -o $@ -lncurses -lmenu -lm
locale/%.mo: locale/%.po
locale/%.mo: locale/%.po
msgfmt $^ -o $@
locale/%.po: locale/xcfg.pot
@ -24,7 +24,7 @@ locale/%.po: locale/xcfg.pot
echo "merge success: $@" ; \
else \
echo "merge failed: $@" ; \
mv $@.old $@ ; \
install -m644 $@.old $@ ; \
fi; \
locale/xcfg.pot: $(CSRCS)
@ -32,25 +32,25 @@ locale/xcfg.pot: $(CSRCS)
xgettext -k_ -c $^ -o $@
install:
mkdir -pv $(DESTDIR)$(prefix)/bin
install -v -m755 dist/xcfg $(DESTDIR)$(prefix)/bin/xcfg
mkdir -pv $(DESTDIR)/$(prefix)/bin
install -v -m755 dist/xcfg $(DESTDIR)/$(prefix)/bin/xcfg
@for po in $(PO_DIRS) ; do \
echo "installing locale: $$po/xcfg.mo" ; \
mkdir -pv $(DESTDIR)/usr/share/$$po ; \
cp $$po/xcfg.mo $(DESTDIR)/usr/share/$$po ; \
install -v -Ddm755 $(DESTDIR)/usr/share/$$po ; \
install -m644 $$po/xcfg.mo $(DESTDIR)/usr/share/$$po ; \
done
uninstall:
rm -v $(DESTDIR)$(prefix)/bin/xcfg
rm -v $(DESTDIR)/$(prefix)/bin/xcfg
clean:
rm dist/xcfg
rm locale/xcfg.pot
rm -v dist/xcfg
rm -v locale/xcfg.pot
@for po in $(PO_DIRS) ; do \
rm $$po/xcfg.mo ; \
done
format:
clang-format -i -style=file $(HEADERS) $(CSRCS)
clang-format -i -style=file $(HEADERS) $(CSRCS)
.PHONY: install defcfg uninstall clean
.PHONY: install uninstall clean

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-05-01 13:06+0300\n"
"POT-Creation-Date: 2024-08-15 04:16+0300\n"
"PO-Revision-Date: 2024-02-20 20:36+0300\n"
"Last-Translator: <ngn@ngn.tf>\n"
"Language-Team: Turkish <gnome-turk@gnome.org>\n"
@ -61,7 +61,7 @@ msgstr "Geliştirilmiş döşeme pencere yöneticisi"
#: src/main.c:144
#, fuzzy
msgid "mp is not installed!"
msgid "matt is not installed!"
msgstr "mp kurulu değil"
#: src/main.c:153

View File

@ -139,9 +139,9 @@ int main(int argc, char **argv, char **envp) {
{.name = "i3", .desc = _("Improved tiling window manager"), .pkg = "i3", .cmd = "i3\n"}
};
char *mpi_path = check_path("mp-install");
char *mpi_path = check_path("matt");
if (NULL == mpi_path) {
error(_("mp is not installed!"));
error(_("matt is not installed!"));
return EXIT_FAILURE;
}
free(mpi_path);
@ -176,32 +176,32 @@ int main(int argc, char **argv, char **envp) {
term_finish();
if (autox && !add_startx())
goto FAIL;
goto fail;
char xinitrc[PATH_MAX];
if (!joinhome(xinitrc, ".xinitrc")) {
error(_("Failed to get the home directory"));
goto FAIL;
goto fail;
}
FILE *xf = fopen(xinitrc, "w");
if (fwrite(desktops[indx].cmd, 1, strlen(desktops[indx].cmd), xf) < 0) {
error(_("Failed to write to %s"), xinitrc);
fclose(xf);
goto FAIL;
goto fail;
}
fclose(xf);
success(_("Configuration has been saved!"));
info(_("Installing %s"), desktops[indx].name, mpi_path);
char *args[] = {doas_path, "mp-install", desktops[indx].pkg, NULL};
char *args[] = {doas_path, "matt", "install", "--skip", desktops[indx].pkg, NULL};
if (execvp(doas_path, args) != 0) {
error(_("Installation failed"));
}
FAIL:
fail:
free(doas_path);
return EXIT_FAILURE;
}