feat: --all to build all folders under directory

main
earnest ma 2021-10-16 18:30:39 -04:00
parent 02bac12c49
commit aa417bebab
Signed by: earnest ma
GPG Key ID: A343F43342EB6E2A
2 changed files with 19 additions and 0 deletions

15
aptpkg
View File

@ -15,6 +15,7 @@ For more documentation, run man aptpkg
Usage:
aptpkg [directory]
aptpkg --all [directory] Build all folders under directory
aptpkg --auto (commit id) Autobuild modified packages from commit
aptpkg -h, --help Show help
EOF
@ -148,10 +149,24 @@ change_autobuild_pkgs(){
done
}
# Build all in directory
build_all_in_dir(){
[ -d "$1" ] || error_usage_die "Provide a directory"
buildfile_folders=$(ls -d "$1"/*)
for ww in $buildfile_folders; do
printf "\nBuilding %s\n\n" "$ww"
aptpkg "$ww"
done
}
# Run!
case $1 in
-h|--help)
show_help ;;
--all)
shift
build_all_in_dir "$1" ;;
--auto)
shift
change_autobuild_pkgs "$1" ;;

View File

@ -8,6 +8,7 @@ aptpkg - easily create/ get debian packages
*aptpkg* _path_
*aptpkg* --all _path_
*aptpkg* --auto [git commit hash]
*aptpkg* --help
@ -22,6 +23,9 @@ The --auto option can also be used to build modified packages based on a git
commit hash, using _HEAD_ if one is not provided. The aptpkg script *must* be
available in $PATH.
For mass rebuilds, aptpkg --auto can be used, passing a directory with folders
under which the build files are located.
# SEE ALSO
*aptpkg*(5)