summaryrefslogtreecommitdiff
path: root/scripts
Commit message (Collapse)AuthorAge
* makepkg: quote arrays in order to preserve spaces in array itemsCedric Staniewski2009-11-10
| | | | | | | | Fixes FS#16871 and makes the pkgdesc workaround obsolete. Signed-off-by: Cedric Staniewski <cedric@gmx.ca> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: allow passing arguments with spacesAllan McRae2009-10-24
| | | | | | | | | | | | | | | Currently makepkg takes the commandline arguments, assigns them to a variable and passes that variable to the next makepkg call (within fakeroot). Use a comination of quotes and arrays in this process to ensure any arguments passed within quotes and containing spaces stay as a single argument during the second makepkg call. Thanks to Dan for figuring out how to get this working. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: change preselected option for cleaning the cache from Y to NCedric Staniewski2009-10-24
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* 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>
* String improvementsXavier Chantry2009-09-16
| | | | | | | Add more untranslated strings, improve consistency, etc. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* fix typos in makepkg.sh.inFrancois Charette2009-09-06
| | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: always keep sources symlinksXavier Chantry2009-09-06
| | | | | | | | | | | | | | Make bunzip2/xz/gunzip decompressing to stdout, because gzip does not offer something like a -k option. The selection of the decompression command for gzip/bzip2/xz compressed files now also depends on the file suffix, since we need to strip the extensions to get the output filename. Thanks to Cedric Staniewski <cedric@gmx.ca> for reporting this issue and contributing patches. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: new --skipinteg optionXavier Chantry2009-09-06
| | | | | | | | | Implements FS#15830 This option allows to build a PKGBUILD with no checksums Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove builddeps from option parserAllan McRae2009-08-08
| | | | | | | Leftover from commit ae5ef3b9 Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: change to pkgdir before creating PKGINFO fileAllan McRae2009-08-08
| | | | | | | | Commit 01f9ae63 moved that creation of the PKGINFO file to before changing to pkgdir. This causes issues when using the -R option (FS#15851). Signed-off-by: Allan McRae <allan@archlinux.org> 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>
* Do not allow pkgnames to start with a hyphenCedric Staniewski2009-07-26
| | | | | | | | | | | | | | Commandline arguments starting with a hyphen are usually recognized as options by unix tools. Therefore, allowing hyphens at the beginning of a package name requires a different handling of pkgnames as suggested by rm's manpage. It would be possible to make the scripts 'hyphen-safe', but hyphen-prefixed packages will cause trouble for pacman users which do not know these tricks. Signed-off-by: Cedric Staniewski <cedric@gmx.ca> [Dan: remove the repo-add check] Signed-off-by: Dan McGee <dan@archlinux.org>
* Revert "makepkg: Exit on failure within build() or package() functions"Dan McGee2009-07-26
| | | | | | | | | | As reported in FS#15210, we have some problems with split packages and variable overrides because of this patch. For now, in prep for a release, it is best to back it out and see what we can do later. This reverts commit 621aa26e26fcf578221051e896d6440a0095b8a3. 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>
* makepkg: clean up BUILDSCRIPT usageAllan McRae2009-07-12
| | | | | | | | | | | | | | | | | | | | FS#15448 (which is made worse by the "fix" for FS#14727...), highlighted some deficiencies in the usage of the BUILDSCRIPT variable. In particular, only relative paths worked with "-p" and some output was very strange in combination with the "-p" flag or reading from /dev/stdin. e.g. "Please add a license line to your /dev/stdin!". This patch adds a new variable, BUILDFILE, which contains the full path to the BUILDSCRIPT. This defaults to $startdir/$BUILDSCRIPT. Also, fix a missed quoting of $BUILD{SCRIPT->FILE} and remove warning about missing BUILDSCRIPT definition in makepkg.conf as the default BUILDSCRIPT value is now specified during configure. Add check that BUILDFILE is writable before updating VCS PKGBUILDs. When making a source package, the BUILDSCRIPT always gets given the default name, regardless of what it was originally called. Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: allow spaces in source file namesAllan McRae2009-07-12
| | | | | | | The download command failed with sources that contained spaces. Remainder of fix for FS#15323. Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: fix breakage with '%' in source filenamesDan McGee2009-07-12
| | | | | | | | Ensure we don't pass a bare filename to printf that might contain a lookalike '%' escape sequence. Fixes part of FS#15323. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: quote filenames when extractingDan McGee2009-07-12
| | | | | | | We currently fall apart on files with spaces in the names. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: check for package functions when package splittingAllan McRae2009-07-10
| | | | | | | | Makes sure the required package functions are present when using package splitting. Also moves setting of pkgbase variable outside the check_sanity function to somewhere more appropriate. Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: fix pkgdesc restoration with split packagingAllan McRae2009-07-10
| | | | | | | | A pkgdesc with spaces in it would get restored to an array and thus only the first word would be restored (FS#15210). Convert that array back to a string. Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: Exit on failure within build() or package() functionsAllan McRae2009-07-10
| | | | | | | | | | Errors in build() functions were only fatal, if "--log" was enabled. Errors in package() functions were never fatal. Piping these functions through "cat -" triggers error trapping. This prevents the need for "|| return 1" usage in PKGBUILDs. Original-patch-by: Juergen Hoetzel <juergen@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: fix check for previously built packages with package splittingAllan McRae2009-07-10
| | | | | | | Checks if some or all packages are built before overwriting/installing. Adds some new strings for translation. Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: clean up moving PKGINFO creation to a functionAllan McRae2009-07-10
| | | | | | | Someone forgot to commit this when pulling in the original patch to his working branch... Signed-off-by: Allan McRae <allan@archlinux.org>
* Update copyright headers and messagesDan McGee2009-07-01
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge commit 'allan/working'Dan McGee2009-06-23
|\
| * makepkg: Move .PKGINFO creation into a function.Loui Chang2009-06-22
| | | | | | | | | | Signed-off-by: Loui Chang <louipc.ist@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
| * makepkg: Download sources and check checksums for any source package.Loui Chang2009-06-21
| | | | | | | | | | | | | | It wouldn't be very nice to ship a PKGBUILD with the wrong checksums. Signed-off-by: Loui Chang <louipc.ist@gmail.com> Signed-off-by: Allan McRae <allan@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>
* makepkg: fix variable backup/restore for splitpkgAllan McRae2009-06-13
| | | | | | | | | The backup and restore of variables that can be overridden while making split packages only dealt with the first element, not the whole array (FS#15010). Adjust the bash voodoo to fix it... Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: fix PKGBUILD sanity checkAllan McRae2009-06-13
| | | | | | | | If PKGBUILD was good, the "insane" variable was not defined and so the if statement failed. Simplify and fix this check. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: refactor sanity checking into a functionDan McGee2009-06-07
| | | | | | | | No new checks, just move it into a function and return 1 rather than exit directly. This also allows the use of local variables. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@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>
* repo-add: fix -n tests which are applicable only to stringsCedric Staniewski2009-05-18
| | | | | Signed-off-by: Cedric Staniewski <cedric@gmx.ca> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: fix sourcing BUILDSCRIPT and PATH issuesAllan McRae2009-05-16
| | | | | | | | | The bash source command looks in the users PATH for the file to source before the local directory. This causes issues when someone has a PKGBUILD somewhere in their path (for unknown some reason...). Fixes FS#14727. Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: Document package splittingAllan McRae2009-05-14
| | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: do not update pkgver when building source packageAllan McRae2009-05-14
| | | | | | | When making a source package for a SCM PKGBUILD, makepkg should not update the pkgver/pkgrel. Noted in FS#14456. Signed-off-by: Allan McRae <allan@archlinux.org>
* makepkg: several small fixesAllan McRae2009-05-11
| | | | | | | | | | | | | | | 1) Do not attempt to strip compressed binaries Original-work-by: Marc - A. Dahlhaus <mad@wol.de> 2) Add "\" in "GPL\'ed" so quote mark does not break source code highlighting 3) Add local to docdir paths in makepkg.conf for consistency 4) Use full path to sed in MacOSX in case users have GNU sed earlier in path Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: make in-place sed portableAllan McRae2009-04-26
| | | | | | | | | | | | | Do a sed replacement in-place is not very portable. On Mac OSX and BSDs, the syntax is "sed -i ''" where as with GNU sed the command is "sed -i''" or just "sed -i". This patch detects which command should be used during configure. Credit to Kevin Barry who researched this issue and provided a patch to work around this using temporary backup files. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'xav/repo-add'Dan McGee2009-04-11
|\
| * repo-add : rename gstmpdir to tmpdirXavier Chantry2009-03-15
| | | | | | | | | | | | What does gstmpdir mean? Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
| * repo-add : don't change the modification time on depends and descXavier Chantry2009-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The modification time on depends and desc file were changed to match the modification time of the package file. I don't see why and we are actualling losing information here. If we want to know the date of the package file, we can just look inside the depends file. If we want to know when the entry was created, we should not alter the modification time of depends and desc. Besides, this had the non-obvious and undocumented side effect that the depends file was always created, even if it was empty. And pacman actually does require that. So I added a "touch depends" to always create the file. Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
| * repo-add : new locking systemXavier Chantry2009-03-15
| | | | | | | | | | | | | | Weird things could happen if several repo-add were run concurrently on the same database. The introduced locking system will prevent this to happen. Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
| * repo-add : fix package variables declarationXavier Chantry2009-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - arch was missing - backup is not used by repo-add. However makepkg still needs to put it in PKGINFO because pacman uses it - startdir is no longer used after the new delta implementation - the declaration of group, depend, backup, etc is not needed because these variables are always declared before being used : declare $var="$val" case "$var" in group) _groups="$_groups$group\n" ;; - reorder the variables declaration to follow the same order than they are written to the depends and desc file, for making future checks easier Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
| * repo-add : rewrite delta supportXavier Chantry2009-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the correct database format Use xdelta3 to get the source and destination files from the delta itself Allow delta files to be added with repo-add just like package files. delta files can also be removed with repo-remove. This is simply done by looking for a .delta extension in the arguments, and calling the appropriate db_write_delta or db_remove_delta functions. Example usage: repo-add repo/test.db.tar.gz repo/libx11-1.1.99.2-2-x86_64.pkg.tar.gz repo-add repo/test.db.tar.gz repo/libx11-1.1.5-2_to_1.1.99.2-2-x86_64.delta repo-remove repo/test.db.tar.gz libx11-1.1.5-2_to_1.1.99.2-2-x86_64.delta Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
| * repo-add : drop delta support to rewrite it from scratchXavier Chantry2009-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation has several problems : Wrong database format All the info is taken from the filename, which is a bit ugly It looks for .delta files in the current directory when adding a package, which is not very flexible Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
| * repo-add.sh.in : repo-remove improvementsXavier Chantry2009-03-15
| | | | | | | | | | | | | | | | | | | | | | * report when a package entry to be removed is not found * backup and restore eventual "deltas" files * slight optimization when looking for an entry : only look at the entries starting with $pkgname Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
| * repo-add cleanupXavier Chantry2009-03-15
| | | | | | | | | | | | | | | | Refactor the main loop, which was difficult to read. Use case instead of if when appropriate. Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
| * Add pkgdelta script to create deltas.Xavier Chantry2009-03-15
| | | | | | | | | | | | | | | | | | | | | | | | This should obsolete the delta support in makepkg. Having a separate script should be more flexible. Example usage: $ pkgdelta repo/tzdata-2009a-1-x86_64.pkg.tar.gz repo/tzdata-2009b-1-x86_64.pkg.tar.gz ==> Generating delta from version 2009a-1 to version 2009b-1 ==> Generated delta : 'repo/tzdata-2009a-1_to_2009b-1-x86_64.delta' Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
| * Fix several issues with xdeltaXavier Chantry2009-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | | 1) The changes to sync.c look big but there are mostly caused by the indentation. Fix a bug where download_size == 0 because the packages and deltas are already in the cache, but we still need to build the deltas list and apply the deltas to create the final package. 2) Fix the gzip / md5sum issue by switching to xdelta3, disabling external recompression and using gzip -n in pacman, and disable bsdtar compression and using gzip -n in makepkg. Signed-off-by: Xavier Chantry <shiningxc@gmail.com>