summaryrefslogtreecommitdiffstats
path: root/src/pacman/remove.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pacman/remove.c')
-rw-r--r--src/pacman/remove.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/pacman/remove.c b/src/pacman/remove.c
index 5c8568ca..2092ccf0 100644
--- a/src/pacman/remove.c
+++ b/src/pacman/remove.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <libintl.h>
#include <alpm.h>
/* pacman */
@@ -60,11 +61,11 @@ int pacman_remove(list_t *targets)
pkgnames = alpm_grp_getinfo(grp, PM_GRP_PKGNAMES);
- MSG(NL, ":: group %s:\n", alpm_grp_getinfo(grp, PM_GRP_NAME));
+ MSG(NL, _(":: group %s:\n"), alpm_grp_getinfo(grp, PM_GRP_NAME));
PM_LIST_display(" ", pkgnames);
- all = yesno(" Remove whole content? [Y/n] ");
+ all = yesno(_(" Remove whole content? [Y/n] "));
for(lp = alpm_list_first(pkgnames); lp; lp = alpm_list_next(lp)) {
- if(all || yesno(":: Remove %s from group %s? [Y/n] ", (char *)alpm_list_getdata(lp), i->data)) {
+ if(all || yesno(_(":: Remove %s from group %s? [Y/n] "), (char *)alpm_list_getdata(lp), i->data)) {
finaltargs = list_add(finaltargs, strdup(alpm_list_getdata(lp)));
}
}
@@ -77,10 +78,10 @@ int pacman_remove(list_t *targets)
/* Step 1: create a new transaction
*/
if(alpm_trans_init(PM_TRANS_TYPE_REMOVE, config->flags, cb_trans_evt, cb_trans_conv) == -1) {
- ERR(NL, "failed to init transaction (%s)\n", alpm_strerror(pm_errno));
+ ERR(NL, _("failed to init transaction (%s)\n"), alpm_strerror(pm_errno));
if(pm_errno == PM_ERR_HANDLE_LOCK) {
- MSG(NL, " if you're sure a package manager is not already running,\n"
- " you can remove %s\n", PM_LOCK);
+ MSG(NL, _(" if you're sure a package manager is not already running,\n"
+ " you can remove %s\n"), PM_LOCK);
}
FREELIST(finaltargs);
return(1);
@@ -90,12 +91,12 @@ int pacman_remove(list_t *targets)
/* check if the package is in the HoldPkg list. If so, ask
* confirmation first */
if(list_is_strin(i->data, config->holdpkg)) {
- if(!yesno(":: %s is designated as a HoldPkg. Remove anyway? [Y/n] ", i->data)) {
+ if(!yesno(_(":: %s is designated as a HoldPkg. Remove anyway? [Y/n] "), i->data)) {
return(1);
}
}
if(alpm_trans_addtarget(i->data) == -1) {
- ERR(NL, "failed to add target '%s' (%s)\n", (char *)i->data, alpm_strerror(pm_errno));
+ ERR(NL, _("failed to add target '%s' (%s)\n"), (char *)i->data, alpm_strerror(pm_errno));
retval = 1;
goto cleanup;
}
@@ -105,12 +106,12 @@ int pacman_remove(list_t *targets)
*/
if(alpm_trans_prepare(&data) == -1) {
PM_LIST *lp;
- ERR(NL, "failed to prepare transaction (%s)\n", alpm_strerror(pm_errno));
+ ERR(NL, _("failed to prepare transaction (%s)\n"), alpm_strerror(pm_errno));
switch(pm_errno) {
case PM_ERR_UNSATISFIED_DEPS:
for(lp = alpm_list_first(data); lp; lp = alpm_list_next(lp)) {
PM_DEPMISS *miss = alpm_list_getdata(lp);
- MSG(NL, " %s: is required by %s\n", alpm_dep_getinfo(miss, PM_DEP_TARGET),
+ MSG(NL, _(" %s: is required by %s\n"), alpm_dep_getinfo(miss, PM_DEP_TARGET),
alpm_dep_getinfo(miss, PM_DEP_NAME));
}
alpm_list_free(data);
@@ -132,10 +133,10 @@ int pacman_remove(list_t *targets)
PM_PKG *pkg = alpm_list_getdata(lp);
i = list_add(i, strdup(alpm_pkg_getinfo(pkg, PM_PKG_NAME)));
}
- list_display("\nTargets:", i);
+ list_display(_("\nTargets:"), i);
FREELIST(i);
/* get confirmation */
- if(yesno("\nDo you want to remove these packages? [Y/n] ") == 0) {
+ if(yesno(_("\nDo you want to remove these packages? [Y/n] ")) == 0) {
retval = 1;
goto cleanup;
}
@@ -145,7 +146,7 @@ int pacman_remove(list_t *targets)
/* Step 3: actually perform the removal
*/
if(alpm_trans_commit(NULL) == -1) {
- ERR(NL, "failed to commit transaction (%s)\n", alpm_strerror(pm_errno));
+ ERR(NL, _("failed to commit transaction (%s)\n"), alpm_strerror(pm_errno));
retval = 1;
goto cleanup;
}
@@ -156,7 +157,7 @@ cleanup:
FREELIST(finaltargs);
if(alpm_trans_release() == -1) {
- ERR(NL, "failed to release transaction (%s)\n", alpm_strerror(pm_errno));
+ ERR(NL, _("failed to release transaction (%s)\n"), alpm_strerror(pm_errno));
retval = 1;
}