Compare commits

..

No commits in common. "main" and "1.0" have entirely different histories.
main ... 1.0

4 changed files with 5 additions and 58 deletions

4
.gitignore vendored
View File

@ -1,4 +1,2 @@
.vscode .vscode
shperm shperm
build/credentials
build/deb/*.deb

View File

@ -1,2 +0,0 @@
GITEA_USER=user
GITEA_PASS=pass or token

View File

@ -1,42 +0,0 @@
#!/bin/bash
set -e
NAME=shperm
VERSION=1.0
REVISION=1
ARCH=amd64
if ! git tag -l |fgrep $VERSION; then
git tag $VERSION
git push origin $VERSION
fi
curdir=`dirname $0`
workdir="$curdir/${NAME}_${VERSION}-${REVISION}_${ARCH}"
mkdir -p "$workdir"
mkdir -p "$workdir/usr/bin"
gcc -o "$workdir/usr/bin/shperm" ../../shperm.c
chmod 0777 "$workdir/usr/bin/shperm"
mkdir "$workdir/DEBIAN"
cat << EOT > "$workdir/DEBIAN/control"
Package: $NAME
Version: $VERSION
Architecture: $ARCH
Maintainer: Daniel Buschke <damage@devloop.de>
Description: Shows permissions from given path
up to the root folder
Homepage: https://source.devloop.de/damage/shperm
EOT
dpkg-deb --build --root-owner-group "$workdir"
if [[ $? -eq 0 ]]; then
source "$curdir/../credentials"
curl --user "$GITEA_USER:$GITEA_PASS" \
--upload-file "${NAME}_${VERSION}-${REVISION}_${ARCH}.deb" \
https://source.devloop.de/api/packages/damage/debian/pool/stable/main/upload
rm -rf "$workdir"
fi

View File

@ -121,22 +121,15 @@ void dumpLines() {
} }
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
if (argc > 2) { if (argc != 2) {
fprintf(stderr, "Usage: %s [file or directory]\n", argv[0]); fprintf(stderr, "Usage: %s <file or directory>\n", argv[0]);
exit(1); exit(1);
} }
char* path; char* path;
char* startpath;
path = malloc(PATH_MAX); path = malloc(PATH_MAX);
if (argc == 1) {
startpath = ".";
} else {
startpath = argv[1];
}
if (realpath(startpath, path)) { if (realpath(argv[1], path)) {
char* base; char* base;
do { do {
struct stat sb; struct stat sb;
@ -158,4 +151,4 @@ int main(int argc, char* argv[]) {
} }
free(path); free(path);
} }