summaryrefslogtreecommitdiff
path: root/scripts/pacman-optimize.sh.in
Commit message (Collapse)AuthorAge
* Fix typo in pacman-optimizeJason St. John2013-11-15
| | | | | Signed-off-by: Jason St. John <jstjohn@purdue.edu> Signed-off-by: Allan McRae <allan@archlinux.org>
* Fix whitespace and other formatting issuesJason St. John2013-11-15
| | | | | | | | | This commit: -- replaces space-based indents with tabs per the coding standards -- removes extraneous whitespace (e.g. extra spaces between function args) -- adds missing braces for a one-line if statement Signed-off-by: Jason St. John <jstjohn@purdue.edu>
* scripts: Add color to pacman-optimizeWilliam Giokas2013-03-08
| | | | | | | Color enabled by default, use --nocolor to disable colored output. Signed-off-by: William Giokas <1007380@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
* Update copyright year for 2013Allan McRae2013-01-03
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* pacman-optimize: standardize on openssl usage, only touch local/Dan McGee2012-03-08
| | | | | | | | | | | | | | | | | | | The rest of our scripts have been using `openssl dgst` rather than tools like `md5sum` for some time, so convert this one too. We also make the following other adjustments: * Use a `find -print0 | xargs -0` pipeline so paths with spaces and or newlines don't totally kill us. * Ensure the files we write out contain only paths relative to the database root, where we know the filenames should all be sane. * Remove use of `diff`, this was the only time we used it in scripts and we can get a cheap substitute by comparing file checksums instead. * Only touch the local/ part of the database. It makes little sense to do anything to the sync/ directory anymore as they are compressed single files that should be regularly written out in full and won't be fragmented on any sane filesystem. Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2012-02-20
|\ | | | | | | | | | | Conflicts: contrib/pacsysclean.in src/pacman/conf.h
| * scripts: unset CDPATH if cd is usedDan McGee2012-02-14
| | | | | | | | | | | | | | | | | | This wonderful/awful little bash shell variable wrecks havoc on `cd` calls in shell scripts. Unset CDPATH in makepkg where we use `cd` quite heavily. In pacman-optimize, we can move the change directory logic into the bsdtar call so we are left with no usages of `cd` in the script. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2012-01-30
|\| | | | | | | | | Conflicts: scripts/makepkg.sh.in
| * Make a few more copyright date tweaksDan McGee2012-01-30
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * scripts: always use printf with embedded gettextDave Reisner2012-01-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This addresses two problems: 1) echo's behavior is inconsistent when dealing with flags, and can potentially be problematic. $ echo -n $ echo -- -n -- -n 2) Always using the end of options markers prevents translated strings from throwing errors, as shown in FS#28069. The remaining "inconsistencies" are because printf is being used in a guaranteed safe manner, e.g. printf '%s\n' "$(gettext "--this can never break")" Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | scripts/*: Declare several constant variables read-onlyLukas Fleischer2011-12-07
| | | | | | | | | | | | | | | | Be more semantically accurate and avoid accidental overwriting of some configuration variables that are considered to be constant. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
* | scripts/*.sh.in: Honor TMPDIR environment variableLukas Fleischer2011-10-13
|/ | | | | | | | | | | | Replace "/tmp" with "${TMPDIR:-/tmp}" to allow for overriding the hardcoded path. Since we only use "/tmp" in conjunction with mktemp(1), we could also have used "--tmpdir", which is GNU-ish, however (and the BSD counterpart "-t" has been deprecated in GNU mktemp). Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
* fix vim syntax highlighting of .sh filesFlorian Pritz2011-06-30
| | | | | | | | | | 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>
* pacman-optimize: use output libraryDan McGee2011-06-27
| | | | | | | | 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>
* po/: split into scripts/po/ and src/pacman/po/Dan McGee2011-06-23
| | | | | | | | | | | | | This is the first step at separating the pacman message catalog and the scripts message catalog. Makefiles, configure.ac, and other such files are adjusted accordingly, as well as renaming files. The TEXTDOMAIN of scripts is also adjusted. Note that no actual pot or po files get changed here; these will get pruned in a future commit so each catalog contains only the necessary messages. Signed-off-by: Dan McGee <dan@archlinux.org>
* Update copyright years for 2011Allan McRae2011-01-07
| | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman-optimize: ensure database directory contains local/Dan McGee2010-12-12
| | | | | | And also default dbpath to the one we may find in pacman.conf. Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix bash shell location checkDan McGee2010-10-13
| | | | | | | | | | 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>
* Use sysconfdir, localstatedir, BASH instead of hardcoded valuesNezmer2010-10-11
| | | | | | | | | 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>
* Bump copyright dates to 2010Dan McGee2010-03-14
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* scripts: replace test builtin [ with shell keywords [[ and ((Cedric Staniewski2009-11-15
| | | | | | | | FS#16623 suggested this change for makepkg; this patch applies it to the remaining files in the scripts directory. Signed-off-by: Cedric Staniewski <cedric@gmx.ca> Signed-off-by: Dan McGee <dan@archlinux.org>
* Update copyright headers and messagesDan McGee2009-07-01
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Give pacman-optimize a refresherDan McGee2008-10-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch addresses quite a few lingering issues in the pacman-optimize script. FS#11767 provoked this look-over and the following issues were noticed and fixed: * If an alternate dbroot was specified, then the lockfile location was never updated to reflect it. The lockfile location is now set after all dbpath initialization. * The inclusion of a trailing slash on dbroot was problematic and led to the following command being executed: bsdtar -xpf /tmp/pacman-optimize.p12Q4vAUWY/pacman-db.tar.gz \ -C /var/lib/pacman/.new/ It is doubtful we meant to create a hidden directory like this below our database root, only to go and delete it a second later and then re-extract. Fix the whole thing by ensuring our dbpath has its trailing slash stripped and then appending it when necessary. * The DB extraction was performed twice for no real apparent reason. This opens the door for extraction problems the second time around, leaving you with no original database to fall back to. Change the behavior so we only extract once, and then perform a directory shuffle once we verify the checksums are correct. * Perform an explicit sync after we drop the new database on the disk. It should work better this way. * Tighten up our check for a pacman lockfile and the time we create one. There is still a possible race condition but the window is shorter. Signed-off-by: Dan McGee <dan@archlinux.org>
* scripts: allow usage when gettext is not installedDan McGee2008-02-17
| | | | | | | | | | | Address the issue of our scripts not working so great when gettext is not available. This has come up in multiple bug reports, and is relatively easy to address by adding a simple check and a stub function if gettext was not found that simply echos the original message. Addresses concerns from FS#9214 and FS#9607. Signed-off-by: Dan McGee <dan@archlinux.org>
* Update GNU GPL boilerplate and copyright datesDan McGee2007-12-10
| | | | | | | Update the GPL boilerplate to direct people to the GNU website for a copy of the license, as well as bump all of Judd's copyrights to 2007. Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman-optimize: add note saying sync would be helpfulDan McGee2007-11-13
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman-optimize: add check for diff/diffutilsDan McGee2007-10-08
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* scripts/*.sh.in: Clean up and fix a few bugsAndrew Fyfe2007-09-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | repo-add, repo-remove: 'bsdtar -c * | ...' doesn't work (you need '-f -'). Code clean up eliminated this bug. Removed the multiple checksum support, pacman now only supports MD5, so there's no need for the database to contain multiple checksums. Quote all variables containing file/dir names to prevent paths containing spaces from causing problems. Add msg, warning and error functions. General code clean up. pacman-optimize: Use a sub-directory in /tmp for working files to make it easier to clean up at the end. Add quotes round $@ in die and die_r, otherwise printf can't display the message correctly. makepkg: Disable colour output if stderr is not a tty. Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
* Switch repo-add, repo-remove, and pacman-optimize to bsdtarDan McGee2007-07-15
| | | | | | Relatively straightforward fixes (s/tar/bsdtar/g, add hyphens to options). Signed-off-by: Dan McGee <dan@archlinux.org>
* Make paragraph text in scripts single stringsDan McGee2007-07-06
| | | | | | | | It is much easier for translators to deal with paragraphs as strings rather than by lines. Take all usage and version information and convert it to this format. Signed-off-by: Dan McGee <dan@archlinux.org>
* Move scripts from *.in to *.sh.in so gettext can determine typeDan McGee2007-07-06
If we move the scripts from *.in to *.sh.in and *.py.in, gettext can pull the required strings to translate a whole lot easier. Do this. Signed-off-by: Dan McGee <dan@archlinux.org>