summaryrefslogtreecommitdiff
path: root/scripts/git-helper.sh
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2021-04-29 14:25:53 -0400
committerB. Stack <bgstack15@gmail.com>2021-04-29 14:25:53 -0400
commitf2bc51d6abaf8d6c5bb665b996673a372f6b9e97 (patch)
tree861d645cd2694091905d689bc677b518bc84a48f /scripts/git-helper.sh
parentnow builds src.rpm (diff)
downloadlibrewolf-fedora-f2bc51d6abaf8d6c5bb665b996673a372f6b9e97.tar.gz
librewolf-fedora-f2bc51d6abaf8d6c5bb665b996673a372f6b9e97.tar.bz2
librewolf-fedora-f2bc51d6abaf8d6c5bb665b996673a372f6b9e97.zip
add git-helper, and README
Diffstat (limited to 'scripts/git-helper.sh')
-rwxr-xr-xscripts/git-helper.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/scripts/git-helper.sh b/scripts/git-helper.sh
new file mode 100755
index 0000000..20c3aad
--- /dev/null
+++ b/scripts/git-helper.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+# Purpose: help librewolf-fedora-ff modified git repo by adding its readme and useful git config
+# Startdate: 2021-04-29
+# Dependencies:
+# git
+
+#####################################
+# Load settings
+# basically, dot-source the conf file.
+test -z "${librewolf_rpm_conf}" && export librewolf_rpm_conf="$( find "$( dirname "${0}" )" -maxdepth 2 -name "prep-librewolf-rpm.conf" -print 2>/dev/null | head -n1 )"
+test ! -r "${librewolf_rpm_conf}" && { echo "Unable to load config file, which should be named prep-librewolf-rpm.conf. Aborted." 1>&2 ; exit 1 ; }
+. "${librewolf_rpm_conf}"
+script_dir="$( dirname "$( readlink -f "${0}" )" )"
+
+# switch to target directory
+src_rpm_dir=${CI_PROJECT_DIR}/${firefox_version}/git
+cd "${src_rpm_dir}"
+if test "$( git remote -v | awk '$1=="origin" && $3~/fetch/{print $2}' )" != "https://src.fedoraproject.org/rpms/firefox/" ; then
+ echo "Cannot find git repo that cloned https://src.fedoraproject.org/rpms/firefox/. Aborted." 1>&2
+ exit 1
+fi
+if ! test -f librewolf.spec ; then
+ echo "Cannot determine that prep-librewolf-rpm.sh has run yet! Where is librewolf.spec?" 1>&2
+ exit 1
+fi
+# So if we get here, we're in the right spot
+
+# Make file changes
+cp -p "${script_dir}/../for-repo/README.md" .
+sed -i -r .gitignore \
+ -e '/cbindgen-vendor/d'
+grep -qE '\*\.spec\?' .gitignore || echo '*.spec?' >> .gitignore
+
+# Add git remote
+git remote add gitlab https://gitlab.com/bgstack15/librewolf-fedora-ff.git
+git pull --all
bgstack15