Skip to content

Commit a5423a2

Browse files
committed
pacman-mirror: add the 'remove' command
This command will not trigger the package to be removed from the remote Pacman repository right away; it will still need to be pushed. The need arose when MSys2 added a 'markdown' package, obsoleting Git for Windows' own 'markdown' package. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 858020d commit a5423a2

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

pacman-mirror.sh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#
1212
# - 'add' to add packages to the local mirror
1313
#
14+
# - 'remove' to make the next 'push' skip the given package(s)
15+
#
1416
# - 'push' to synchronize local changes (after calling `repo-add`) to the
1517
# remote Pacman repository
1618

@@ -25,12 +27,12 @@ export CURL_CA_BUNDLE
2527

2628
mode=
2729
case "$1" in
28-
fetch|add|push)
30+
fetch|add|remove|push)
2931
mode="$1"
3032
shift
3133
;;
3234
*)
33-
die "Usage: $0 ( fetch | push | add <package>... )"
35+
die "Usage: $0 ( fetch | push | ( add | remove ) <package>... )"
3436
;;
3537
esac
3638

@@ -174,6 +176,22 @@ add () { # <file>
174176
done
175177
}
176178

179+
remove () { # <package>...
180+
test $# -gt 0 ||
181+
die "What packages do you want to add?"
182+
183+
for package
184+
do
185+
for arch in $architectures
186+
do
187+
(cd "$(arch_dir $arch)" &&
188+
rm $package-*.pkg.tar.xz &&
189+
repo-remove git-for-windows.db.tar.xz $package)
190+
done
191+
done
192+
}
193+
194+
177195
update_local_package_databases () {
178196
for arch in $architectures
179197
do

0 commit comments

Comments
 (0)