summaryrefslogtreecommitdiff
path: root/scripts/repo-add.sh.in
Commit message (Collapse)AuthorAge
* repo-add: fix path designation regressionDave Reisner2011-06-23
| | | | | | | | | | b899099 made path checking a bit more strict than I had intended, and would actually forbid creation of a repo in $PWD if only the filename was specified. readlink would be the fun and easy solution here, but it's avoided due to portability issues, making the validation process a bit more verbose. Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: style cleanupDave Reisner2011-06-22
| | | | | | | Unify function braces to be top right opening, bottom left closing. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: show better error when path to repo does not existDave Reisner2011-06-20
| | | | | | | | | | | | | | | | Previously, the error message when trying to add to a repo where a parent directory didn't exist was: ==> ERROR: Failed to acquire lockfile: /path/to/noexist/repo.tar.gz.lck This sucks. Make an explicit check to ensure that the path to the repo really does exist, and throw a meaningful error message when it can't be found. Dan: reuse an existing (translated) error message. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: allow creating a database with no compressionDan McGee2011-06-20
| | | | | | | | A plain '.tar' ending should be allowed. This corresponds to how we handle this extension in makepkg. Also fix up the other extension checks, which were missing a leading '.' character. Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: use bash equivalents of basename/dirnameDave Reisner2011-06-20
| | | | Signed-off-by: Dave Reisner <d@falconindy.com>
* scripts: refactor output formatting functionsAllan McRae2011-06-15
| | | | | | | | | Move the common output formatting functions into a separate library file and import that into each script. makepkg is excluded due to its additional color formatting. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2011-06-02
|\ | | | | | | | | Conflicts: src/pacman/callback.c
| * repo-add: anchor exclusion pattern when generating filelistDan McGee2011-06-02
| | | | | | | | | | | | | | | | | | Fixes FS#24534. Dotfiles, such as /etc/skel/.bash_profile, were not being included in generated files entries. bsdtar --exclude option supports anchors on the pattern, so using "^.*" instead of ".*" solves our problem and still excludes all root-level dotfiles (e.g. .PKGINFO). Signed-off-by: Dan McGee <dan@archlinux.org>
* | repo-add: update copyright messageAllan McRae2011-04-24
| | | | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | repo-add: check for gpg earlyAllan McRae2011-04-24
| | | | | | | | | | | | | | Check for the presence of gpg as soon as we know we need it. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | repo-add: check for valid key when signing is requestedAllan McRae2011-04-24
| | | | | | | | | | | | | | Follow the example of makepkg Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | repo-add: add option to specify a different key to sign withDenis A. Altoé Falqueto2011-04-24
| | | | | | | | | | | | | | | | | | Add -k/--key option to specify a non-default key for signing a package database. Original-patch-by: Denis A. Altoé Falqueto <denisfalqueto@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | repo-add: simplify usage messageAllan McRae2011-04-24
| | | | | | | | | | | | | | | | | | | | | | Listing every option on the usage line becomes unweildly as more options get added so simplify it. Also, provide a standard package name in the repo-add example. Dan: just use 'options' as we use elsewhere, not 'option(s)'. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Clean up repo-add usage messageRay Kohler2011-03-27
| | | | | | | | | | | | | | | | This now includes -s and -v, tailors itself to the current command, and is formatted more like that of other pacman commands. Signed-off-by: Ray Kohler <ataraxia937@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Sign database even if emptyRay Kohler2011-03-27
| | | | | | | | | | | | | | | | Move the create_signature() call outside the case of non-empty databases, so it will be called regardless. Signed-off-by: Ray Kohler <ataraxia937@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Rely on the return value of type instead of its outputDave Reisner2011-03-27
| | | | | | | | | | Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Fix use of relative paths for packages in repo-addRay Kohler2011-03-24
| | | | | | | | | | | | | | | | | | Move checksum and pgpsig calcluation before changing into the tmpdir, otherwise we can't find the files if a relative path was used. Signed-off-by: Ray Kohler <ataraxia937@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | repo-add: add sha256sum values to repo databaseDan McGee2011-03-23
| | | | | | | | | | | | | | Implements FS#23103. Also modify libalpm so it ignores this value without any warning as we know it is likely to exist. Signed-off-by: Dan McGee <dan@archlinux.org>
* | repo-add: add symlink to signature fileAllan McRae2011-03-23
| | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* | repo-add: Fix up usage with GPG optionsDan McGee2011-03-23
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | repo-add: add -v/--verify optionDan McGee2011-03-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is intended to verify an existing signature on a database before making further changes to it and performing updates. Rarely would you use this without immediately resigning it via the -s/--sign option. Instead, it is intended as a "chain of trust" operation where the previous signature is verified to give you some sense that what you sign off on is also safe. Still todo: don't make changes unless the signature is not only good, but also in the accepted list of keys. Signed-off-by: Dan McGee <dan@archlinux.org>
* | repo-add: allow signing of the package databaseDan McGee2011-03-23
| | | | | | | | | | | | | | | | | | | | | | | | | | In order to be fully secure, we can't only sign packages. We also need to sign our repository metadata to prevent database falsification, dependency injection, etc. Add an '-s/--sign' option that allows this functionality, and will generate a .sig file side-by-side with the package database. While at it, fix the issue where a signature file would never be found because of 'cd' madness (this needs fixing in another commit). Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add PGPSIG field in repo-addGeoffroy Carrier2011-03-23
|/ | | | | | | | Use base64 encoding to store the value in the database if a .sig file exists for the package being added. Signed-off-by: Geoffroy Carrier <geoffroy.carrier@koon.fr> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix some easy to find double translationsDan McGee2011-02-28
| | | | | | | | A lot of these were places that should have used the same message but didn't, or were very easy to convert to using the same message and letting some of the burden off of the translators. Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'epoch-work'Dan McGee2011-01-22
|\
| * Remove epoch as an independent fieldDan McGee2011-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | repo-add: only attempt to create deltas when askedAllan McRae2011-01-22
|/ | | | | | | | | | repo-add should only attempt to create the delta file when using the -d option. Also adjust a couple of tests to use the "double bracket" syntax. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: fix misguided conditional correctionDan McGee2011-01-13
| | | | | | | | I tried to move things around here when testing and did a bit too much; the warning message always showed regardless of delta inclusion in the call. Fix it so we only warn if we have a filename, but the file couldn't be located. Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: Create/modify files databasesPyroPeter2011-01-11
| | | | | | | | | Implements FS#11302. Dan: updated docs to not reference pkgfile. Signed-off-by: PyroPeter <abi1789@googlemail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: use pushd/popdDan McGee2011-01-11
| | | | | | | | Rather than explicit cd calls, we can use the directory stack to our advantage. This also removes the need to store and restore $startdir, so kill the variable entirely. Signed-off-by: Dan McGee <dan@archlinux.org>
* Make repo-add and makepkg epoch-awareDan McGee2010-10-13
| | | | | | | | | | Allow it to be a variable in the PKGBUILD as well as propagating it through to the built package and the package database. We leave some backward compatibility in place by placing the '%FORCE%' option in the database if the package contains an epoch; this will be used by older versions of pacman and more or less ignored by versions that use epoch. 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>
* repo-add: more informative delta messagesXavier Chantry2010-10-11
| | | | | | | | | - Print an error if database entry was not found and delta entry cannot be added - More informative line when delta entry is added (oldfile -> newfile) Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: add delta generationXavier Chantry2010-10-11
| | | | | | | | | This allows deltas to be generated at repo-add invocation time as opposed to just added to the database. It will generate the delta from the package version currently in the database. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: make --quiet output more quietAllan McRae2010-09-27
| | | | | | Fixes FS#20403. Signed-off-by: Allan McRae <allan@archlinux.org>
* repo-add: create relative DB symlinksDan McGee2010-08-18
| | | | | | | | | | As noted in FS#20498, if an absolute path is used for specifying the database when invoking repo-add, the symlink generated will point to the absolute path instead of being relative to the directory. Fix this for the two linking cases, but leave the copy untouched so that will still work. Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: try symlink, then hardlink, then copy for DB fileDan McGee2010-06-24
| | | | | | | | | We were seeing some issues when trying to create our new database alias using symlinks on certain filesystems (see FS#19907). Have a fallback method in place where we first try a symlink, then a hard link, then just copy the database if all else fails. Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: symlink to db file to reponame.dbAllan McRae2010-05-27
| | | | | | | | This is a small step towards allowing pacman to handle databases with variable compression types. Signed-off-by: Allan McRae <allan@archlinux.org> 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>
* makepkg, repo-add: replace external commands with bash substitutions where ↵Cedric Staniewski2009-10-20
| | | | | | | | | | possible This also removes the awk dependency from makepkg and repo-add. Signed-off-by: Cedric Staniewski <cedric@gmx.ca> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix stderr redirectionCedric Staniewski2009-10-11
| | | | | | | | | When redirecting both stderr and stdout and using the 2>&1 construct, you have to redirect stdout first. Otherwise stderr will be redirected to the 'old' stdout and not to the new resource. Signed-off-by: Cedric Staniewski <cedric@gmx.ca> Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2009-09-29
|\ | | | | | | | | Conflicts: lib/libalpm/dload.c
| * repo-remove: create empty DB when all packages are removedDan McGee2009-09-23
| | | | | | | | | | | | | | | | | | | | | | | | Rather than creating no database at all, create an empty zipped tar archive in its place. This keeps the download side of repositories a bit more sane as a DB will always exist, and pacman handles this empty case just fine. For this to be fully transparent, we also need to make sure repo-add and repo-remove accept an empty "DB" as an argument, which in reality is a completely void of files .tar.{gz,bz2,xz} archive. Signed-off-by: Dan McGee <dan@archlinux.org>
* | repo-add: clean up options parsingDan McGee2009-09-23
|/ | | | | | | | | | | | | -f/--force has been dead for a while, so kill it off. In addition, the check for > 2 args is pretty useless when you do something like: repo-add -q -q or a more legit: repo-add -q /path/to/mine.db.tar.gz So instead make repo-add just return 1 when it doesn't do anything with the database which seems to make more sense. Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: clarify one messageXavier Chantry2009-08-03
| | | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: add pkgbase to .PKGINFO and database for split packagesAllan McRae2009-07-22
| | | | | | | | | | | | | With split packages, the pkgbase variable provides a useful way to find out which packages were build from the same PKGBUILD. Add it to the packages .PKGINFO file and the repo database only when package splitting is used. Original-patch-by: Pierre Schmitz <pierre@archlinux.de> [Allan: restrict to including only with spilt packages and include after pkgname] Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: use bsdtar optimization for better performanceDan McGee2009-06-23
| | | | | | | | | | | | | | | | | | | | | | | When unzipping packages and the database archives, we don't need to look through the entire archive to do what we need to do. For packages, .PKGINFO should only be found once and should be the first file in the package. For the database check, we only really need to look for one desc file. The bsdtar -q option is very similar to the GNU tar --occurrence=1 option. Example of speedup: $ time repo-add junkdb.db.tar.gz *.pkg.tar.gz >/dev/null real 0m16.159s user 0m14.836s sys 0m2.277s $ time ./scripts/repo-add junkdb.db.tar.gz *.pkg.tar.gz >/dev/null real 0m4.949s user 0m3.730s sys 0m2.093s Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: fail early if repo can not be createdXavier Chantry2009-05-23
| | | | | | | | | Before this commit, the repo creation could fail after all packages have been added to the database. Now this will be detected before adding anything. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add support for the xz archive formatPierre Schmitz2009-05-18
| | | | | | | | | | This simple patch adds support for the xz archive format to makepkg and repo- add. Xz can be used as source, package and package db file type. Signed-off-by: Pierre Schmitz <pierre@archlinux.de> [Dan: fixed a few alignment issues] Signed-off-by: Dan McGee <dan@archlinux.org>