Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/commitpkg.in
diff options
context:
space:
mode:
authorMorten Linderud <foxboron@archlinux.org>2020-05-27 17:48:53 +0200
committerLevente Polyak <anthraxx@archlinux.org>2023-03-19 22:02:04 +0100
commit90aba4f84b001bc2063b104d93a1e43810c22cbb (patch)
tree87264a5ba7fcdc149cbb77fc85a51af34ba119cf /src/commitpkg.in
parent9297eb344e997b716ee3de9f17c7ebb33cd1791d (diff)
git: first iteration of git support
Signed-off-by: Morten Linderud <foxboron@archlinux.org> Adjusted-by: Levente Polyak <anthraxx@archlinux.org>
Diffstat (limited to 'src/commitpkg.in')
-rw-r--r--src/commitpkg.in46
1 files changed, 13 insertions, 33 deletions
diff --git a/src/commitpkg.in b/src/commitpkg.in
index 6b9d727..d57b30c 100644
--- a/src/commitpkg.in
+++ b/src/commitpkg.in
@@ -106,13 +106,13 @@ for key in "${validpgpkeys[@]}"; do
needsversioning+=("keys/pgp/$key.asc")
done
-# assert that they really are controlled by SVN
+# assert that they really are controlled by git
if (( ${#needsversioning[*]} )); then
- # svn status's output is only two columns when the status is unknown
- while read -r status filename; do
- [[ $status = '?' ]] && unversioned+=("$filename")
- done < <(svn status -v "${needsversioning[@]}")
- (( ${#unversioned[*]} )) && die "%s is not under version control" "${unversioned[@]}"
+ for file in "${needsversioning[@]}"; do
+ if ! git ls-files --error-unmatch "$file"; then
+ die "%s is not under version control" "$file"
+ fi
+ done
fi
rsyncopts=(-e ssh -p '--chmod=ug=rw,o=r' -c -h -L --progress --partial -y)
@@ -155,18 +155,18 @@ if [[ -z $server ]]; then
server='repos.archlinux.org'
fi
-if [[ -n $(svn status -q) ]]; then
+if [[ -n $(git status --short --untracked-files=no) ]]; then
msgtemplate="upgpkg: $pkgbase $(get_full_version)"
if [[ -n $1 ]]; then
- stat_busy 'Committing changes to trunk'
- svn commit -q -m "${msgtemplate}: ${1}" || die
+ stat_busy 'Committing changes'
+ git commit -q -m "${msgtemplate}: ${1}" || die
stat_done
else
[[ -z ${WORKDIR:-} ]] && setup_workdir
msgfile=$(mktemp --tmpdir="${WORKDIR}" commitpkg.XXXXXXXXXX)
echo "$msgtemplate" > "$msgfile"
- if [[ -n $SVN_EDITOR ]]; then
- $SVN_EDITOR "$msgfile" || die
+ if [[ -n $GIT_EDITOR ]]; then
+ $GIT_EDITOR "$msgfile" || die
elif [[ -n $VISUAL ]]; then
$VISUAL "$msgfile" || die
elif [[ -n $EDITOR ]]; then
@@ -175,8 +175,8 @@ if [[ -n $(svn status -q) ]]; then
vi "$msgfile" || die
fi
[[ -s $msgfile ]] || die
- stat_busy 'Committing changes to trunk'
- svn commit -q -F "$msgfile" || die
+ stat_busy 'Committing changes'
+ git commit -v -q -F "$msgfile" || die
unlink "$msgfile"
stat_done
fi
@@ -250,23 +250,3 @@ if [[ ${#uploads[*]} -gt 0 ]]; then
msg 'Uploading all package and signature files'
rsync "${rsyncopts[@]}" "${uploads[@]}" "$server:staging/$repo/" || die
fi
-
-if [[ "${arch[*]}" == 'any' ]]; then
- if [[ -d ../repos/$repo-x86_64 ]]; then
- pushd ../repos/ >/dev/null
- stat_busy "Removing %s" "$repo-x86_64"
- svn rm -q "$repo-x86_64"
- svn commit -q -m "Removed $repo-x86_64 for $pkgname"
- stat_done
- popd >/dev/null
- fi
-else
- if [[ -d ../repos/$repo-any ]]; then
- pushd ../repos/ >/dev/null
- stat_busy "Removing %s" "$repo-any"
- svn rm -q "$repo-any"
- svn commit -q -m "Removed $repo-any for $pkgname"
- stat_done
- popd >/dev/null
- fi
-fi