mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
janware-create-project.py: Add support for -g pkg-group and .gitignore
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
534ff384e1
commit
ff664c6804
1 changed files with 26 additions and 3 deletions
|
|
@ -18,7 +18,7 @@ fatal()
|
|||
|
||||
usage()
|
||||
{
|
||||
echo "$myname [-h] [-s summary] [-d description] name"
|
||||
echo "$myname [-h] [-s summary] [-d description] [-g pkg-group] name"
|
||||
[ "$1" ] && exit $1
|
||||
}
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ cat_make_project_conf()
|
|||
$description
|
||||
|
||||
[global]
|
||||
group = System/Libraries
|
||||
group = "$pkg_group"
|
||||
subpackages = $subpackages
|
||||
|
||||
[pkg.required.jw]
|
||||
|
|
@ -86,6 +86,24 @@ cat_make_project_conf()
|
|||
EOT
|
||||
}
|
||||
|
||||
cat_gitignore()
|
||||
{
|
||||
cat <<-EOT
|
||||
*.done
|
||||
*.dep.mk
|
||||
*.o
|
||||
*.so.*
|
||||
*.so
|
||||
*.a
|
||||
*.rep
|
||||
ld-*.conf
|
||||
*.ldscript
|
||||
*.pc
|
||||
$name
|
||||
*_generated_*
|
||||
EOT
|
||||
}
|
||||
|
||||
# ---------------------- here we go
|
||||
|
||||
myname=`basename $0`
|
||||
|
|
@ -95,7 +113,7 @@ summary=
|
|||
description=
|
||||
subpackages="run devel"
|
||||
|
||||
eval set -- `getopt -- hd:s:p: "$@"`
|
||||
eval set -- `getopt -- hd:s:p:g: "$@"`
|
||||
|
||||
while [ "$1" != -- ]; do
|
||||
case $1 in
|
||||
|
|
@ -108,6 +126,9 @@ case $1 in
|
|||
-p)
|
||||
eval subpackages=\"$2\"
|
||||
shift;;
|
||||
-g)
|
||||
eval pkg_group=\"$2\"
|
||||
shift;;
|
||||
-h)
|
||||
usage 0;;
|
||||
*)
|
||||
|
|
@ -119,6 +140,7 @@ shift
|
|||
|
||||
[ -z "$description" ] && description="$summary"
|
||||
[ -z "$summary" ] && summary="$description"
|
||||
[ -z "$pkg_group" ] && pkg_group="Amusements/Teaching/Other"
|
||||
|
||||
[ -f $projdir/Makefile ] || {
|
||||
fatal "$projdir doesn't contain a Makefile"
|
||||
|
|
@ -142,4 +164,5 @@ cat_make_Makefile > make/Makefile
|
|||
cat_VERSION > VERSION
|
||||
cat_make_proj_mk > make/proj.mk
|
||||
cat_make_project_conf > make/project.conf
|
||||
cat_gitignore > .gitignore
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue