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.__ __Warning! This software is still under development and is not intended for stable use.__
### Todo ### Todo
- [ ] finish add feature - [x] finish add feature
- [ ] create del feature - [x] create del feature
- [ ] multiple repositories feature - [ ] multiple repositories feature
- [ ] signing repositories using GPG - [ ] 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. `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 ## Dependencies
Lorem, Ipsum, Dolor - `sh`, `dpkg`, `gpg`, `python3`
## Installation ## Installation
### from deb package ### from deb package
@ -27,7 +27,7 @@ Lorem, Ipsum, Dolor
## How to use ## How to use
``` ```
USAGE: USAGE:
debrepo [OPTIONS] [DEB] debrepo [OPTIONS] [DEB]
OPTIONS: OPTIONS:
init, -i, --init init, -i, --init
@ -36,6 +36,8 @@ OPTIONS:
add deb package to repository add deb package to repository
del, -d, --del del, -d, --del
delete deb package from repository delete deb package from repository
serve, -s, --serve
serve repository using python built in http module
help, -h, --help help, -h, --help
print help message print help message
-v, --version -v, --version

22
debrepo
View File

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

View File

@ -1,12 +1,9 @@
#!/bin/sh #!/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 # generate Packages file
dpkg-scanpackages --multiversion --arch amd64 "./apt-repo/pool/" > "./apt-repo/dists/stable/main/binary-amd64/Packages" dpkg-scanpackages --multiversion --arch amd64 "./apt-repo/pool/" > "./apt-repo/dists/stable/main/binary-amd64/Packages"
# generate Release file # generate Release file
./generate-release.sh > "./apt-repo/dists/stable/Release" cd "./apt-repo/dists/stable/"
$DIR/generate-release.sh > "Release"