Accepting request 129094 from openSUSE:Tools
- Prevent local users from appearing as user/group owner in generated tar files (thanks bmwiedemann for this) (forwarded request 129093 from aspiers) OBS-URL: https://build.opensuse.org/request/show/129094 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/obs-service-tar_scm?expand=0&rev=10
This commit is contained in:
commit
f31c1b2695
@ -1,3 +1,30 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Jul 27 11:16:47 UTC 2012 - aspiers@suse.com
|
||||
|
||||
- Prevent local users from appearing as user/group owner in
|
||||
generated tar files (thanks bmwiedemann for this)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 3 11:23:12 UTC 2012 - adrian@suse.de
|
||||
|
||||
- fix option for submodule update
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Jun 30 13:56:51 UTC 2012 - magist3r@gmail.com
|
||||
|
||||
- Fixed error with cache
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Jun 30 10:59:34 UTC 2012 - magist3r@gmail.com
|
||||
|
||||
- Added an option to disable git submodules
|
||||
- Replaced --exclude=.$MYSCM with --exclude-vcs tar option
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jun 28 22:53:29 UTC 2012 - magist3r@gmail.com
|
||||
|
||||
- Added support for git submodules
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jun 5 11:12:07 UTC 2012 - saschpe@suse.de
|
||||
|
||||
|
18
tar_scm
18
tar_scm
@ -21,6 +21,7 @@ set_default_params () {
|
||||
MYFILENAME=""
|
||||
MYREVISION=""
|
||||
MYPACKAGEMETA=""
|
||||
USE_SUBMODULES=enable
|
||||
# MYHISTORYDEPTH=""
|
||||
INCLUDES=""
|
||||
}
|
||||
@ -91,9 +92,13 @@ parse_params () {
|
||||
echo "history-depth parameter is obsolete and will be ignored"
|
||||
shift
|
||||
;;
|
||||
*-submodules)
|
||||
USE_SUBMODULES="$2"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Unknown parameter: $1"
|
||||
echo 'Usage: $SERVICE --scm $SCM --url $URL [--subdir $SUBDIR] [--revision $REVISION] [--version $VERSION] [--include $INCLUDE]* [--exclude $EXCLUDE]* [--versionformat $FORMAT] [--versionprefix $PREFIX] [--filename $FILENAME] [--package-meta $META] --outdir $OUT'
|
||||
echo 'Usage: $SERVICE --scm $SCM --url $URL [--subdir $SUBDIR] [--revision $REVISION] [--version $VERSION] [--include $INCLUDE]* [--exclude $EXCLUDE]* [--versionformat $FORMAT] [--versionprefix $PREFIX] [--filename $FILENAME] [--package-meta $META] [--disable-git-submodule] --outdir $OUT'
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@ -132,7 +137,7 @@ sanitise_params () {
|
||||
FILE="$MYFILENAME"
|
||||
WD_VERSION="$MYVERSION"
|
||||
if [ -z "$MYPACKAGEMETA" ]; then
|
||||
EXCLUDES="$EXCLUDES --exclude=.$MYSCM"
|
||||
EXCLUDES="$EXCLUDES --exclude-vcs"
|
||||
fi
|
||||
# if [ "$MYHISTORYDEPTH" == "full" ]; then
|
||||
# MYHISTORYDEPTH="999999999"
|
||||
@ -241,6 +246,11 @@ initial_clone () {
|
||||
git)
|
||||
# Clone with full depth; so that the revision can be found if specified
|
||||
safe_run git clone "$MYURL" "$CLONE_TO"
|
||||
if [ "$USE_SUBMODULES" == "enable" ]; then
|
||||
safe_run cd "$CLONE_TO"
|
||||
safe_run git submodule update --init --recursive
|
||||
safe_run cd ..
|
||||
fi
|
||||
;;
|
||||
svn)
|
||||
args=
|
||||
@ -447,8 +457,8 @@ prep_tree_for_tar () {
|
||||
create_tar () {
|
||||
TARFILE="${TAR_BASENAME}.tar"
|
||||
TARPATH="$MYOUTDIR/$TARFILE"
|
||||
debug tar cf "$TARPATH" $EXCLUDES $MYINCLUDES
|
||||
safe_run tar cf "$TARPATH" $EXCLUDES $MYINCLUDES
|
||||
debug tar --owner=root --group=root -cf "$TARPATH" $EXCLUDES $MYINCLUDES
|
||||
safe_run tar --owner=root --group=root -cf "$TARPATH" $EXCLUDES $MYINCLUDES
|
||||
echo "Created $TARFILE"
|
||||
}
|
||||
|
||||
|
@ -44,5 +44,10 @@
|
||||
<parameter name="history-depth">
|
||||
<description>Stored history depth. Special value "full" clones/pulls full history. Only valid if SCM git is used.</description>
|
||||
</parameter>
|
||||
<parameter name="submodules">
|
||||
<description>Do not include git submodules.</description>
|
||||
<allowedvalue>enable</allowedvalue>
|
||||
<allowedvalue>disable</allowedvalue>
|
||||
</parameter>
|
||||
</service>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user