This is a 2 patch series which teaches pacman to save backup files with extension .pacsave.n Patch 1/2 introduces _alpm_mbasename and _alpm_mdirname from src/pacman/util.c into libalpm. These 2 functions are used in Patch 2/2. Patch 2/2 teaches pacman to save backup files with extension .pacsave.n We look at the existing <name>.pacsave files, find the largest n, and rename each existing <name>.pacsave.n file to <name>.pacsave.n+1 . If <name>.pacsave exists, it shall be renamed to <name>.pacsave.1 . The newest backup file is then saved as <name>.pacsave . Pang Yan Han (2): libalpm: Introduce _alpm_mbasename and _alpm_mdirname Save backup files with extension .pacsave.n lib/libalpm/remove.c | 75 ++++++++++++++++++++++++++++++++++++++++ lib/libalpm/util.c | 42 ++++++++++++++++++++++ lib/libalpm/util.h | 2 + test/pacman/tests/remove012.py | 20 +++++++++++ 4 files changed, 139 insertions(+), 0 deletions(-) create mode 100644 test/pacman/tests/remove012.py -- 1.7.6