Commit Graph

46 Commits

Author SHA1 Message Date
Eli Schwartz 68f0bff172
commitpkg: clearly delineate the commit message template and the rationale
In commit 75d23eec94 we moved to include
commitpkg arguments as the first line of the svn commit message, but we
simply dumped the result after the version number without separating the
two, increasing the cognitive burden of parsing the rationale. Since the
whole point of the change was to make it easier to see what happened
when using git log --oneline (reducing the cognitive burden of parsing
'pretty' output with author/date info), it makes sense to also delineate
the reason correctly.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
2019-11-30 13:21:23 +01:00
Daniel M. Capella 75d23eec94
commitpkg: Include commit msg arg in first line
Commit messages belong on the first line, with optional "explanatory
text" starting after a blank line:
https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html

Referencing commit ee970f0bde

Signed-off-by: Daniel M. Capella <polyzen@archlinux.org>
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2019-11-07 21:28:17 +01:00
Levente Polyak f32a264796
commitpkg: prefer explicit signature+data parameters for gpg --verify
Lets prefer the explicit variant of gpg --verify by providing both, the
signature and the data file as parameters.
For the unlikely case there is a matching signature file already present
that was created outside of the toolchain and has an embedded signature
with data, we at least could detect it early with this check.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2019-09-28 00:16:07 +02:00
Levente Polyak fd6e801cfb
commitpkg: disallow if PKGBUILD hash mismatches package's enclosed hash
Several cases showed that we release packages that were built with
different PKGBUILDs than the one commited to the source tree. This is
bad for obvious reasons plus sploils reproducible builds.

We, under no circumstances, want to allow using commitpkg to publish and
release a packages whose PKGBUILD doesn't match the one to be commited.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2019-09-28 00:16:04 +02:00
Levente Polyak a3868cf542
commitpkg: fix wrongly ordered find_cached_package call
The unknown packager check didn't worked so far as the wrongly ordered
call to find_cached_package lead to the enclosing block never being
executed.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2019-09-28 00:16:02 +02:00
Bartłomiej Piotrowski 7259e7def0 Remove i686 support 2017-11-08 14:22:56 +01:00
Luke Shumaker a9dab95334
Add `# shellcheck` directives to quiet shellcheck, add PKGBUILD.proto
The added PKGBUILD.proto file is so that shellcheck can know know what
to expect that a PKGBUILD sets.
2017-07-05 18:21:56 +02:00
Luke Shumaker a396a69081
Make slightly more involved changes to make shellcheck happy.
- Use `read -r` instead of other forms of read or looping
 - Use arrays instead of strings with whitespaces.
 - In one instance, use ${var%%.*} instead of $(echo $var|cut -f. -d1)
2017-07-05 18:21:56 +02:00
Luke Shumaker 78fabcfa06
Quote strings that shellcheck warns about.
These changes are all strictly "slap some double-quotes in there".
Anything more than that is not included in this commit.
2017-07-05 18:21:56 +02:00
Luke Shumaker 3f72579b28
Make purely stylistic changes to make shellcheck happier.
These are purely stylistic changes that make shellcheck complain less.

This does NOT include things like quoting currently unquoted variables.
2017-07-05 18:21:55 +02:00
lukeshu@parabola.nu 6098253f6f
Handle makepkg.conf more consistently 2017-04-05 22:17:51 +02:00
Luke Shumaker cb35d74f8c
Avoid using string interpolation; use printf format strings instead.
This involves extending the signature of lib/common.sh's `stat_busy()`,
`lock()`, and `slock()`. The `mesg=$1; shift` in stat_busy even suggests
that this is what was originally intended from it.
2017-04-05 22:11:16 +02:00
Luke Shumaker 14d5e1c21b
Add a "License:" tag to all code files.
In cases where there is no license specified, the file is tagged as
"License: Unspecified".  Obviously, that is not ideal, but it
highlights the fact, and I hope that it encourages whoever has the
authority to specify the license to do so.

