Age | Commit message (Collapse) | Author |
|
Add "--help"/"-h" and "--version"/"-V" support to all contrib scripts.
Also, update scripts that used "-v" as a short option for "--version"
and use "-V" for the sake of consistency.
Additionally:
* Move version and usage messages to separate convenience functions in
all scripts.
* Add a workaround to paccache to support "--help" and "--version". This
should be replaced by a proper POSIX-compliant command line parser
that supports long options in a future patch.
* Add a "$myver" variable to all scripts and use it whenever we refer to
the program version (e.g. in version messages). Also, use the pacman
version number everywhere instead of using a different versioning
scheme for each contrib script. This is achieved by adding a
"PACKAGE_VERSION" placeholder that is replaced by sed(1) when the
script is built.
* Ensure we always return with exit status 0 if "--help" is used and
return with exit status 1 if we display the usage message due to
invalid arguments.
* Add "AUTOMAKE_OPTIONS = std-options" and add all scripts to
"bin_SCRIPTS" to make `make installcheck` check that installed scripts
actually support the "--help" and "--version" options.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Add a read-only variable "$myname" to every contrib script and hardcode
program names instead of relying on "$0". The variable name "$myname"
was chosen because it is already used in pacman and because we use
"$myver" to specify the program version in the official scripts.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
pkgrel, as with pkgver, simply mustn't contain hyphens.
Signed-off-by: lolilolicon <lolilolicon@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
The original code- pkg_dir="$(echo $pac_db/$pkg_name-[0-9]*)" is
problematic in several ways:
- $pac_db and $pkg_name should be quoted, obviously.
- It assumes pkgver always starts with an integer, while in fact
it just can't contain ':' and '-'.
Counterexample: the code breaks on lshw B.02.15-1.
- It assumes there are no more than one directory matching the
pattern. While this should be the case if everything works
perfectly, it certainly relies on external conditions.
Counterexample: if the local db contains two packages named
foo and foo-3g, even if everything else is perfect, the code
will match two directories.
Don't make assumptions, use what is known.
Signed-off-by: lolilolicon <lolilolicon@gmail.com>
|
|
bacman should support whatever makepkg does as PKGEXT.
Also remove obsolete $EXT variable.
Signed-off-by: lolilolicon <lolilolicon@gmail.com>
|
|
This includes:
- Quoting fixes.
- Drop deprecated mktemp option -p.
- Set extglob nullglob shell options at the top.
- Use extended globbing instead of regex to match %HEADER% in pacman db.
Signed-off-by: lolilolicon <lolilolicon@gmail.com>
|
|
Another style change. The [[ expression ]] form is particularly
cleaner, safer and more powerful than the [ expression ] form.
Signed-off-by: lolilolicon <lolilolicon@gmail.com>
|
|
As every piece of code in the whole project uses TAB as indentation
character, bacman shouldn't be an exception.
Signed-off-by: lolilolicon <lolilolicon@gmail.com>
|
|
vim recognises what type of shell script it's dealing with by looking at
the shebang. If detection fails it falls back to sh which doesn't
support some bash features. Adding a normal, possibly broken, shebang
which gets fixed by the Makefile allows vim to detect bash syntax.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Addresses FS#23641.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Instead, go the same route we have always taken with version-release in
libalpm and treat it all as one piece of information. Makepkg is the only
script that knows about epoch as a distinct value; from there on out we will
parse out the components as necessary.
This makes the code a lot simpler as far as epoch handling goes. The
downside here is that we are tossing some compatibility to the wind;
packages using force will have to be rebuilt with an incremented epoch to
keep their special status.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
BASH is defined when you are actually using bash during configure, which
sucks because it ends up being '/bin/sh', messing up all of our scripts.
Change the name of the variable we use in configure, and also ensure we get
a full path to the executable by using AC_PATH_PROGS rather than
AC_CHECK_PROGS. Finally, change the variable name everywhere we use it.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This applies to contrib/ files, our scripts, and the documentation.
Dan: fix 'make clean' in contrib/ directory.
Signed-off-by: Nezmer <git@nezmer.info>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This is needed If we want to use sysconfdir,localstatedir and other variables.
Signed-off-by: Nezmer <git@nezmer.info>
Signed-off-by: Dan McGee <dan@archlinux.org>
|