- Added a -b flag to the install subcommand that turns a source package into a binary one after compilation

- Reformatted the help subcommand
- Updated bpm-utils to add the ability to create source packages
- Source temporary directories will now be removed after installation unless the user passes the -k flag
- BPM will now not remove the old version of a package before installing an update which could cause libraries or programs required for installation to be missing. Obsolete files will now be removed after installation
- The version, list, info and help subcommands can now be run by any user without root permissions. Root permissions are still required for package installation and removal
- Removed installed package info fixing for now. It will be replaced by a better system in the future
This commit is contained in:
2024-03-30 22:22:31 +02:00
parent 43c4a626f1
commit a9283037d8
9 changed files with 184 additions and 31 deletions
@@ -7,13 +7,25 @@ fi
output=$1
if [[ ! "$output" =~ ^[a-zA-Z0-9_-]{1,}$ ]]; then
echo "Invalid output name! The name must only contain letters, numbers, hyphens or underscores!"
exit 1
fi
type="binary"
echo "Creating package with the name $output..."
if [ -d files ]; then
echo "files/ directory found"
else
echo "files/ directory not found in $PWD"
exit 1
if [ -f source.sh ]; then
type="source"
echo "source.sh file found"
else
echo "files/ directory or source.sh file not found in $PWD"
exit 1
fi
fi
if [ -f pkg.info ]; then
@@ -23,6 +35,10 @@ else
exit 1
fi
echo "Creating $output.bpm package..."
echo "Creating $type package as $output.bpm"
tar -czf $output.bpm files/ pkg.info
if [[ "$type" == "binary" ]]; then
tar -czf "$output".bpm files/ pkg.info
else
tar -czf "$output".bpm source.sh pkg.info
fi