On that note, to anyone who may have the authority to specify the
license of files in devtools: the current licence of many files is
GPLv2 with no option for later versions; I impore you to re-license
them to have the "or any later version" option.
2017-04-05 22:10:03 +02:00
Luke Shumaker ae82f88e51
commitpkg: Adjust fancy quoting/escaping to not confuse Emacs.
It was confusing Emacs and screwing up the syntax highlighting and
auto-indentation for the rest of the file.
2017-04-05 22:10:03 +02:00
Sven-Hendrik Haase 7fc22b9aba Use repos.archlinux.org everywhere instead of hostname based domains
This makes it a lot easier to swap out the host that actually serves the repos in the future.
2016-05-27 21:02:46 +02:00
Johannes Löthberg 763d8ffb53 commitpkg: Force unarmored signatures
Pacman cannot handle armored signatures, so force a generation of a
binary one using the --no-armor flag.
2015-06-06 15:22:33 +03:00
Dave Reisner 27441f201c common: implement find_cached_package
This function (currently) searches through $PWD and $PKGDEST looking
for a tarball matching the requested package name, architecture, and
pkgver. If found, it writes the full path to the located package to
stdout and returns 0, else 1. If more than 1 match is found, it's
treated as an error and the user will need to figure out what to do.

Use this in checkpkg and commitpkg, which previously implemented their
own less complete logic, to locate the build artifacts they rely on.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-11-01 18:52:03 +01:00
Dave Reisner c4f72f781b commitpkg: check all files at once for version control
Instead of dying at the first sight of an unversioned file, this lets
commitpkg dump all known unversioned files at once.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-11-01 18:40:15 +01:00
Dave Reisner 914ebe3a74 ensure that PKGBUILDs aren't sourced via PATH
Fixes FS#36378.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-08-18 18:17:31 +02:00
Dave Reisner be3c71fa81 avoid injecting code into the format string
Now that die() properly forwards arguments to error(), we can expect
that the first arg is a format string and not the entirety of the
output.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-08-08 21:28:10 +02:00
Pierre Schmitz 9cef7e0a9e Use nymeria instead of gerolde 2013-01-20 18:24:04 +01:00
Eric Bélanger 890baf6891 Make sure the usage functions are consistent
The usage messages now begins with a "Usage:", i.e. capitalized and with a colon. Fixes FS#26956.

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-11-15 15:25:07 +01:00
Pierre Schmitz 21458bd07b For now only packages and svn from sigurd will be moved to nymeria 2012-11-11 21:07:34 +01:00
Pierre Schmitz fdeaed894a Use nymeria.archlinux.org as shared host for developers and trusted users 2012-11-03 17:32:33 +01:00
Pierre Schmitz d8ec9c9066 Use sigurd.archlinux.org instead of the now moved aur.archlinux.org hostname 2012-10-27 20:30:24 +02:00
Pierre Schmitz a23d93ce7f commitpkg: check if there are any packages to process before doing so 2012-06-16 16:56:42 +02:00
Lukas Fleischer fda394f1a0 Gracefully handle files containing an "@"
The "@" sign in file names in SVN marks the beginning of a pegged
version number -- from the Subversion book:

    Peg revisions are specified to the Subversion command-line client
    using at syntax, so called because the syntax involves appending an
    “at sign” (@) and the peg revision to the end of the path with which
    the revision is associated.

The trivial workaround is to always append an at sign to the end of the
path in the version control checks.

Before:

    $ community-stagingpkg 'Add systemd units.'
    ==> ERROR: exim-submission@.service is not under version control
    $ svn status -v | grep 'exim-submission@.service'
    A                -       ?   ?           exim-submission@.service

After:

    $ community-stagingpkg 'Add systemd units.'
    ==> Committing changes to trunk...done
    ==> Signing package exim-4.80-2-x86_64.pkg.tar.xz...
    [...]

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-06-10 12:47:40 +02:00
Allan McRae addea828fe Prevent packages being uploaded with "Unknown Packager"
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-06-10 12:46:32 +02:00
Pierre Schmitz 502813a107 commitpkg: Pass through the -f parameter to archrelease so unofficial repos can be used 2012-03-05 16:48:19 +01:00
Pierre Schmitz 82dcc19ff9 commitpkg: Add ability to override the server
This might be useful for unofficial repos
2012-03-04 22:38:07 +01:00
Allan McRae afc93f3430 Always sign unsigned packages
We do not allow packages to be uploaded without signatures so force
all unsigned packages to be signed.  This has the bonus of not
breaking makepkg signing support by requiring you use an internal
makepkg variable.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-02-15 11:25:49 +01:00
Florian Pritz 06a681ca3d commitpkg: use absolute paths when uploading files
This fixes a problem where rsync won't work if the pkgver contains a
colon (epoch). In this case rsync assumes that the colon is a
remote:path separator and having src and dest both being remote
arguments is not supported.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-02-06 21:15:57 +01:00
Pierre Schmitz b763788b16 Fix typo: It's PKGDEST and not DESTDIR 2012-01-19 18:45:01 +01:00
Dave Reisner 2d79191c97 commitpkg: behavior more sanely in searching for built pkgs
In the case of a .pkg.tar.xz and a .pkg.tar.gz existing in the same
directory, all commitpkg would say is:

  ==> WARNING: Could not find . Skipping x86_64

