CapCreeperGR a9283037d8 - 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
2024-03-30 22:22:31 +02:00

45 lines
838 B
Bash
Executable File

#!/bin/bash
if [ $# -eq 0 ]
then
echo "No output package name given!"
exit 1
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
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
echo "pkg.info file found"
else
echo "pkg.info file not found in $PWD"
exit 1
fi
echo "Creating $type package as $output.bpm"
if [[ "$type" == "binary" ]]; then
tar -czf "$output".bpm files/ pkg.info
else
tar -czf "$output".bpm source.sh pkg.info
fi