diff --git a/git-getperl.sh b/git-getperl.sh index 43c33c8..9dcb49a 100755 --- a/git-getperl.sh +++ b/git-getperl.sh @@ -101,7 +101,7 @@ if [ $DEBUG ] ; then echo "WORKDIR=$WORKDIR" ; fi # create repo name from perl- module with :: replaced by - IFS=:: words=() -for i in MODULENAME; do words+=($i) ; done +for i in $MODULENAME; do words+=($i) ; done RepoName="perl" ShortName= for word in ${words[@]}; do @@ -191,7 +191,7 @@ fi # Then get it fully from CVS mkdir -p $perlFiles/$RepoName cd $perlFiles/$RepoName -cpanspec "MODULENAME" +cpanspec "$MODULENAME" # Check that the spec file is there # First bet is the packagename.spec @@ -239,19 +239,9 @@ fi # See if it exists on the Gitea host if [ $DEBUG ] ; then echo "check that $GITEAHOST/$ORGGITEA/$RepoName exists" ; fi -READMECONTENTS= RESPONSE=$(curl $checkSSL $SILENT4CURL -o /dev/null -w "%{http_code}" "$GITEAHOST/api/v1/repos/$ORGGITEA/$RepoName") if [ "$RESPONSE" == "200" ]; then if [ $DEBUG ] ; then echo "************Repository for $RepoName already exists!" ; fi - # If so, clone it (just want the README.md) - if [ $DEBUG ] ; then echo "git clone $GITEAHOST/$ORGGITEA/$RepoName.git" ; fi - cd $GITFiles - git clone "$GITEAHOST/$ORGGITEA/$RepoName.git" - if [[ -f $GITFILES/$RepoName/README.md ]] ; then - # Move it and remember its new (temp) name - READMECONTENTS=`mktemp` - mv -f README.md "$READMECONTENTS" - fi # Now delete the repo, re-create it and clone it in to local if [ $DEBUG ] ; then echo "Delete $ORGGITEA/$RepoName" ; fi RESPONSE=$(curl "$checkSSL" "$SILENT4CURL" -o /dev/null -w "%{http_code}" -X 'DELETE' \ @@ -274,7 +264,6 @@ else fi cd $GITFiles -#git init $QUIET MODULENAME # # Re-create the repo @@ -288,7 +277,7 @@ RESPONSE=$(curl "$checkSSL" "$SILENT4CURL" -X 'POST' \ -d '{ "auto_init": true, "default_branch": "master", - "description": "'"$PACKAGETYPE git repo for $RepoName $ORGGITEA"'", + "description": "'"perl git repo for $RepoName $ORGGITEA"'", "gitignores": "", "issue_labels": "Default", "license": "Apache-2.0", @@ -337,7 +326,7 @@ cd $GITFiles git clone "$GITEAHOST/$ORGGITEA/$RepoName.git" if [ ! -d $GITFiles/$RepoName ] ; then - echo "ERROR*******Unable to access the new repo directory for $HTTP_URL $GITFiles/$RepoName" + echo "ERROR*******Unable to access the new repo directory for $GITFiles/$RepoName" exit 1 fi @@ -350,7 +339,7 @@ cp $perlFiles/$RepoName/* . # create the Makefile cat > Makefile <<- _EOT # Makefile for source rpm: $RepoName -# $Id: Makefile,v 1.1 2016/02/04 12:24:52 vip-ire Exp $ +# \$Id: Makefile,v 1.1 2016/02/04 12:24:52 vip-ire Exp $ NAME := $RepoName SPECFILE = \$(firstword \$(wildcard *.spec)) @@ -375,7 +364,7 @@ _EOT # Add file indicating which release and contribs or base - this is matched by the makefile with the contents of the branch file in the common directory # to give the details of the release (EL7/8/9/ etc) # This assumes SME10 and contribs10 or sme10 directory names, later releases can update the value in the file and Makefile should still work. -echo "sme10" > contriborbase +echo "sme11" > contriborbase # and see if the spec file is not according to specification of .spec # if not rename it @@ -396,11 +385,11 @@ for fpath in $SOURCES; do if [ $DEBUG ] ; then echo "$fpathfile" ; fi translatefpath=$(rpm --queryformat "$fpathfile\n" --specfile $(basename $SPECFILE) | head -n 1) if [ $DEBUG ] ; then echo "$translatefpath" ; fi - if [[ -f $CVSFiles/$RepoName/$BASEORCONTRIB/$translatefpath ]] ; then - if [ $DEBUG ] ; then echo "************Copying $CVSFiles/$RepoName/$BASEORCONTRIB/$translatefpath" ; fi - cp $CVSFiles/$RepoName/$BASEORCONTRIB/$translatefpath . + if [[ -f $perlFiles/$RepoName/$BASEORCONTRIB/$translatefpath ]] ; then + if [ $DEBUG ] ; then echo "************Copying $perlFiles/$RepoName/$translatefpath" ; fi + cp $perlFiles/$RepoName/$translatefpath . else - if [ $DEBUG ] ; then echo "************Not found $CVSFiles/$RepoName/$BASEORCONTRIB/$translatefpath ( $fpathfile )- so not copied" ; fi + if [ $DEBUG ] ; then echo "************Not found $perlFiles/$RepoName/$translatefpath ( $fpathfile )- so not copied" ; fi fi done @@ -418,11 +407,11 @@ git lfs install git lfs track "*.$EXT" git add .gitattributes #git config lfs.http://gitea.bjsystems.co.uk/SMEContribs/bugzilla.git/info/lfs.locksverify true -if [[ -f $CVSFiles/$RepoName/$BASEORCONTRIB/$ARCHIVEFILE ]] ; then - if [ $DEBUG ] ; then echo "************Copying archivefile $CVSFiles/$RepoName/$BASEORCONTRIB/$ARCHIVEFILE" ; fi - cp $CVSFiles/$RepoName/$BASEORCONTRIB/$ARCHIVEFILE . +if [[ -f $perlFiles/$RepoName/$ARCHIVEFILE ]] ; then + if [ $DEBUG ] ; then echo "************Copying archivefile $perlFiles/$RepoName/$ARCHIVEFILE" ; fi + cp $perlFiles/$RepoName/$ARCHIVEFILE . else - if [ $DEBUG ] ; then echo "Unable to find archivefile: $CVSFiles/$RepoName/$BASEORCONTRIB/$ARCHIVEFILE - nothing copied" ; fi + if [ $DEBUG ] ; then echo "Unable to find archivefile: $perlFiles/$RepoName/$ARCHIVEFILE - nothing copied" ; fi fi cd $GITFiles/$RepoName @@ -450,7 +439,7 @@ fi # Edit the Readme.md - try to add a link to the wiki for this package - only if it is an SME package cd $GITFiles/$RepoName -DESCRIPTION=`rpm --queryformat '%{description}\n' --specfile "$SPECFILE" +DESCRIPTION=`rpm --queryformat '%{description}\n' --specfile "$SPECFILE"` cat > README.md <<- _EOT # $RepoName diff --git a/smeserver-gitutils b/smeserver-gitutils index c25fa19..fb6a44f 160000 --- a/smeserver-gitutils +++ b/smeserver-gitutils @@ -1 +1 @@ -Subproject commit c25fa1943ac9074e506e52e9148e08f9ee1d723d +Subproject commit fb6a44f132b39eee812b9e47256212d4dbd5d1e5