Upon digging into the logic, we did a few things poorly, mostly in
getpkgfile:

- getpkgfile tried to die in a subshell (within the command substituion
  assignment to 'pkgfile'). This will never work.
- We assumed that proper glob expansion happened when we received
  exactly 1 arg. This isn't necessarily true without nullglob in effect.
- We dumped the real error (spewed by getpkgfile) to /dev/null.
- We checked for the package twice in both $PWD and $DESTDIR/.
- We checked for file existance multiple times.

Address this by:

- not hiding errors. revamp the wording a little bit to make it more
  obvious why we failed, particularly in the case of a glob expanding to
  more than 1 file. Logic here is simplified to pointing out the failure
  cases of 0 and >1.
- setting nullglob so the number of arguments passed into getpkgfile is
  meaningful from a 'did it decisively resolve' point of view.
- not trying to exit the entire script from a subshell. Just return a
  value (and use it).
- avoiding the package file existance check afterwards. this is a
  freebie from getpkgfile when the glob passed fails to expand.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-01-18 11:06:51 +01:00
Lukas Fleischer 56d4dec19f Use double brackets everywhere
We already fixed a couple of these in previous patches - this one should
replace all remaining uses of single brackets ("[") by double brackets.
Also, use arithmetic evaluation instead of conditional expressions where
appropriate and make use of "-z" and "-n" instead of comparing variables
to empty strings.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-12-04 18:00:57 +01:00
Pierre Schmitz f62f307c84 Add support for kde-unstable and gnome-unstable 2011-12-04 17:48:46 +01:00
Pierre Schmitz 8efe61b4e2 Skip archrelease for missing architectures 2011-11-21 10:24:29 +01:00
Lukas Fleischer b7a3c74c50 commitpkg: Fix commit message
Move the message template before the if block. We moved this to the else
branch in commit aaa68e49e8 which lead to
"msgtemplate" being unset if one specifies a commit message on the
command line, thus stripping the "upgpkg:" part.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-11-04 19:38:11 +01:00
Eric Bélanger a33ee6e78d commitpkg: Make svn quieter
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-11-04 19:34:50 +01:00
Eric Bélanger 42d821ef7b Capitalize output messages
Some of the output/error messages were capitalized, some were
not. This patch capitalize everything for consistency sake. Other
minor changes were done to the messages like removing the superfluous
"error:" from die messages and adding a final period to messages that
were complete sentences as appropriate.

Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-11-04 19:33:29 +01:00
Pierre Schmitz aaa68e49e8 Move common functions to a shared file
* common.sh is included on build time
* most functions are copied from makepkg
2011-11-01 15:33:08 +01:00
Pierre Schmitz c238cfafa0 commitpkg: Require signatures for packages 2011-10-31 13:53:43 +01:00
Pierre Schmitz 0e58198f36 commitpkg: Check signature if available 2011-10-31 13:14:16 +01:00
Pierre Schmitz e07d318c54 commitpkg: Skip signing if signature already exists 2011-10-31 12:53:50 +01:00
Lukas Fleischer bea69043fb commitpkg: Sync changelog/install check with makepkg(8)
makepkg(8) currently uses a smarter method to extract all changelog and
install files from a PKGBUILD. Sync commitpkg to use the same code (with
small modifications). This also adds support for changelog/install files
that contain a whitespace.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2011-10-29 13:19:10 +02:00
Lukas Fleischer 46c4def073 Support non-standard install locations
This build system overhaul allows for adding (define-style) macros to
our scripts. All source files are now suffixed with ".in" to clarify
that they might contain unprocessed defines. The Makefile provides a new
rule to preprocess source files and generate proper output scripts.

Also, add a "@pkgdatadir@" define (as used in GNU Autotools) and use it
instead of hardcoded paths to "/usr/share/devtools" everywhere. We
missed this when adding PREFIX support to the build system in commit
35fc83ce7d.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-07 21:53:02 +02:00