Metadata-Version: 2.1
Name: pacup
Version: 1.0.1
Summary: Help maintainers update pacscripts
Home-page: https://github.com/pacstall/pacup
License: GPL-3.0-or-later
Keywords: aur,cli,command line,console,debian,pacscript,pacstall,ubuntu,repology
Author: Sourajyoti Basak
Author-email: wiz28@protonmail.com
Requires-Python: >=3.8,<3.12
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: System
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Dist: httpx (>=0.22,<0.24)
Requires-Dist: packaging (>=21.3,<23.0)
Requires-Dist: rich (>=12.2.0,<13.0.0)
Requires-Dist: typer (>=0.4.1,<0.8.0)
Project-URL: Documentation, https://github.com/pacstall/pacup/wiki
Project-URL: Repository, https://github.com/pacstall/pacup
Description-Content-Type: text/markdown

<p align="center"><img alt="logo" src="https://raw.githubusercontent.com/pacstall/pacup/master/imgs/logo.png"></p>
<h1 align="center">Pacup</h1>
<p align="center">
  <a href="https://www.python.org/"><img alt="Python: 3.8+" src="https://img.shields.io/badge/python-3.8%2B-306998?logo=python&logoColor=white&style=for-the-badge"></a>
  <a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-black?style=for-the-badge"/></a>
  <a href="https://www.codacy.com/gh/pacstall/pacup/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=pacstall/pacup&amp;utm_campaign=Badge_Grade"><img alt="Codacy: grade" src="https://img.shields.io/codacy/grade/4b1365e6f7d2474283243f62b2c5973d?label=Codacy&logo=codacy&style=for-the-badge"></a>
  <a href="https://pypi.org/project/pacup/"><img alt="PyPI: version" src="https://img.shields.io/pypi/v/pacup?color=%233775a9&logo=pypi&logoColor=white&style=for-the-badge"></a>
<p/>
<p align="center">
  <!-- Social -->
  <a href="https://discord.gg/yzrjXJV6K8"><img alt="join discord" src="https://img.shields.io/discord/839818021207801878?color=5865F2&label=Discord&logo=discord&logoColor=FFFFFF&style=for-the-badge"></a>
  <a href="https://reddit.com/r/pacstall"><img src="https://img.shields.io/reddit/subreddit-subscribers/pacstall?label=Reddit&color=FF4301&style=for-the-badge&logo=reddit&logoColor=FFFFFF" loading="lazy"></a>
  <a href="https://social.linux.pizza/web/@pacstall"><img alt="Mastodon Follow" src="https://img.shields.io/mastodon/follow/107278715447740005?color=3088d4&domain=https%3A%2F%2Fsocial.linux.pizza&label=Mastodon&logo=mastodon&logoColor=white&style=for-the-badge" loading="lazy"></a>
  <a href="https://matrix.to/#/#pacstall:matrix.org"><img alt="join matrix" src="https://img.shields.io/matrix/pacstall:matrix.org?color=888888&label=Matrix&logo=Matrix&style=for-the-badge"></a>
<p/>

## What is this?

Pacup (**Pac**script **Up**dater) is a maintainer helper tool to help
maintainers update their pacscripts. It semi-automates the tedious task of
updating pacscripts, and aims to make it a fun process for the maintainer!

## Installation

To install the latest release run:

```console
$ pacstall -I pacup-bin # or pip install pacup
```

To install the latest development build run:

```console
$ pip install git+https://github.com/pacstall/pacup
```

## Usage

```console
Usage: pacup [OPTIONS] PACSCRIPTS...

Updates specified pacscripts.
If ship flag is passed, the pacscript will be prepared for shipping to upstream.
After the pacscript is prepared, it will be committed and pushed to the origin remote.
This requires you to be present in your cloned fork.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────╮
│ *    pacscripts      PACSCRIPTS...  The pacscripts to update. [default: None] [required]             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────╮
│ --show-repology       -r                                       Show the parsed repology data and     │
│                                                                exit.                                 │
│ --debug               -d                                       Turn on debugging mode.               │
│ --version             -v                                       Show the version and exit.            │
│ --ship                -s                                       Prepare the pacscript for shipping to │
│                                                                upstream.                             │
│ --install-completion          [bash|zsh|fish|powershell|pwsh]  Install completion for the specified  │
│                                                                shell.                                │
│                                                                [default: None]                       │
│ --show-completion             [bash|zsh|fish|powershell|pwsh]  Show completion for the specified     │
│                                                                shell, to copy it or customize the    │
│                                                                installation.                         │
│                                                                [default: None]                       │
│ --help                                                         Show this message and exit.           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

You can get this help text by running `pacup --help`.

You should visit our [wiki](https://github.com/pacstall/pacup/wiki/Wiki), for
more information on how to use the `repology` key.

## How does it work?

Suppose `foo.pacscript` is outdated.

On running `pacup foo.pacscript` Pacup will parse the pacscript's variables,
then it compiles a list of filters specified in the `repology` variable in the
pacscript. Then it queries the [Repology API](https://repology.org/api) to get
all the repositories which have packaged that package. After which it applies
the filter to the response, and from the filtrate it considers the most common
version to be the latest.

Then it replaces all occurrences of the previous `version`'s value in the `url`
with the latest one placeholder's value with the latest version, and downloads
the new package, and generates it's hash.

Then writes the edited pacscript and installs it with
[Pacstall](https://github.com/pacstall/pacstall), after installation it asks
the user to confirm that the installed package works. On approval the pacscript
is considered successfully upgraded and the program ends.

## Caveats

* Does not work with `-git` pacscripts as those pacscripts are auto updating.
* Doesn't work if a pacscript doesn't have an equivalent
  [Repology](https://repology.org/) package.

## Stats

<p align="center"><img alt="Repobeats analytics image" src="https://repobeats.axiom.co/api/embed/80bc45a6d65fbfb43905aa22b3950badc09edd97.svg" /></p>

## License

```monospace
    ____             __  __
   / __ \____ ______/ / / /___
  / /_/ / __ `/ ___/ / / / __ \
 / ____/ /_/ / /__/ /_/ / /_/ /
/_/    \__,_/\___/\____/ .___/
                      /_/

Copyright (C) 2022-present

This file is part of PacUp

PacUp is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

PacUp is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with PacUp.  If not, see <https://www.gnu.org/licenses/>.
```

