diff options
Diffstat (limited to 'add_remove_packages.sh')
-rw-r--r-- | add_remove_packages.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/add_remove_packages.sh b/add_remove_packages.sh new file mode 100644 index 000000000000..f23481e1e152 --- /dev/null +++ b/add_remove_packages.sh @@ -0,0 +1,25 @@ +# Functions for adding and removing packages from repositories + +# Add a package to the specified repository +function add_package() { + local repository_name="$1"; shift + local package_name="$1"; shift + + aursync --repo "${repository_name}" --root "${PATH_REPOSITORIES}/${repository_name}/pkg/" "${package_name}" +} + +# Remove a package from the specified repository +function remove_package() { + local repository_name="$1"; shift + local package_name="$1"; shift + + local previous_wd="$(pwd)" + + cd "${PATH_REPOSITORIES}/${repository_name}" + + repo-remove "${PATH_REPOSITORIES}/${repository_name}/${LOCAL_DB_FILE}" "${package_name}" + + rm "${PATH_REPOSITORIES}/${repository_name}/pkg/${package_name}-*.pkg.tar.xz" + + cd "${previous_wd}" +}
\ No newline at end of file |