Skip to content

Commit

Permalink
Merge pull request #1 from txtsd/fork
Browse files Browse the repository at this point in the history
Rename fork
  • Loading branch information
txtsd authored Oct 29, 2023
2 parents f88c7ae + 4523174 commit 1bc6939
Show file tree
Hide file tree
Showing 9 changed files with 737 additions and 445 deletions.
899 changes: 617 additions & 282 deletions LICENSE

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
NAME := aurpublish
NAME := archosaur
PREFIX ?= /usr/local
HOOKSDIR ?= $(PREFIX)/share/aurpublish
HOOKSDIR ?= $(PREFIX)/share/archosaur
ZCOMPDIR ?= $(PREFIX)/share/zsh/site-functions
MANS = doc/aurpublish.1
MANS = doc/archosaur.1
BASHCOMPDIR ?= $(shell pkg-config bash-completion --variable=completionsdir || echo '/usr/share/bash-completion/completions')

edit = sed -e 's|@HOOKSDIR@|$(HOOKSDIR)|g'
Expand Down
73 changes: 59 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,82 @@
# PKGBUILD management framework for the [Arch User Repository](https://aur.archlinux.org)
# archosaur

A package management framework for the [Arch User Repository](https://aur.archlinux.org)

## Meaning

### Etymology

From translingual Archosauria (“taxonomic division of extinct reptiles”), from
Ancient Greek ἄρχων (árkhōn, “leader”) + σαύρα (saúra, “lizard”).

### Noun

**archosaur** (plural archosaurs)

1. A reptile of the taxon Archosauria, which includes modern crocodilians and
birds, as well as the extinct pterosaurs, non-avian dinosaurs and other taxa.
2. Certainly, definitely, absolutely, not `Arch OS AUR`.

## Install
The standard `make && sudo make install` routine is used. The following additional variables are supported:

The standard `make && sudo make install` routine is used. The following
additional variables are supported:

* `DESTDIR` -- staged installs for distro packaging
* `PREFIX` -- where to install generated script, defaults to /usr/local
* `HOOKSDIR` -- where to install [githooks](#hooks), defaults to `<PREFIX>/share/aurpublish`
* `HOOKSDIR` -- where to install [githooks](#hooks), defaults to `<PREFIX>/share/archosaur`

## How it works
Commit PKGBUILDs in named subdirectories. Export them to the AUR with the `aurpublish` command, using the subtree push stratagem.
This preserves an independent history for third-party hosting, pull requests... ;)

Commit PKGBUILDs in named subdirectories. Export them to the AUR with the `archosaur`
command, using the subtree push stratagem. This preserves an independent history
for third-party hosting, pull requests, etc.

## Commands
* `aurpublish setup`

* `archosaur setup`

> Initialize a new repository with [githooks](#hooks).
* `aurpublish PACKAGE`
* `archosaur PACKAGE`

> Push PACKAGE to the AUR. With "--speedup", merges the split history back in.
* `aurpublish -p PACKAGE`
* `archosaur -p PACKAGE`

> Pull package from the AUR (if you adopted an existing package, or have a co-maintainer).
* `aurpublish log PACKAGE`
* `archosaur log PACKAGE`

> View the git log of a package subtree.
* `import-from-aur3.sh PACKAGE`
> Experimental. Download the history of a non-migrated AUR3 package, and commit it to a new subtree.

> Experimental. Download the history of a non-migrated AUR3 package, and commit
it to a new subtree.

## Hooks

* pre-commit
> Warn about whitespace errors, fail if checksums don't match, and auto-generate .SRCINFO for all changed PKGBUILDs.

> Warn about whitespace errors, fail if checksums don't match, and auto-generate
.SRCINFO for all changed PKGBUILDs.

* prepare-commit-msg
> Prefill the commit message with a list of added/updated/deleted packages + versions (if any).

## Copyright
This repository is licensed under the GPLv2 or (at your option) any later version.
> Prefill the commit message with a list of added/updated/deleted packages + versions
(if any).

* post-commit.hook

> Prevents .SRCINFO file rollbacks in the worktree caused by using `git commit --only`.
## License

This repository is licensed under `GPL-3.0-or-later`.

## Credits

Thanks to [eli-schwartz](https://github.com/eli-schwartz) for
[aurpublish](https://github.com/eli-schwartz/aurpublish), and to the
[#archlinux-aur](ircs://irc.libera.chat:6697/#archlinux-aur) community on Libera!
18 changes: 9 additions & 9 deletions aurpublish.in → archosaur.in
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ is_package_in_git() {
#### Do the great option check

if [[ $# -eq 0 ]]; then
echo "error: No arguments passed. aurpublish needs a package to upload."
echo "Error: No arguments passed. archosaur needs a package to upload."
exit 1
fi
while [[ "${1}" != "" ]]; do
Expand Down Expand Up @@ -81,7 +81,7 @@ while [[ "${1}" != "" ]]; do
;;
*)
if [[ -n ${package} ]]; then
echo "error: multiple packages specified"
echo "Error: Multiple packages specified"
exit 1
fi
package=$(readlink -m "${1}")
Expand All @@ -97,20 +97,20 @@ done
# Run from the repository root, no matter where the script is installed.
toplevel=$(git rev-parse --show-toplevel) || exit 1
if [[ $(git rev-parse --is-inside-git-dir) = true ]]; then
echo "error: cannot be run from within GIT_DIR"
echo "Error: Cannot be run from within GIT_DIR"
exit 1
elif [[ ! ${toplevel} -ef ${PWD} ]]; then
cd "${toplevel}"
fi

# sanity check
if ! git rev-parse -q --verify HEAD > /dev/null ; then
echo "error: cannot be run from a branch without any commits"
echo "Error: Cannot be run from a branch without any commits"
echo "At least commit a README.md or something..."
exit 1
fi
if (( ! ( PULL_SUBTREE || SETUP ) )) && ! is_package_in_git "${package}"; then
echo "${0##*/}: unrecognized package '${package}'"
echo "${0##*/}: Unrecognized Package '${package}'"
echo "Try '${0##*/} --help' for more information."
exit 1
fi
Expand Down Expand Up @@ -141,15 +141,15 @@ pkgbase="$(sed -rn 's/pkgbase = (.*)/\1/p' "${package}"/.SRCINFO 2>/dev/null)"
if (( PULL_SUBTREE )); then
# test if prefix already exists
if is_package_in_git ${package}; then
git subtree split -P "${package}" --rejoin
git subtree pull -P "${package}" aur:${pkgbase}.git master -m "Merge subtree '${package}'"
git subtree split -P "${package}" --rejoin -m "splpkg: ${package} ($(git rev-parse --short HEAD))"
GIT_MERGE_AUTOEDIT=no git subtree pull -P "${package}" aur:${pkgbase}.git master -m "mrgpkg: ${package}"
else
git subtree add -P "${package}" aur:${package}.git master
git subtree add -P "${package}" aur:${package}.git master -m "addpkg: ${package} ($(git rev-parse --short HEAD))"
fi
exit 0
fi

if (( SPEEDUP )); then
git subtree split -P "${package}" --rejoin
git subtree split -P "${package}" --rejoin -m "splpkg: ${package} ($(git rev-parse --short HEAD))"
fi
git subtree push -P "${package}" aur:${pkgbase}.git master
4 changes: 2 additions & 2 deletions completion/aurpublish.bash → completion/archosaur.bash
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ __in_array() {
}


_aurpublish() {
_archosaur() {
local cur prev opts pkgnames
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
Expand Down Expand Up @@ -48,4 +48,4 @@ _aurpublish() {
fi
}

complete -F _aurpublish aurpublish
complete -F _archosaur archosaur
2 changes: 1 addition & 1 deletion completion/aurpublish.zsh → completion/archosaur.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#compdef aurpublish
#compdef archosaur

local curcontext="$curcontext" state line libs idx
local -a pkg_dirs packages
Expand Down
27 changes: 14 additions & 13 deletions doc/aurpublish.1.asciidoc → doc/archosaur.1.asciidoc
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
aurpublish(1)
archosaur(1)
=============

Name
----
aurpublish - PKGBUILD management framework for the Arch User Repository
archosaur - A PKGBUILD management framework for the Arch User Repository


Synopsis
--------
'aurpublish' [options] PACKAGE
'archosaur' [options] PACKAGE

'aurpublish' log [<options>] PACKAGE
'archosaur' log [<options>] PACKAGE

'aurpublish' setup
'archosaur' setup


Description
-----------
Aurpublish is an utility which helps maintainers of aur packages to submit updates.
Archosaur is an utility which helps maintainers of aur packages to submit updates.


How it works
------------
Commit PKGBUILDs in named subdirectories.
Export them to the AUR with the aurpublish command, using the subtree push
Export them to the AUR with the archosaur command, using the subtree push
stratagem. This preserves an independent history for third-party hosting,
pull requests... ;)
pull requests, etc.

Commands
--------
Expand All @@ -39,7 +39,7 @@ Commands
Options
-------

*-p* <PACKAGE>::
*-p*, *--pull* <PACKAGE>::
Instead of publishing, pull changes from the AUR.
Can import packages into a new subtree.

Expand All @@ -66,20 +66,21 @@ Hooks
Examples
--------

aurpublish setup::
archosaur setup::
Initialize a new repository with git hooks. Refer to Hooks section
for more info.

aurpublish -p ansible-core-git::
archosaur -p ansible-core-git::
Clone existing package from aur and add its url as a git subtree to
the currently existing git repository.

aurpublish ansible-core-git::
archosaur ansible-core-git::
Push an existing subtree to AUR.

aurpublish log::
archosaur log::
View the git log of a package subtree.

AUTHORS
-------
txtsd <code@ihavea.quest>
Eli Schwartz <eschwartz@archlinux.org>
92 changes: 0 additions & 92 deletions import-from-aur3.sh

This file was deleted.

Loading

0 comments on commit 1bc6939

Please sign in to comment.