pax_global_header 0000666 0000000 0000000 00000000064 12744103012 0014504 g ustar 00root root 0000000 0000000 52 comment=2b95db564dbbc7a2b0e2d12dbea150836943351d pacapt-2.3.13/ 0000775 0000000 0000000 00000000000 12744103012 0013042 5 ustar 00root root 0000000 0000000 pacapt-2.3.13/.gitignore 0000664 0000000 0000000 00000000032 12744103012 0015025 0 ustar 00root root 0000000 0000000 *~ pacapt.dev tests/tmp/* pacapt-2.3.13/CHANGELOG.md 0000664 0000000 0000000 00000005657 12744103012 0014670 0 ustar 00root root 0000000 0000000 ## v2.3.13 * `lib/dpkg`: Fix `-Qs` for old `dpkg`. For developers: * Test scripts can now be automated thanks to `tests/*`; * `tests/slitz40`: Add; * `tests/dpkg`: Update. ## v2.3.12 * `lib/dpkg`: Fix #84 (incorrect implementation of `-Qs`.) For developers: * `bin/gen_tests.rb`: Add; * `lib/dpkg`: Add and update test cases; * `CONTRIBUTING`: Add new section `Writting test cases`. ## v2.3.11 * `lib/tazpkg`: Improve `-U`. ## v2.3.10 * `lib/tazpkg`: Support `-Scc`. ## v2.3.9 * `lib/tazpkg`: Support `SliTaz` distribution. For developers: * `contrib/*`: Add instructions to build packages on some distributions (Credit: `Pival81`). ## v2.3.8 * `lib/alpine`: Support `Alpine` distirubtion (Credit: `Carl X. Su`, `Cuong Manh Le`); * `lib/dnf`: Support new package manager on `Fedora` system (Credit: `Huy Ngô`); * `lib/termux`: Support `termux` on Android (Credit: `Jiawei Zhou`); * `lib/zypper`: New option `-Sw` (Forgot to merge #72); * `lib/yum`: New option `-Qs` (Credit: `Siôn Le Roux`); For developers: * Improve translation method `_translate_all`; ## v2.2.7 * `lib/zypper`: Complete query/removal options (Credit: `Janne Heß`); * `lib/cave`: Fix an issue with `-R` option; * New option `--noconfirm` to help non-interactive scripts (Cf. #43). Currently available for `pkgng`, `yum`, `dpkg` and `zypper`. For developers: * `lib/{00_core,zz_main}`: Refactor to support future option translation; * Refactor code supports `-w` (download only) and `-v` (debug) options; * Improve coding quality thanks to `shellcheck`; * Move `compile.sh` to `bin/compile.sh`; * Use `lib/00_core#_translate_all` to add future option translation; * `bin/check`: Add script to inspect coding style issues (Cf. #54). ## v2.1.6 * `lib/sun_tools`: `SunOS` support (Credit: `Daniel YC Lin`); * Fix a minor bug related to argument parsing (4287ff16e869a0960ea54233); * Improve documentation; * `lib/dnf`: Add some initial support; * Adding `GREP` and `AWK` environments to future non-`Linux` systems; * `compile.sh` will exit if it can't detect version information; * `README` has a table of supported operations generated by `compile.sh`; * In debug mode, `pacapt` will print body of function it would execute. ## v2.0.5 * `lib/zz_main`: Improve secondary option parsing; * `lib/pkg_tools`: Remove `Rns` support. ## v2.0.4 * `openbsd/pkg_tools`: Add (Credit: `Somasis`); * `homebrew/Su*`: Use `--all` flag when upgrading; * `homebrew/*`: Some typo fixes; * `compile.sh`: `git` becomes optional (useful for `docker` tester.); * `compile.sh`: Get list of authors from `README.md`; * `Makefile`: Various improvements; * `lib/00_core`: Add `_removing_is_dangerous` method; * `lib/00_core`: `_not_implemented` now returns `1`; * `lib/help.txt`: Remove list of authors from help message; * `CHANGELOG.md`: Add. ## v2.0.3 * `homebrew/Qs`: Add; * `homebrew/*`: Fix minor bugs. ## v2.0.2 * `lib/zz_main`: Fix quoting issue (Credit: `Cuong Manh Le`). ## v2.0.1 * `git log v2.0.1`. pacapt-2.3.13/CONTRIBUTING.md 0000664 0000000 0000000 00000004134 12744103012 0015275 0 ustar 00root root 0000000 0000000 ## Table of contents 1. [Coding style](#coding-style) 1. [Testing. Writting test cases](#testing-writting-test-cases) 1. [Generating pacapt script](#generating-pacapt-script) 1. [Branches](#branches) 1. [Closed branches](#closed-branches) ## Coding style 1. Don't use tab or smart tab; 1. Use `2-space` instead of a tab; 1. Contribute to library file under `./lib/` directory; 1. We try to follow the convention from: https://github.com/icy/bash-coding-style. ## Testing. Writting test cases See also `tests/README.md`. 1. Use `make shellcheck` if you have a network connection, and enough `Perl` packages (`JSON`, `URI::Escape`) on your system; 1. Use `PACAPT_DEBUG=foo` where `foo` is a package manager (`dpkg`, `pacman`, `zypper`, ...) to print what `pacapt` will do. Use `PACAPT_DEBUG=auto` for auto-detection; 1. You can use `docker` for testing, by mounting the `pacapt.dev` script to the container. See also `docker.i` section in `Makefile`. Example: ```` $ make pacapt.dev $ docker run --rm -ti \ -v $PWD/pacapt.dev:/usr/bin/pacman \ debian:stable /bin/bash # you are in container now ```` ## Generating `pacapt` script 1. The `pacapt` script is generated from the latest stable branch, it is there to make installation process simple; 1. Please **do not** use `make pacapt` to update `pacapt`, and/or modify it manually; 1. For your development, use `make pacapt.dev`; To generate the table of implemented options, use `PACAPT_STATS=1`. This table is manually replaced the one in `README` file. ## Branches 1. `ng`: The current development branch. Some pull requests are merged on to this branch, but the work may not be ready for production. 1. `v2.0`: The current stable branch. All future `v2.x` releases come from this branch. 1. `your feature branch`: For new feature or bug fix, please work on your own branch and create pull request. Do not put different ideas on a same branch because that makes future tracking harder. ## Closed branches 1. `master`: The old stable code of the `pacapt`. This branch is closed on May 4th, 2014. pacapt-2.3.13/COPYING 0000664 0000000 0000000 00000000366 12744103012 0014102 0 ustar 00root root 0000000 0000000 Copyright (C) 2010 - 2014 Anh K. Huynh Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument. DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY. pacapt-2.3.13/Makefile 0000664 0000000 0000000 00000004262 12744103012 0014506 0 ustar 00root root 0000000 0000000 BINDIR=/usr/local/bin/ DISTRO=debian:stable default: @echo "This is an experimental Makefile. Use it at your own risk." @echo "" @echo " pacapt.dev : Generate development script." @echo ' install.dev : Install development script into $$BINDIR.' @echo " pacapt : Generate stable script." @echo ' install : Install stable script into $$BINDIR.' @echo " clean : (Experimental) Remove git-ignored files." @echo " shellcheck : Syntax and style checking. Use http://shellcheck.net/." @echo " docker.i : Launch interactive Docker container which mounts." @echo ' your local 'pacapt.dev' script to $$BINDIR/pacman.' @echo "" @echo "Environments" @echo "" @echo " VERSION : Version information. Default: git commit hash." @echo " BINDIR : Destination directory. Default: /usr/local/bin." @echo " DISTRO : Container image. Default: debian:stable." # Build and install development script pacapt.dev: ./lib/*.sh ./lib/*.txt bin/compile.sh @./bin/compile.sh > $(@) @bash -n $(@) @chmod 755 $(@) @echo 1>&2 "The output file is '$(@)' (unstable version)" install.dev: pacapt.dev @if [ -e $(@) ] && ! file $(@) | grep -q 'script'; then \ echo >&2 "Makefile Will not overwrite non-script $(@)"; \ exit 1; \ else \ install -vm755 pacapt.dev $(BINDIR)/pacapt; \ fi # Build and install stable script pacapt: ./lib/*.sh ./lib/*.txt bin/compile.sh @./bin/compile.sh > $(@) @bash -n $(@) @chmod 755 $(@) @echo 1>&2 "The output file is '$(@)' (stable version)" install: $(BINDIR)/pacapt $(BINDIR)/pacman: @if [ ! -e $(@) ]; then \ ln -vs $(BINDIR)/pacapt $(@); \ fi $(BINDIR)/pacapt: pacapt @if [ -e $(@) ] && ! file $(@) | grep -q 'script'; then \ echo >&2 "Makefile Will not overwrite non-script $(@)"; \ exit 1; \ else \ install -vm755 pacapt $(BINDIR)/pacapt; \ fi docker.i: @docker run --rm -ti \ -v $(PWD)/pacapt.dev:$(BINDIR)/pacman \ $(DISTRO) /bin/bash clean: @if git clean -nX | grep -q .; then \ git clean -nX; \ echo -n "Remove these files? [y/N] "; \ read ANS; \ case "$$ANS" in \ [yY]*) git clean -fX ;; \ *) exit 1;; \ esac ; \ fi shellcheck: @./bin/check.sh _check_files bin/*.sh lib/*.sh pacapt-2.3.13/README.md 0000664 0000000 0000000 00000014375 12744103012 0014333 0 ustar 00root root 0000000 0000000 ## Table of contents * [Name](#name) * [Description](#description) * [Installation](#installation) * [Installation from Pival81 repository](#installation-from-pival81-repository) * [Usage](#usage) * [Implemented Operations](#implemented-operations) * [Support](#support) * [Development](#development) * [License](#license) * [Authors](#authors-contributors) ## Name `pacapt` - An `Arch`'s pacman-like package manager for some `Unices`. ## Description An `Arch`'s pacman-like package manager for some `Unices`. Actually this `Bash` script provides a wrapper for system's package manager. For example, on `CentOS` machines, you can install `htop` with command $ pacapt -S htop Instead of remembering various options/tools on different `OS`s, you only need a common way to manipulate packages. Not all options of the native package manager are ported; the tool only provides a very basic interface to search, install, remove packages, and/or update the system. `Arch`'s pacman is chosen, as pacman is quite smart when it divides all packages-related operations into three major groups: `Synchronize`, `Query` and `Remove/Clean up`. It has a clean man page, and it is the only tool needed to manipulate official packages on system. (`Debian`, for example, requires you to use `apt-get`, `dpkg`, and/or `aptitude`.) The tool supports the following package managers: * `pacman` by `Arch Linux`, `ArchBang`, `Manjaro`, etc. * `dpkg/apt-get` by `Debian`, `Ubuntu`, etc. * `homebrew` by `Mac OS X` * `macports` by `Mac OS X` * `yum/rpm` by `Redhat`, `CentOS`, `Fedora`, etc. * `portage` by `Gentoo` * `zypper` by `OpenSUSE` * `pkgng` by `FreeBSD` * `cave` by `Exherbo Linux` * `pkg_tools` by `OpenBSD` * `sun_tools` by `Solaris(SunOS)` * `apk` by `Alpine Linux` * `tazpkg` by `SliTaz Linux` ## Installation 1. This script shouldn't be installed on an Arch-based system; 2. On `FreeBSD` and `Alpine Linux`, please install `bash` package first; 3. Download the stable script and make it executable ```` $ sudo wget -O /usr/local/bin/pacapt \ https://github.com/icy/pacapt/raw/ng/pacapt $ sudo chmod 755 /usr/local/bin/pacapt $ sudo ln -sv /usr/local/bin/pacapt /usr/local/bin/pacman || true ```` On some system, `/usr/local/bin` is not in the search paths when the command is executed by `sudo`. You may want to use `/usr/bin/pacman` or `/usr/bin/pacapt` instead. This stable script is generated from the latest stable branch, which is `v2.0` at the moment. If you want to compile a script from its components, please make sure you use a correct branch. See `CONTRIBUTING.md` for details. ## Installation from Pival81 repository @Pival81 creates specification to build packages on various Linux distributions (CentOS, Debian, Fedora, OpenSUSE, RHEL, Ubuntu). The specification can be found under the `contrib/` directory. @Pival81 also builds packages which are ready to use on your machine. See the following link for details. http://software.opensuse.org/download.html?project=home:Pival81&package=pacapt ## Usage Some basic command line options * `-h` (`--help`): Print help message; * `-P`: Print list of suppoted operations; * `-V`: Print script version Some popular options of the original `ArchLinux`'s `pacman` program are supported and listed in the table in the next section. A short description can be found at https://github.com/icy/pacapt/blob/ng/lib/help.txt. ## Implemented operations _(Note: This table is generated automatically from the latest development work. Some features may be missing in the stable script. Please don't change this table manually when you create new pull request.)_ ``` Q Qc Qi Ql Qm Qo Qp Qs Qu R Rn Rns Rs S Sc Scc Sccc Si Sii Sl Ss Su Suy Sw Sy U apk y . y y . y . y y y y y y y y y y y y y y y y y y y cave y . y y . y y y y y y y y y y y y y . . y y y . y y dnf y y y y y y y y y y . . . y y y y y . y y y y y y y dpkg y . y y . y y y y y y y y y y y y y y . y y y . y y homebrew y y y y . y . y y y . . y y y y y y . . y y y . y . macports . y . y . y . . y y . . y y y y . y . . y y y . y . pkgng y . y y . y y . y y . . y y y y . y . . y y y . y . pkg_tools y . y y . y y . y y y y y y y y . y . y y y y . y . portage y y y y . y . . y y . . y y y y y y . . y y y . y . sun_tools y . y y . y . y . y . . . . . . . . . . . . . . . y tazpkg y . y y . y . . . y . . . y y y . . . . y y y . y y yum y y y y y y y y y y . . y y y y y y y . y y y . y y zypper y y y y y y y y y y y y y y y y y y y y y y y y y y ``` ## Support Please use the ticket system at https://github.com/icy/pacapt/issues . ## Development Make sure you read some instructions in `CONTRIBUTING.md`. A development script can be compiled from the source code. ```` $ git clone https://github.com/icy/pacapt.git $ cd pacapt # switch to development branch $ git checkout ng # compile the script $ ./bin/compile.sh > pacapt.dev # check if syntax is good $ bash -n pacapt.dev $ sudo install -m755 ./pacapt.dev /usr/local/bin/pacapt ```` Please read the sample `Makefile` for some details. ## License This work is released under the terms of Fair license (http://opensource.org/licenses/fair). ## AUTHORS. CONTRIBUTORS Many people have contributed to the project by sending pull requests and/or reporting on the ticket system. Here is an incomplete list of authors and contributors. * 10sr (10sr) * Alexander Dupuy (dupuy) * Anh K. Huynh (icy) * Alex Lyon (Arcterus) * Carl X. Su (bcbcarl) * Cuong Manh Le (Gnouc) * Daniel YC Lin (dlintw) * Danny George (dangets) * Darshit Shah (darnir) * Eric Crosson (EricCrosson) * GijsTimmers (GijsTimmers) * Hà-Dương Nguyễn (cmpitg) * Huy Ngô (NgoHuy) * James Pearson (xiongchiamiov) * Janne Heß (dasJ) * Jiawei Zhou (4679) * Karol Blazewicz * Kevin Brubeck (unhammer) * Konrad Borowski (xfix) * Kylie McClain (somasis) * Pival81 * Siôn Le Roux (sinisterstuf) * Vojtech Letal (letalvoj) pacapt-2.3.13/TODO 0000664 0000000 0000000 00000002157 12744103012 0013537 0 ustar 00root root 0000000 0000000 [x] Add tests [x] For Gentoo system: pacapt -Q => eix -I pacapt -Qc
=> emerge -p --changelog
pacapt -Qi
=> emerge --info
pacapt -Ql
=> exists("qlist") && qlist
|| equery files
pacapt -Qm => orphan packages, not supported
pacapt -Qo => emerge -a
pacapt -Ss => eix || emerge --search
pacapt -Su => emerge -auND world
pacapt -Sy => emerge --sync ; exists("layman") && layman --sync-all
pacapt -Suy => emerge --sync ; exists("layman") && layman --sync-all ; emerge -auND world
pacapt -R => emerge --depclean
pacapt -Sc = clean all distfiles except for installed packages (exact version), those which are less than one month old, bigger than 50MB, or fetch-restricted:
=> eclean-dist -d -t1m -s50 -f
pacapt -Scc => eclean -i distfiles
-f => remove "-a"
-v => -v
-w => --fetchonly
pacapt-2.3.13/bin/ 0000775 0000000 0000000 00000000000 12744103012 0013612 5 ustar 00root root 0000000 0000000 pacapt-2.3.13/bin/check.sh 0000775 0000000 0000000 00000004400 12744103012 0015224 0 ustar 00root root 0000000 0000000 #!/usr/bin/env bash
# Purpose: Check script for error
# Author : Anh K. Huynh
# Date : 2015 Aug 06
# License: MIT license
_simple_check() {
bash -n "$@"
}
_perl_check() {
perl -MURI::Escape -MJSON -e 'exit(0)'
}
_shellcheck() {
local _data
_data="$( \
perl -MURI::Escape \
-e '
my $stream = do { local $/;