From 71fcb69028d6e02bc7f24459918e504d261f86cd Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 19 Apr 2012 12:46:48 -0400 Subject: contrib: use a separate build rule for bash scripts Treat bash scripts separately from the others to allow for a different build rule, which is reused from the scripts/ subdir. Signed-off-by: Dave Reisner --- contrib/Makefile.am | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'contrib/Makefile.am') diff --git a/contrib/Makefile.am b/contrib/Makefile.am index a3d2d42b..3936e23d 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -4,16 +4,22 @@ AUTOMAKE_OPTIONS = std-options bin_SCRIPTS = \ $(OURSCRIPTS) -OURSCRIPTS = \ +BASHSCRIPTS = \ bacman \ paccache \ pacdiff \ paclist \ paclog-pkglist \ pacscripts \ - pacsearch \ pacsysclean +OTHERSCRIPTS = \ + pacsearch + +OURSCRIPTS = \ + $(BASHSCRIPTS) \ + $(OTHERSCRIPTS) + OURFILES = \ bash_completion \ zsh_completion @@ -50,12 +56,17 @@ edit = sed \ -e 's|@SIZECMD[@]|$(SIZECMD)|g' \ -e '1s|!/bin/bash|!$(BASH_SHELL)|g' -$(OURSCRIPTS): Makefile +$(OTHERSCRIPTS): Makefile $(AM_V_at)$(RM) $@ $@.tmp $(AM_V_GEN)$(edit) $(srcdir)/$@.in >$@.tmp $(AM_V_at)chmod +x,a-w $@.tmp $(AM_V_at)mv $@.tmp $@ +$(BASHSCRIPTS): Makefile + $(AM_V_at)$(RM) $@ + $(AM_V_GEN)test -f $(srcdir)/$@.in && m4 -P -I $(srcdir) $(srcdir)/$@.in | $(edit) >$@ + $(AM_V_at)chmod +x,a-w $@ + $(OURFILES): Makefile $(AM_V_at)$(RM) $@ $@.tmp $(AM_V_GEN)$(edit) $(srcdir)/$@.in >$@.tmp -- cgit v1.2.3-24-g4f1b From 1b494ab77198a6cbb9c06a13435159641e2dc0c5 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 19 Apr 2012 12:55:20 -0400 Subject: contrib: rename bash scripts: .in -> .sh.in For consistency with the scripts/ directory, ensure that all bash scripts use the same pre-build suffix. Signed-off-by: Dave Reisner --- contrib/Makefile.am | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'contrib/Makefile.am') diff --git a/contrib/Makefile.am b/contrib/Makefile.am index 3936e23d..5139b54d 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -26,15 +26,15 @@ OURFILES = \ EXTRA_DIST = \ PKGBUILD.vim \ - bacman.in \ + bacman.sh.in \ bash_completion.in \ - paccache.in \ - paclog-pkglist.in \ - pacdiff.in \ - paclist.in \ - pacscripts.in \ + paccache.sh.in \ + paclog-pkglist.sh.in \ + pacdiff.sh.in \ + paclist.sh.in \ + pacscripts.sh.in \ pacsearch.in \ - pacsysclean.in \ + pacsysclean.sh.in \ vimprojects \ zsh_completion.in \ README @@ -64,7 +64,7 @@ $(OTHERSCRIPTS): Makefile $(BASHSCRIPTS): Makefile $(AM_V_at)$(RM) $@ - $(AM_V_GEN)test -f $(srcdir)/$@.in && m4 -P -I $(srcdir) $(srcdir)/$@.in | $(edit) >$@ + $(AM_V_GEN)test -f $(srcdir)/$@.sh.in && m4 -P -I $(srcdir) $(srcdir)/$@.sh.in | $(edit) >$@ $(AM_V_at)chmod +x,a-w $@ $(OURFILES): Makefile @@ -85,15 +85,15 @@ uninstall-local: $(RM) $(DESTDIR)$(sysconfdir)/bash_completion.d/pacman $(RM) $(DESTDIR)$(datarootdir)/zsh/site-functions/_pacman -bacman: $(srcdir)/bacman.in +bacman: $(srcdir)/bacman.sh.in bash_completion: $(srcdir)/bash_completion.in -paccache: $(srcdir)/paccache.in -pacdiff: $(srcdir)/pacdiff.in -paclist: $(srcdir)/paclist.in -paclog-pkglist: $(srcdir)/paclog-pkglist.in -pacscripts: $(srcdir)/pacscripts.in +paccache: $(srcdir)/paccache.sh.in +pacdiff: $(srcdir)/pacdiff.sh.in +paclist: $(srcdir)/paclist.sh.in +paclog-pkglist: $(srcdir)/paclog-pkglist.sh.in +pacscripts: $(srcdir)/pacscripts.sh.in pacsearch: $(srcdir)/pacsearch.in -pacsysclean: $(srcdir)/pacsysclean.in +pacsysclean: $(srcdir)/pacsysclean.sh.in zsh_completion: $(srcdir)/zsh_completion.in # vim:set ts=2 sw=2 noet: -- cgit v1.2.3-24-g4f1b From 03acea832ad39fa371781f045c39677a02d1156a Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 17 Apr 2012 21:34:30 -0400 Subject: validate bash scripts with 'bash -n' during build. Use the no-exec mode of $(BASH_SHELL) to check for syntax errors in shell scripts. Since we use the extglob feature in various places, this requires that we pass -O extglob to the shell as well, to ensure that the parser is armed to handle this syntax. Signed-off-by: Dave Reisner --- contrib/Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'contrib/Makefile.am') diff --git a/contrib/Makefile.am b/contrib/Makefile.am index 5139b54d..3cc1e578 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -66,6 +66,7 @@ $(BASHSCRIPTS): Makefile $(AM_V_at)$(RM) $@ $(AM_V_GEN)test -f $(srcdir)/$@.sh.in && m4 -P -I $(srcdir) $(srcdir)/$@.sh.in | $(edit) >$@ $(AM_V_at)chmod +x,a-w $@ + @$(BASH_SHELL) -O extglob -n $@ $(OURFILES): Makefile $(AM_V_at)$(RM) $@ $@.tmp -- cgit v1.2.3-24-g4f1b From 6d10de881e0ca38d8f20384e20139784589ea2c7 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 19 Apr 2012 13:33:57 -0400 Subject: paccache: adopt parseopts for options parsing Add longopts and update usage. This removes the TODO item and incorporates --help/--version into the standard option set. Signed-off-by: Dave Reisner --- contrib/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/Makefile.am') diff --git a/contrib/Makefile.am b/contrib/Makefile.am index 3cc1e578..fe2fa550 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -88,7 +88,7 @@ uninstall-local: bacman: $(srcdir)/bacman.sh.in bash_completion: $(srcdir)/bash_completion.in -paccache: $(srcdir)/paccache.sh.in +paccache: $(srcdir)/paccache.sh.in $(top_srcdir)/scripts/library/parseopts.sh pacdiff: $(srcdir)/pacdiff.sh.in paclist: $(srcdir)/paclist.sh.in paclog-pkglist: $(srcdir)/paclog-pkglist.sh.in -- cgit v1.2.3-24-g4f1b From 953415c86a17c1db8bebbbaca89e6fd5783386b6 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 22 Apr 2012 17:38:48 -0400 Subject: rankmirrors: move to contrib/ This script is of questionable value, as it ranks mirrors by an uninteresting attribute: ping. While the script itself is interesting, people should be encouraged to rank mirrors by more useful measures, such as actual speed, locality, or up to date-ness. Signed-off-by: Dave Reisner --- contrib/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'contrib/Makefile.am') diff --git a/contrib/Makefile.am b/contrib/Makefile.am index fe2fa550..a325d62a 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -11,7 +11,8 @@ BASHSCRIPTS = \ paclist \ paclog-pkglist \ pacscripts \ - pacsysclean + pacsysclean \ + rankmirrors OTHERSCRIPTS = \ pacsearch @@ -35,6 +36,7 @@ EXTRA_DIST = \ pacscripts.sh.in \ pacsearch.in \ pacsysclean.sh.in \ + rankmirrors.sh.in vimprojects \ zsh_completion.in \ README @@ -95,6 +97,7 @@ paclog-pkglist: $(srcdir)/paclog-pkglist.sh.in pacscripts: $(srcdir)/pacscripts.sh.in pacsearch: $(srcdir)/pacsearch.in pacsysclean: $(srcdir)/pacsysclean.sh.in +rankmirrors: $(srcdir)/rankmirrors.sh.in zsh_completion: $(srcdir)/zsh_completion.in # vim:set ts=2 sw=2 noet: -- cgit v1.2.3-24-g4f1b