feat: del, add, serve, list; updated: readme.md

This commit is contained in:
Filip Rojek 2023-04-23 16:07:51 +02:00
parent 0f88c1ea40
commit 834651e6ef
3 changed files with 27 additions and 14 deletions

View File

@ -6,8 +6,8 @@ A Debian repository management tool.
__Warning! This software is still under development and is not intended for stable use.__
### Todo
- [ ] finish add feature
- [ ] create del feature
- [x] finish add feature
- [x] create del feature
- [ ] multiple repositories feature
- [ ] signing repositories using GPG
@ -15,7 +15,7 @@ __Warning! This software is still under development and is not intended for stab
`Debrepo` is a software tool designed for creating and managing Debian repositories for `*.deb` packages, providing a lightweight and user-friendly alternative to more complex tools like `reprepo` or `aptly`. While these alternatives may offer more advanced features, Debrepo focuses on providing essential functionality and ease of use for repository management, allowing users to easily add, remove, and update packages within their repositories. With Debrepo, users can efficiently manage their Debian repositories without the unnecessary complexity of more advanced tools.
## Dependencies
Lorem, Ipsum, Dolor
- `sh`, `dpkg`, `gpg`, `python3`
## Installation
### from deb package
@ -27,7 +27,7 @@ Lorem, Ipsum, Dolor
## How to use
```
USAGE:
debrepo [OPTIONS] [DEB]
debrepo [OPTIONS] [DEB]
OPTIONS:
init, -i, --init
@ -36,6 +36,8 @@ OPTIONS:
add deb package to repository
del, -d, --del
delete deb package from repository
serve, -s, --serve
serve repository using python built in http module
help, -h, --help
print help message
-v, --version

22
debrepo
View File

@ -8,14 +8,26 @@ if [ "$1" = "init" ] || [ "$1" = "-i" ] || [ "$1" = "--init" ]; then
fi
if [ "$1" = "add" ] || [ "$1" = "-a" ] || [ "$1" = "--add" ]; then
echo "add"
$DEBPATH=""
# copy deb file to repo folder structure
cp "./$2" "./apt-repo/pool/main/"
# generate package and release file
$DIR/scripts/addPackage.sh $2 && echo "debrepo: package $2 was successfully added"
exit
fi
if [ "$1" = "del" ] || [ "$1" = "-d" ] || [ "$1" = "--del" ]; then
echo "del"
$DEBNAME=""
rm -i "./apt-repo/pool/main/$2" && echo "debrepo: package $2 was successfully removed"
exit
fi
if [ "$1" = "list" ] || [ "$1" = "-l" ] || [ "$1" = "--list" ]; then
echo "debrepo: list of packages"
ls -l "./apt-repo/pool/main/"
exit
fi
if [ "$1" = "serve" ] || [ "$1" = "-s" ] ||[ "$1" = "--serve" ]; then
python3 -m http.server
exit
fi
@ -40,6 +52,8 @@ OPTIONS:
add deb package to repository
del, -d, --del
delete deb package from repository
serve, -s, --serve
serve repository using python built in http module
help, -h, --help
print help message
-v, --version

View File

@ -1,12 +1,9 @@
#!/bin/sh
DIR="$(cd "$(dirname "$0")" && pwd)"
BASEF="hello-world_$VERSION""_amd64"
echo $BASEF
# copy deb file to repo folder structure
cp "./$BASEF.deb" "./apt-repo/pool/main/"
# generate Packages file
dpkg-scanpackages --multiversion --arch amd64 "./apt-repo/pool/" > "./apt-repo/dists/stable/main/binary-amd64/Packages"
# generate Release file
./generate-release.sh > "./apt-repo/dists/stable/Release"
cd "./apt-repo/dists/stable/"
$DIR/generate-release.sh > "Release"