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
|
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=""
|
MYFILENAME=""
|
||||||
MYREVISION=""
|
MYREVISION=""
|
||||||
MYPACKAGEMETA=""
|
MYPACKAGEMETA=""
|
||||||
|
USE_SUBMODULES=enable
|
||||||
# MYHISTORYDEPTH=""
|
# MYHISTORYDEPTH=""
|
||||||
INCLUDES=""
|
INCLUDES=""
|
||||||
}
|
}
|
||||||
@ -91,9 +92,13 @@ parse_params () {
|
|||||||
echo "history-depth parameter is obsolete and will be ignored"
|
echo "history-depth parameter is obsolete and will be ignored"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
*-submodules)
|
||||||
|
USE_SUBMODULES="$2"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown parameter: $1"
|
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
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -132,7 +137,7 @@ sanitise_params () {
|
|||||||
FILE="$MYFILENAME"
|
FILE="$MYFILENAME"
|
||||||
WD_VERSION="$MYVERSION"
|
WD_VERSION="$MYVERSION"
|
||||||
if [ -z "$MYPACKAGEMETA" ]; then
|
if [ -z "$MYPACKAGEMETA" ]; then
|
||||||
EXCLUDES="$EXCLUDES --exclude=.$MYSCM"
|
EXCLUDES="$EXCLUDES --exclude-vcs"
|
||||||
fi
|
fi
|
||||||
# if [ "$MYHISTORYDEPTH" == "full" ]; then
|
# if [ "$MYHISTORYDEPTH" == "full" ]; then
|
||||||
# MYHISTORYDEPTH="999999999"
|
# MYHISTORYDEPTH="999999999"
|
||||||
@ -241,6 +246,11 @@ initial_clone () {
|
|||||||
git)
|
git)
|
||||||
# Clone with full depth; so that the revision can be found if specified
|
# Clone with full depth; so that the revision can be found if specified
|
||||||
safe_run git clone "$MYURL" "$CLONE_TO"
|
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)
|
svn)
|
||||||
args=
|
args=
|
||||||
@ -447,8 +457,8 @@ prep_tree_for_tar () {
|
|||||||
create_tar () {
|
create_tar () {
|
||||||
TARFILE="${TAR_BASENAME}.tar"
|
TARFILE="${TAR_BASENAME}.tar"
|
||||||
TARPATH="$MYOUTDIR/$TARFILE"
|
TARPATH="$MYOUTDIR/$TARFILE"
|
||||||
debug tar cf "$TARPATH" $EXCLUDES $MYINCLUDES
|
debug tar --owner=root --group=root -cf "$TARPATH" $EXCLUDES $MYINCLUDES
|
||||||
safe_run tar cf "$TARPATH" $EXCLUDES $MYINCLUDES
|
safe_run tar --owner=root --group=root -cf "$TARPATH" $EXCLUDES $MYINCLUDES
|
||||||
echo "Created $TARFILE"
|
echo "Created $TARFILE"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,5 +44,10 @@
|
|||||||
<parameter name="history-depth">
|
<parameter name="history-depth">
|
||||||
<description>Stored history depth. Special value "full" clones/pulls full history. Only valid if SCM git is used.</description>
|
<description>Stored history depth. Special value "full" clones/pulls full history. Only valid if SCM git is used.</description>
|
||||||
</parameter>
|
</parameter>
|
||||||
|
<parameter name="submodules">
|
||||||
|
<description>Do not include git submodules.</description>
|
||||||
|
<allowedvalue>enable</allowedvalue>
|
||||||
|
<allowedvalue>disable</allowedvalue>
|
||||||
|
</parameter>
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user