Skip to content

Commit

Permalink
META: Update master to v1.2.1
Browse files Browse the repository at this point in the history
META: Update master to v1.2.1
  • Loading branch information
knuxify authored Sep 14, 2019
2 parents 76287ee + cf53854 commit c45f198
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 10 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 1.2.1

### NEW:

- Added optional dependencies (ae32a65663a6902dca4adc462fcb283dbdf9eaab)

### FIX:

- Fixed error at startup when there is no custom install directory provided (915fe69)

## 1.2.0

### BREAKING (soon):
Expand Down
2 changes: 1 addition & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## shoppe

- Implement optional dependencies [1.2.1]
- Add better handling for broken directory permissions [1.3.0]
- Move the configuration directory to a reasonable place [1.3.0]
- Add FTP repositories [1.3.0]

Expand Down
14 changes: 13 additions & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
# Frequently asked question
# Frequently asked questions

## Using shoppe

### So, is shoppe just a frontend for other package managers?

No, it is also its own package manager.

### Alright, but what's the deal with the frontend and the rest of the package manager?

The frontend is used to fetch packages that aren't on the shoppe repositories. It does, however, take priority over the rest of the package manager, so when you want to download something from the shoppe repos when it's already available from the frontend you'll have to use the -c switch.

This approach allows shoppe to work on multiple distributions without the need for porting over basic packages.

## Miscelaneous

Expand Down
11 changes: 10 additions & 1 deletion docs/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ See the example shoppe package below for more information.

Simply add it to a repository (see: [Repositories](repositories.md)), add the repository and install with the -p switch, or use ``shoppe install /path/to/shoppepkg -p``.

## Adding optional dependencies

Add the optional dependencies to the optdepends variable, separated by spaces. To attach a description:

1. Create a file named optdepends in the same directory as the shoppepkg (if not done already);
2. Add "pkgname - description you want to give to the dependency" to the optdepends file.

If no description is specified, only the dependency name is printed.

## Example shoppe package (and all of the variables)

