Commit Graph

16 Commits

Author SHA1 Message Date
Eli Schwartz 93dbb14ab9
archrelease: actually fail in failure conditions
When svn ls fails due to network timeouts, this currently results in
archrelease deleting all files, then committing this as the changeset.
This causes data loss...

With bash 4.4 and using wait $! we can get return the return code of the
last backgrounded command -- which process substitution qualifies as.
Key off of this to make sure that `svn ls` actually succeeded.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
2019-08-09 19:41:53 +02:00
Jan Alexander Steffens (heftig) 086ff8b9e7
archrelease: Whitespace adjustment 2017-07-05 18:35:16 +02:00
Laurent Carlier via arch-projects 041afb5f07
archrelease: sync the repos directory before commiting changes 2017-07-05 18:23:38 +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 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
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
Dan McGee f7615fe7d7 Fix releasing files with '@' in name
SVN treats '@' as a revision specifier, so with the addition of systemd
spawning service files, we need to ensure it doesn't screw things up.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-10-13 20:40:09 +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
Lukas Fleischer 9ab0d94578 archrelease: Validate tags before releasing
Compare every single tag with a list of valid tags. This prevents broken
releases which occurred whenever someone made a typo on the command
line:

    $ ./archrelease community i686
    ==> ERROR: archrelease: Invalid tag: "community" (use -f to force release)

Since the list is used in the ZSH completion as well, break it out to a
separate file and move it to "lib/". Also, add a command line parameter
to allow for releasing to an unknown repository when necessary.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2012-02-12 12:35:14 +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
Lukas Fleischer fe2040cd14 archrelease: Fix SVN error when repository is empty
If trash is empty, `svn rm -q "${trash[@]}"` fails with:

    svn: Try 'svn help' for more info and then
    svn: Not enough arguments provided

This doesn't result in any further malfunction but is kind of confusing
and unexpected. Skipping `svn rm` on an empty trash fixes this.

Reported-by: Alexander Rødseth <rodseth@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-12 16:53:08 +02:00
Dan McGee 022cd3d523 archrelease: call 'svn copy' once for all files
We don't need to invoke svn copy on each file; it accepts multiple
arguments. This cut Allan's time releasing one patch-friendly package
from 5 minutes to 2 minutes.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-10-07 21:53:04 +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