Skip to content

Commit

Permalink
Merge branch 'main' into extrepo
Browse files Browse the repository at this point in the history
  • Loading branch information
natanjunges committed Oct 6, 2022
2 parents c748324 + d7952fa commit 83b91a5
Show file tree
Hide file tree
Showing 11 changed files with 1,402 additions and 109 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,26 @@ jobs:
# sudo apt-get install build-essential devscripts debhelper -y
# Dependencies for deb-get itself
sudo apt-get install apt apt-transport-https bash coreutils curl dpkg grep libc-bin lsb-release sed software-properties-common sudo wget -y
sudo apt-get install apt apt-transport-https bash coreutils curl dpkg gpg grep libc-bin lsb-release sed software-properties-common sudo wget -y
# All these commands should return a 0 status
- name: Test zero status
run: |
./deb-get update >/dev/null
./deb-get list >/dev/null
chmod a+x ./deb-get
./deb-get list --raw >/dev/null
./deb-get prettylist >/dev/null
./deb-get csvlist >/dev/null
./deb-get show deb-get >/dev/null
./deb-get help >/dev/null
./deb-get cache >/dev/null
./deb-get version >/dev/null
./deb-get clean >/dev/null
# update is skipped for now, as it depends on the 01-main subfolder being present
# upgrade is skipped because of full system upgrade and otherwise testing package installs
# covers most of that. Seperate job/workflow for occassional upgrade validation
# say when tagging for release might be good.

# Install a couple of packages to see if they still install
- name: Test package installations
Expand Down
43 changes: 28 additions & 15 deletions README.md

Large diffs are not rendered by default.

313 changes: 223 additions & 90 deletions deb-get
100644 → 100755

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion deb-get_completion
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

function _deb-get() {
if [ "${COMP_CWORD}" = 1 ]; then
COMPREPLY=($(compgen -W "update upgrade show install reinstall remove purge search cache clean list pretty_list prettylist csv_list csvlist csv help version" "${COMP_WORDS[1]}"))
COMPREPLY=($(compgen -W "update upgrade show install reinstall remove purge search cache clean list pretty_list prettylist csv_list csvlist csv fix-installed help version" "${COMP_WORDS[1]}"))
elif [ "${COMP_CWORD}" -ge 2 ]; then
local command="${COMP_WORDS[1]}"

Expand All @@ -18,6 +18,8 @@ function _deb-get() {
COMPREPLY=($(compgen -W "--raw --installed --not-installed" "\\${COMP_WORDS[2]}"))
elif [ "${COMP_CWORD}" = 2 ] && [[ " pretty_list prettylist csv_list csvlist csv " =~ " ${command} " ]]; then
COMPREPLY=($(compgen -W "$(find "/etc/deb-get" -maxdepth 1 \( -name *.repo ! -name 00-builtin.repo ! -name 99-local.repo -type f \) -o \( -name 99-local.d -type d \) -printf "%f\n" 2> /dev/null | sed "s/.repo$//; s/.d$//" | tr "\n" " ") 00-builtin 01-main" "${COMP_WORDS[2]}"))
elif [ "${COMP_CWORD}" = 2 ] && [ "${command}" = fix-installed ]; then
COMPREPLY=($(compgen -W "--old-apps" "\\${COMP_WORDS[2]}"))
fi
fi
}
Expand Down
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Depends: apt,
coreutils (>= 8.25~),
curl,
dpkg,
gpg,
grep,
libc-bin,
lsb-release,
Expand Down
1 change: 1 addition & 0 deletions debian/install
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
deb-get usr/bin
docs/deb-get.1 usr/local/share/man/man1
deb-get_completion etc/bash_completion.d
14 changes: 14 additions & 0 deletions debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,24 @@

set -e

function package_is_installed() {
deb-get list --installed | grep -q "^${1}$"
}

if [ "${1}" = configure ]; then
if [ ! -e /etc/deb-get] || [ ! -e /etc/deb-get/01-main.repo ] || [ ! -e /etc/deb-get/01-main.d ] || [ -n "$(find /etc/deb-get/01-main.d -prune -empty 2> /dev/null)" ]; then
deb-get update --repos-only
fi
if [ -n "${2}" ]; then
if dpkg --compare-versions "${2}" le "0.3.6-1"; then
deb-get fix-installed --old-apps
if package_is_installed appimagelauncher; then
deb-get reinstall appimagelauncher
fi
else
deb-get fix-installed
fi
fi
fi

exit 0
33 changes: 33 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
include pandoc-man.mk

ifeq ($(PREFIX),)
PREFIX := /usr/local
endif

datarootdir := $(PREFIX)/share
datadir := $(datarootdir)
mandir := $(datarootdir)/man
bindir := $(PREFIX)/bin

all: deb-get.1

clean:
rm *.1

install_docs: all
install -d $(DESTDIR)$(mandir)/man1
install -m 644 deb-get.1 $(DESTDIR)$(mandir)/man1


install_bins:
install -d $(DESTDIR)$(bindir)
install -m 755 ../deb-get $(DESTDIR)$(bindir)

install: install_bins install_docs

uninstall::
rm -f $(DESTDIR)$(mandir)/man1/deb-get.1
rm -f $(DESTDIR)$(bindir)/deb-get


.PHONY: all
Loading

0 comments on commit 83b91a5

Please sign in to comment.