```bash
Expand All @@ -34,7 +43,7 @@ pkgrel="1" # Package revision. This is automatically bumped every time you rebui
license="GPL 3-Clause" # License. This is optional.
url="https://github.com/knuxify/shoppe" # Project website. Optional. If this is an open-source project, link the source page.
depends="bash git curl wget" # Dependencies, separated by spaces.
# optdepends="" # Optional dependencies, separated by spaces.
# optdepends="" # Optional dependencies, separated by spaces. See docs/packages.md for information on how to attach descriptions to the dependencies.
makedepends="make" # Build dependencies, separated by spaces.
provides="shoppe-git" # If this package provides the same functionality as another package, add it here. Packages are separated by spaces. Automatically adds the package to conflicts.
#conflicts="" # Packages this package conflicts with, separated by spaces. Most of the time this will contain the rolling version of a package.
Expand Down
51 changes: 44 additions & 7 deletions shoppe
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# shellcheck disable=SC1090,SC2001,SC1091,SC2219
##
## shoppe - a portable package manager that integrates with your current package manager
version="1.2.0"
version="1.2.1"
##
## Licensed under the MIT License

Expand Down Expand Up @@ -49,7 +49,7 @@ skiperrors="false"
[[ ! -e "$repolist" ]] && echo "http: https://raw.githubusercontent.com/shoppepm/shoppe-repos/master" > "$repolist"
[[ ! -e "$pkglist.frontend" ]] && touch "$pkglist.frontend"
[[ ! -e "$pkglist" ]] && echo "shoppe 0 $version" > "$pkglist"
[[ ! -e "$custominstalldir" ]] && mkdir -p "$custominstalldir"
[[ ! -z "$custominstalldir" ]] && [[ ! -e "$custominstalldir" ]] && mkdir -p "$custominstalldir"
! grep '^shoppe ' "$pkglist" &>/dev/null && echo "shoppe 0 $version" >> "$pkglist"

## Help (--help)
Expand Down Expand Up @@ -263,11 +263,12 @@ pkg_fetch() {
"http-full: "*) httpfetch -q "${repotofetch/http\-full\:\ /}/$package/shoppepkg" -O "$tmpdir/$package/shoppepkg" && success="1" && [[ "$forcebuild" == "true" ]] && [[ "$packagemake" != "true" ]] && echo "nobuild='false'" >> "$tmpdir/$package/shoppepkg";;
*) echo -e "$p_debug Repo data file for id $repo does not contain repository path! Have you been tampering with the file? Run shoppe update to fix this.";;
esac
if [[ ! -e "$tmpdir/$package/optional" ]]; then
if [[ ! -e "$tmpdir/$package/optdepends" ]]; then
osuccess="0"
case $repotofetch in
"local: "*|"http: "*) [[ -e "${repotofetch/local\:\ /}/$package/optional" ]] && cp "${repotofetch/local\:\ /}/$package/optional" "$tmpdir/$package/" && osuccess='1';;
"http-full: "*) if httpfetch -q "${repotofetch/http\:\ /}/$package/content-$arch.tar.gz" -O "$tmpdir/$package/content-$arch.tar.gz"; then osuccess='1'; else echo -e "$p_warn Prebuilt files not found, defaulting to build mode..." && echo "nobuild='false'" >> "$tmpdir/$package/shoppepkg"; fi;;
"http: "*) [[ -e "$configdir/repofiles/$repo/$package/optdepends" ]] && cp "$configdir/repofiles/$repo/$package/optdepends" "$tmpdir/$package/" && osuccess='1';;
"local: "*) [[ -e "${repotofetch/local\:\ /}/$package/optdepends" ]] && cp "${repotofetch/local\:\ /}/$package/optdepends" "$tmpdir/$package/" && osuccess='1';;
"http-full: "*) httpfetch -q "${repotofetch/http\-full\:\ /}/$package/content-$arch.tar.gz" -O "$tmpdir/$package/content-$arch.tar.gz" && osuccess='1';;
*) echo -e "$p_debug Repo data file for id $repo does not contain repository path! Have you been tampering with the file? Run shoppe update to fix this.";;
esac
fi
Expand Down Expand Up @@ -301,7 +302,7 @@ pkg_cleanup() {
# This function cleans up after a shoppe package.
# Use this when you're running a loop that sources multiple shoppepkgs.
# Usage: pkg_cleanup
unset pkgname pkgdesc pkgarch pkgver revision license url depends optional makedepends provides conflicts archdependent source sourcetype tag
unset pkgname pkgdesc pkgarch pkgver revision license url depends optdepends makedepends provides conflicts archdependent source sourcetype tag
unset -f shoppepkg_preinstall shoppepkg_build shoppepkg_postinstall
[[ "$currentskipfrontend" == "true" ]] && [[ -z "$pm" ]] && pm="$oldpm"
unset nobuild current_uptodate currentskipfrontend
Expand Down Expand Up @@ -593,6 +594,24 @@ shoppe_install() {
echo -e "$p_info Installing $package..."
let currentpkg++
! pkg_install && fail "Failed to install $package."
if [[ "$optdepends" ]] && [[ -e "$tmpdir/$package/optdepends" ]]; then
echo -e "$p_info Optional dependencies:"
for dep in $optdepends; do
if grep "^$dep " "$tmpdir/$package/optdepends" &>/dev/null; then
if grep "^$dep$" "$pkglist" &>/dev/null || grep "^$dep$" "$pkglist.frontend" &>/dev/null; then
echo "$(grep ^$dep $tmpdir/$package/optdepends) [Installed]"
else
grep "^$dep" "$tmpdir/$package/optdepends"
fi
else
if grep "^$dep$" "$pkglist" &>/dev/null || grep "^$dep$" "$pkglist.frontend" &>/dev/null; then
echo "$dep [Installed]"
else
echo "$dep"
fi
fi
done
fi
if [[ "$packagemake" == "true" ]]; then
cd "$tmpdir/$package/content"
tar -czf content-$arch.tar.gz .
Expand All @@ -604,6 +623,7 @@ shoppe_install() {
mkdir "$tmpdir/$package/topackage"
mv content-$arch.tar.gz "$tmpdir/$package/topackage"
mv "$tmpdir/$package/shoppepkg" "$tmpdir/$package/topackage"
[[ -e "$tmpdir/$package/optdepends" ]] && mv "$tmpdir/$package/optdepends" "$tmpdir/$package/$topackage"
tar -czf "$HOME/$package.tar.gz" -C "$tmpdir/$package/topackage" .
echo -e "$p_debug Package created. Path: $HOME/$package.tar.gz"
fi
Expand Down Expand Up @@ -741,7 +761,24 @@ shoppe_info() {
echo -e "License: $license"
[[ "$depends" ]] && echo -e "Dependencies: $depends"
[[ "$makedepends" ]] && echo -e "Make dependencies: $makedepends"
[[ "$optdepends" ]] && echo -e "Optional dependencies: $optdepends"
if [[ "$optdepends" ]] && [[ -e "$tmpdir/$package/optdepends" ]]; then
echo -e "$p_info Optional dependencies:"
for dep in $optdepends; do
if grep "^$dep " "$tmpdir/$package/optdepends" &>/dev/null; then
if grep "^$dep$" "$pkglist" &>/dev/null || grep "^$dep$" "$pkglist.frontend" &>/dev/null; then
echo "$(grep ^$dep $tmpdir/$package/optdepends) [Installed]"
else
grep "^$dep" "$tmpdir/$package/optdepends"
fi
else
if grep "^$dep$" "$pkglist" &>/dev/null || grep "^$dep$" "$pkglist.frontend" &>/dev/null; then
echo "$dep [Installed]"
else
echo "$dep"
fi
fi
done
fi
[[ "$provides" ]] && echo -e "Provides packages: $provides"
done
return 0
Expand Down

0 comments on commit c45f198

Please sign in to comment.