[pacman-dev] [PATCH] src/pacman: strip any leading / in --overwrite arguments
Allow both `pacman -S foo --overwrite /usr/lib/foo.sh` and
`pacman -S foo --overwrite usr/lib/foo.sh` (with any number
of leading / ignored) to semantically mean the same thing.
Update the documentation to reflect this change.
Signed-off-by: Joey Pabalinas
On 06/01/2018 05:50 AM, Joey Pabalinas wrote:
Allow both `pacman -S foo --overwrite /usr/lib/foo.sh` and `pacman -S foo --overwrite usr/lib/foo.sh` (with any number of leading / ignored) to semantically mean the same thing.
Already done in https://lists.archlinux.org/pipermail/pacman-dev/2018-May/022515.html
Signed-off-by: Joey Pabalinas
@@ -317,10 +317,12 @@ static void invalid_opt(int used, const char *opt1, const char *opt2) static int parsearg_util_addlist(alpm_list_t **list) { char *i, *save = NULL;
for(i = strtok_r(optarg, ",", &save); i; i = strtok_r(NULL, ",", &save)) { + /* strip any leading slashes */ + i += strspn(i, "/"); *list = alpm_list_add(*list, strdup(i)); }
return 0; }
This function is used in several places, where it refers to package names or groups. I would expect --ignore=/foo to not work, rather than be replaced by "foo". We should not be modifying this function for every use... -- Eli Schwartz Bug Wrangler and Trusted User
participants (2)
-
Eli Schwartz
-
Joey Pabalinas