summaryrefslogtreecommitdiffstats
path: root/scripts
AgeCommit message (Collapse)AuthorFilesLines
2011-07-19pacman-key: check required permissions on keyringAllan McRae1-0/+20
Makes sure that the pacman keyring is readable and that the user has permissions to create a lock file if lock-never is not specified in the gpg.conf file. Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19pacman-key: add --init optionAllan McRae1-8/+26
Add an --init option that ensures that the pacman keyring has all the necessary files and they have the correct permissions for being read as a user. Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19pacman-key: tidy up logic for finding pacman keyring directoryDave Reisner1-5/+3
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19pacman-key: refactor get_fromDave Reisner1-8/+10
This function had a variety of pitfalls, including the inability to successfully find a key=value pair where no whitespace surrounded the equals sign. Make it more robust by splitting the line on the equals itself, and performing whitespace trimming on the resulting key/value pair. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19pacman-key: add --verify optionAllan McRae1-3/+7
Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19pacman-key: check only a single operation has been specifiedAllan McRae1-0/+16
Follow the example of gpg and only allow a single operation to be specified each time. Prevents having to deal with conflicting variable names and potential issues due to the order in which the operations are run. Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19pacman-key: move verifying keyring files to own functionAllan McRae1-20/+28
Also check all files before bailing on errors. Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19pacman-key: move --edit-key and --receive processing to functionsAllan McRae1-21/+26
This moves the processing of the --edit-key and --receive options to functions, keeping the final option processing to be all single line statements. Also rework the --edit-key option to validate all input before processing. Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19pacman-key: hide output of executed commands on logic checksIvan Kanakarakis1-4/+4
This commit correctly redirects to /dev/null the output of several commands that get executed on logic checks. Original-patch-by: Denis A. Altoé Falqueto <denisfalqueto@gmail.com> Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19pacman-key: rename --trust to --edit-keyAllan McRae1-8/+8
This keeps the naming of the option more consistent with what is actually being called by gpg. Original-patch-by: Denis A. Altoé Falqueto <denisfalqueto@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19pacman-key: fix quotation on several variable assignmentsIvan Kanakarakis1-8/+8
This commit adds quotes to several variable assignments. Unquoted values can cause problems on several occasions if the value is empty. It is safer to have every assignment quoted. Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
2011-07-19pacman-key: allow the export of all key idsAllan McRae1-3/+3
The gpg --export will exprt all keys if none are specified. Replicate this behavior in pacman-key. Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19pacman-key: rename --del to --deleteAllan McRae1-3/+3
There is already the short -d alias provided, so stay verbose with the longer option name. Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19pacman-key: remove the --adv optionAllan McRae1-11/+2
The conversion to using parse_options causes this option to break. It is preferable to remove the option rather than fix it as it is simply a wrapper for "gpg --homedir @sysconfdir@/pacman.d/gnupg". Any user using more advanced keyring management than provided by pacman-key can manage to point gpg at the right place themselves... How to manually edit the keyring with gpg will instead be documented in the man page in a later commit. Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-19pacman-key: use our option parserAllan McRae1-93/+98
The pacman-key script is complicated enough to warrent usage of the parse_options script. This is especially helpful in dealing with all the configuration file override flags as the no longer need to be specified first. It also allows us to do the right thing early with --help/--version and no option cases cleanly. This change also makde the check for root privileges only occur on operations where they are needed. This patch is inspired by and supercedes some patches submitted by Denis A. Altoé Falqueto and Ivan Kanakarakis who were altering the previous option handling in an attempt to deal with the above issues. Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-18Merge branch 'maint'Dan McGee1-1/+1
2011-07-18makepkg: fix issue with filenames with spaces and noextractAllan McRae1-1/+1
Specifying a filename with spaces in a PKGBUILDs noextract array fails due to a lack of quoting. Fixes FS#25100. Reported-by: Thomas Weißschuh <thomas_weissschuh@lavabit.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-18repo-add: do not print full path of signature fileAllan McRae1-1/+1
The full path to the signature file when it is created is in a temporary directory so only print the filename. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-18repo-add: always remove repo signature symlinkAllan McRae1-2/+1
This prevents a dangling symlink being left behind if the repo goes from being signed to unsigned. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-18makepkg: only test for writable PKGDEST when needed.Rogutės Sparnuotos1-1/+1
There is no need for a writable PKGDEST when using the --nobuild or --geninteg flags. Allan: added --geninteg Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-18Move some .gitignore entriesAllan McRae1-2/+3
Put a .gitignore entry at the right level and sort that file alphabetically. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-14makepkg: remove unused -C option from option listDave Reisner1-1/+1
We nuke it from the completion file as well along with its longopt. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-14makepkg: skip devel_check when reading from a pipeDave Reisner1-2/+2
Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-14makepkg: Remove pre-optimization from in_array()DJ Mills1-1/+0
The '[[ -z' test in in_array() is redundant, so remove it. Signed-off-by: DJ Mills <danielmills1@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-14makepkg: Remove OPT_TEMP hack in parse_options callDJ Mills1-3/+1
Instead of hacking around the error trap, simply do an explicit test for failure. Signed-off-by: DJ Mills <danielmills1@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2011-07-14Add 'compress' compression format as an available optionDan McGee2-0/+3
This adds the '.tar.Z' option to both repo-add and makepkg for no other reason than "why not", and because bsdtar supports it natively with the '-Z' flag. Also update the documentation accordingly. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-06repo-add: backup old database signature tooAllan McRae1-1/+5
If you are keeping a copy of the old database, you probably want to keep a copy of its signature too. Also, delete the previously backed-up database signature if no new one is being copied. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-06pacman-key: fix syntax highlightingAllan McRae1-1/+1
The lone quotation mark in "pacman's" causes issues for some syntax highlighting. Change the printing of the nessage from echo to printf so we can invisibly escape it. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-05Add library files to POTFILES.inAllan McRae1-0/+2
Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-05parse_options: accept multiple argumentsAllan McRae1-7/+23
Allow command-line options to accept multiple arguments without additional quoting by taking the list of arguments until one starting with a "-" is reached. The only current use of this is the --pkg option in makepkg. This allows (e.g.) makepkg --pkg foo bar and packages "foo" and "bar" will be built. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-05parse_options: implement optional argumentsAllan McRae1-4/+15
This allows options specified with a trailing "::" to optionally take arguments. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-05parse_options: add missing newlinesAllan McRae1-2/+2
Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-30fix vim syntax highlighting of .sh filesFlorian Pritz8-8/+8
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>
2011-06-30Merge remote-tracking branch 'dave/makepkg'Dan McGee1-5/+3
2011-06-30repo-add.sh.in: avoid being clever with repo repackingDave Reisner1-2/+7
Revert to the old behavior that 6f5a90 attempted to simplify and go with the original proposed solution of using "ugly" bash to detect empty directories. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-30repo-add: fix db creation one last timeDan McGee1-9/+11
We fubar-ed this pretty good. 1. The whole old/new move shuffle was totally busted if you used a relative path to your database, as we would just build the database in place. 2. Our prior temp directory layout had the database files extracted directly into it. When we tried to create a xxx.db.tar.gz file in this same directory, due to the fact that we were no longer using a shell wildcard, we tried to include the db in ourself, which is a big failure. Fix all this by extracting to tree/ so we can have a clean top-level temp directory. 3. Fix the inclusion of the './' directory entry; ensure the regex prunes both leading paths of '.' as well as './'. Where is that test suite again? Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-30makepkg: only source user override if using default config fileDan McGee1-2/+3
Otherwise there is no way to easily test or run with a standalone config file without outside interference. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-30makepkg: fix typo (missing quotes)Rémy Oudompheng1-2/+2
Signed-off-by: Rémy Oudompheng <remy@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-30makepkg: fix removing symbolic linkAllan McRae1-1/+1
The path was not being stripped from $file before prefixing with $srcdir resulting in the attempted removal of a very weird filename. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-29makepkg: simplify SIGNPKG checkDave Reisner1-3/+1
Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-29makepkg: fix vim syntax highlightingDave Reisner1-1/+1
Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-29makepkg: remove unneeded echoDave Reisner1-1/+1
Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-28Revert "Merge branch 'master' of git://projects.archlinux.org/pacman"Dan McGee1-1/+1
This reverts the merge of 2d32a9a3a348d25d6d0f3d12752399bf7fdf6570, which reverts the commit 8581694ceb63f4ed2854206b38574599c3d9df28. Thanks Dave for the dirty branch and non-clean rebase! :) Dave broke it.
2011-06-27repo-add: remove extra exit callDan McGee1-1/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-27pacman-optimize: use output libraryDan McGee2-11/+5
We already use msg() and error() in here, might as well just use the standard functions. In addition, fix one translated message that would have printed ERROR twice if anyone ever saw it. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-06-27Merge remote-tracking branch 'dave/repo-add'Dan McGee3-87/+120
2011-06-27repo-add: add new command, repo-elephantDave Reisner2-1/+27
_ _ / \__/ \_____ / / \ \ `\ ) \''/ ( |\ `\__)/__/'_\ / ` //_|_|~|_|_| ^""'"' ""'"' Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-27repo-add: enforce file extensionsDave Reisner1-9/+20
Allow one of 4 archive extensions: .tar{,.gz,.xz,.bz2} for each of the 2 valid repo extensions: .db and .files. Check for this via 'verify_repo_extension' directly after option parsing to assert that this extension is present, and again after files have been added to get the proper archive option for bsdtar. Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-27repo-add: move command invocation out of arg parsing loopDave Reisner1-11/+14
Signed-off-by: Dave Reisner <d@falconindy.com>
2011-06-27repo-add: refactor repacking of repo fileDave Reisner1-8/+2
Dump the whole conditional and filter the contents of the directory to create an empty or non-empty archive. Signed-off-by: Dave Reisner <d@falconindy.com>