summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorCarlos Maiolino <[email protected]>2026-05-02 14:09:27 +0200
committerCarlos Maiolino <[email protected]>2026-05-02 14:09:27 +0200
commit296c6b9ee85209c0ce375717e30686545baea107 (patch)
treef0da71650e8f58ca528589ad4e39476732fa5b88 /bin
parentb2e1a1cb259e482720430ff9898d2e564ee73d0f (diff)
Save new changesHEADmaster
Diffstat (limited to 'bin')
-rwxr-xr-xbin/fetch_mail.sh16
-rwxr-xr-xbin/korgmail4
-rwxr-xr-xbin/rhmail2
-rwxr-xr-xbin/sync_mail.sh20
-rwxr-xr-xbin/toxicmail5
-rwxr-xr-xbin/work_setup.sh21
-rwxr-xr-xbin/xfs-release.sh118
-rwxr-xr-xbin/xfsdump_release.sh303
-rwxr-xr-xbin/xfsprogs-summary.sh81
-rwxr-xr-xbin/xfsprogs_release.sh303
10 files changed, 57 insertions, 816 deletions
diff --git a/bin/fetch_mail.sh b/bin/fetch_mail.sh
new file mode 100755
index 0000000..2f10567
--- /dev/null
+++ b/bin/fetch_mail.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -x
+MAIL_DIR=/home/cem/Mail
+
+sync_toxic() {
+ local TOXIC_MAIL=$MAIL_DIR/toxiclabs
+ local TOXIC_NOTMUCH_CONFIG=$TOXIC_MAIL/notmuch-config
+ local TOXIC_MBSYNC_CONFIG=$TOXIC_MAIL/mbsyncrc
+ local TOXIC_NM_TAGS=$TOXIC_MAIL/tags.conf
+
+ mbsync --config=$TOXIC_MBSYNC_CONFIG -q -a toxiclabs
+ notmuch --config=$TOXIC_NOTMUCH_CONFIG new
+ notmuch --config=$TOXIC_NOTMUCH_CONFIG tag --input=$TOXIC_NM_TAGS
+}
+
+sync_toxic
diff --git a/bin/korgmail b/bin/korgmail
index 3741930..d045804 100755
--- a/bin/korgmail
+++ b/bin/korgmail
@@ -1,5 +1,5 @@
#!/bin/bash
-MAIL_DIR=/home/cmaiolino/Mail/kernel
+MAIL_DIR=/home/cmaiolino/Mail/Kernel
export NOTMUCH_CONFIG=$MAIL_DIR/notmuch-config
-neomutt -F ~/.mutt/muttrc-kernel
+neomutt -F ~/.mutt/muttrc-Kernel
diff --git a/bin/rhmail b/bin/rhmail
index 3f435d5..fd132de 100755
--- a/bin/rhmail
+++ b/bin/rhmail
@@ -1,7 +1,7 @@
#!/bin/bash
MUTT=`which neomutt`
-MUTTRC="~/.mutt/muttrc-local"
+MUTTRC="~/.mutt/muttrc-redhat"
$MUTT -F $MUTTRC
diff --git a/bin/sync_mail.sh b/bin/sync_mail.sh
index b718b9a..2bf04c5 100755
--- a/bin/sync_mail.sh
+++ b/bin/sync_mail.sh
@@ -2,9 +2,22 @@
MBSYNC=`which mbsync`
NOTMUCH=`which notmuch`
-MUTT_DIR=/home/cmaiolino/.mutt
-MAIL_DIR=/home/cmaiolino/Mail
+MUTT_DIR=/home/cem/.mutt
+MAIL_DIR=/home/cem/Mail
+sync_toxic() {
+ local TOXIC_MAIL=$MAIL_DIR/toxiclabs
+ local MBSYNC_CONFIG=$TOXIC_MAIL/mbsyncrc
+ local NOTMUCH_TAGS=$TOXIC_MAIL/toxic_nmtag.conf
+ local TOXIC_MUTTRC=$MUTT_DIR/muttrc-toxiclabs
+ local TOXIC_NM_CONFIG=$TOXIC_MAIL/notmuch-config
+ local TOXIC_NM_TAGS=$TOXIC_MAIL/toxic_nmtag.conf
+
+ mbsync --config=$MBSYNC_CONFIG -a -q
+
+ notmuch --config=$KORG_NM_CONFIG new
+ notmuch --config=$KORG_NM_CONFIG tag --input=$KORG_NM_TAGS
+}
sync_redhat() {
local RH_MAIL=$MAIL_DIR/redhat
local MBSYNC_CONFIG=$RH_MAIL/mbsyncrc
@@ -14,7 +27,7 @@ sync_redhat() {
}
sync_korg() {
- local KORG_MAIL=$MAIL_DIR/kernel
+ local KORG_MAIL=$MAIL_DIR/Kernel
local MBSYNC_CONFIG=$KORG_MAIL/mbsyncrc
local NOTMUCH_TAGS=$KORG_MAIL/kernel_nmtag.conf
local KORG_MUTTRC=$MUTT_DIR/muttrc-kernel
@@ -29,3 +42,4 @@ sync_korg() {
sync_redhat
sync_korg
+sync_toxic
diff --git a/bin/toxicmail b/bin/toxicmail
new file mode 100755
index 0000000..00189b4
--- /dev/null
+++ b/bin/toxicmail
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+#MAIL_DIR=/home/cmaiolino/Mail/toxiclabs
+#export NOTMUCH_CONFIG=$MAIL_DIR/notmuch-config
+neomutt -F ~/.mutt/muttrc-toxiclabs
diff --git a/bin/work_setup.sh b/bin/work_setup.sh
index d54e777..15f50e9 100755
--- a/bin/work_setup.sh
+++ b/bin/work_setup.sh
@@ -1,9 +1,20 @@
#!/bin/bash
-tmux new-session -s "WORKSPACE" -d -n "WORKSPACE" 'rhmail'
-tmux split-window -t WORKSPACE -v 'ikhal'
-tmux split-window -t WORKSPACE -h
-tmux split-window -t WORKSPACE -h 'weechat'
+tmux new-session -s "WORKSPACE" -d -n "WORKDSPACE" 'ikhal'
tmux split-window -t WORKSPACE -v
-tmux select-layout -t WORKSPACE "77ad,343x61,0,0{156x61,0,0,4,186x61,157,0[186x30,157,0{93x30,157,0,6,92x30,251,0,9},186x30,157,31{93x30,157,31,8,92x30,251,31,10}]}"
+tmux select-pane -t 1
+tmux split-window -t WORKSPACE -h 'emacs ~/Nextcloud/ORG/GTD.org'
+tmux select-pane -t 3
+tmux split-window -t WORKSPACE -h 'weechat'
+tmux select-layout -t WORKSPACE "4432,223x61,0,0{111x61,0,0[111x30,0,0,0,111x30,0,31,6],111x61,112,0[111x30,112,0,4,111x30,112,31,5]}"
+tmux select-pane -t 1 'ikhal'
+#tmux split-window -t WORKSPACE -h -n "IRC"
+#tmux select-window -t "CALENDAR"
+#tmux split-window -t WORKSPACE -n "TODO" -v 'emacs ~/Nextcloud/ORG/GTD.org'
+#tmux select-window -t "IRC"
+#tmux split-window -t WORKSPACE -h 'vim ~/Nextcloud/vimwiki/index.wiki'
+#tmux split-window -t WORKSPACE -v 'weechat'
+#tmux select-layout -t WORKSPACE "5e76,343x64,0,0{171x64,0,0,0,171x64,172,0,1}"
+#tmux select-layout -t WORKSPACE "a201,343x63,0,0{171x63,0,0,13,171x63,172,0[171x31,172,0,14,171x31,172,32{85x31,172,32,15,85x31,258,32,16}]}"
+#tmux select-layout -t WORKSPACE "77ad,343x61,0,0{156x61,0,0,4,186x61,157,0[186x30,157,0{93x30,157,0,6,92x30,251,0,9},186x30,157,31{93x30,157,31,8,92x30,251,31,10}]}"
tmux attach
diff --git a/bin/xfs-release.sh b/bin/xfs-release.sh
deleted file mode 100755
index 105c4a6..0000000
--- a/bin/xfs-release.sh
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/bin/bash
-
-#Maintainer info
-MAINTAINER_EMAIL="[email protected]"
-MAINTAINER_NAME="Carlos Maiolino"
-
-SOURCE=$PWD
-
-#Files
-VERSION_FILE="$SOURCE/VERSION"
-CONFIGURE_FILE="$SOURCE/configure.ac"
-DEBIAN_FILE="$SOURCE/debian/changelog"
-CHANGES_FILE="$SOURCE/doc/CHANGES"
-
-VER_MAJ="$1"
-VER_MIN="$2"
-VER_REV="$3"
-
-REL_VER="$VER_MAJ.$VER_MIN.$VER_REV"
-REL_TAG="v$VER_MAJ.$VER_MIN.$VER_REV"
-
-#OLD_VER here points to the previous released tag
-OLD_TAG=$4
-
-usage() {
- echo "./xfsprogs_release.sh <mav_ver> <min_ver> <revision> <old_git_tag>"
- exit
-}
-
-## UPDATE VERSIONING ##
-update_version_file() {
- sed -i -e "s/^PKG_MAJOR=.*/PKG_MAJOR=$VER_MAJ/" $VERSION_FILE
- sed -i -e "s/^PKG_MINOR=.*/PKG_MINOR=$VER_MIN/" $VERSION_FILE
- sed -i -e "s/^PKG_REVISION=.*/PKG_REVISION=$VER_REV/" $VERSION_FILE
-}
-
-update_configure_file() {
- CONF_AC="AC_INIT([xfsprogs],[$REL_VER],[[email protected]])"
- sed -i "s/^AC_INIT.*/$CONF_AC/" $CONFIGURE_FILE
-}
-
-# Update is done in 'reverse order', so the script can always update the first
-# line of the file, just to KISS.
-update_debian_changelog() {
- sed -i "1s/^/\n/" $DEBIAN_FILE
- sed -i "1s/^/ -- Nathan Scott <[email protected]> $(date -R)\n/" $DEBIAN_FILE
- sed -i "1s/^/\n/" $DEBIAN_FILE
-
- sed -i "1s/^/ * New upstream release\n/" $DEBIAN_FILE
- sed -i "1s/^/\n/" $DEBIAN_FILE
- sed -i "1s/^/xfsprogs ($VER_MAJ.$VER_MIN.$VER_REV) unstable; urgency=low\n/" $DEBIAN_FILE
-}
-
-update_changes_file() {
-
- TMP_FILE=$(mktemp)
- git log --oneline --reverse --format="%s (%an)" $OLD_TAG.. > $TMP_FILE
-
- while read -r line; do
- sed -i "1s/^/\t$line\n/" $CHANGES_FILE
- done < $TMP_FILE
-
- rm -f $TMP_FILE
-}
-
-create_signed_tag() {
- git tag -s -u $MAINTAINER_EMAIL -m "Release $REL_RAG" $REL_TAG
-}
-
-create_and_push_tarball() {
- kup put xfsprogs-$REL_VER.tar.gz xfsprogs-$REL_VER.tar.sign \
- pub/linux/utils/fs/xfs/xfsprogs/xfsprogs-$REL_VER.tar.gz
-}
-
-is_xfsprogs_repo() {
- if [ -a $SOURCE/README ] && \
- [ "$(head -1 $SOURCE/README)" == "XFS User Tools README" ]; then
- return 0
- else
- echo "Current dir not a xfsprogs repository"
- usage
- exit 1
- fi
-}
-
-
-### PROGRAM STARTS HERE ###
-# Ensure we are withing a xfsprogs repository:
-is_xfsprogs_repo
-
-# MAJ, MIN, REV, OLD_TAG
-if [ $# -ne 4 ]; then
- echo "Invalid number of arguments"
- usage
- exit 1
-fi
-
-# Update files for new release
-
-#echo "Updating config.ac file..."
-#update_configure_file
-#echo "...done"
-#echo
-#echo "Updating debian changelog..."
-#update_debian_changelog
-#echo "...done"
-#echo
-#echo "Updating VERSION file..."
-#update_version_file
-#echo "...done"
-#echo
-
-#echo "Commiting changes..."
-#git add $VERSION_FILE $CONFIGURE_FILE $DEBIAN_FILE
-#
-#git commit -s -m "xfsprogs: Release $REL_TAG" \
-#-m "Update all the necessary files for a $REL_TAG release."
-update_changes_file
diff --git a/bin/xfsdump_release.sh b/bin/xfsdump_release.sh
deleted file mode 100755
index 42fc2ac..0000000
--- a/bin/xfsdump_release.sh
+++ /dev/null
@@ -1,303 +0,0 @@
-#!/bin/bash
-
-SOURCE="$PWD"
-VERSION_FILE="$SOURCE/VERSION"
-CONFIGURE_FILE="$SOURCE/configure.ac"
-DEB_FILE="$SOURCE/debian/changelog"
-FORNEXT_DIR="/home/cmaiolin/Source/xfsdump/for-next"
-LAST_HEAD=""
-DEBUG=1
-
-VER_MAJ="$1"
-VER_MIN="$2"
-VER_REV="$3"
-
-CHANGELOG_FILE="/tmp/changelog.$$"
-
-##### COMMON #####
-
-# Print Usage information
-usage(){
- echo " ./xfsdump_relase.sh <maj_ver> <min_ver> <revision>"
- exit
-}
-
-# Check update versioning
-check_args(){
- if [ -z ${VER_MAJ} ]; then
- echo "SET MAJ VERSION"
- usage
- fi
- if [ -z ${VER_MIN} ]; then
- echo "SET MIN VERSION"
- usage
- fi
- if [ -z ${VER_REV} ]; then
- echo "SET REVISION"
- usage
- fi
-}
-
-# Open neomutt with the composed message to send
-send_email(){
-SUBJECT="$1"
-BODY="$2"
-
- if [ -z "$SUBJECT" ]; then
- echo "No subject... exiting"
- exit 1
- fi
-
- if [ -f $BODY ]; then
- neomutt -F ~/.mutt/muttrc-local-korg -s "$SUBJECT" $LIST -i $BODY
- else
- echo "No message body... exiting"
- exit 1
- fi
-
-}
-
-print_shortlog(){
-LAST_HEAD=$1
-HEAD=$2
-
- if [ -z $LAST_HEAD ]; then
- echo "Previous head not set... exiting"
- exit 1
- fi
-
- if [ -z $HEAD ]; then
- HEAD="HEAD"
- fi
-
- echo "$(git shortlog --format="[%h] %s" $LAST_HEAD..$HEAD)"
-}
-
-print_diffstat(){
-LAST_HEAD=$1
-HEAD=$2
-
- if [ -z $LAST_HEAD ]; then
- echo "Previous head not set... exiting"
- exit 1
- fi
-
- if [ -z $HEAD ]; then
- HEAD="HEAD"
- fi
-
- echo "$(git diff --stat --summary -C -M $LAST_HEAD..$HEAD)"
-}
-
-print_commit_count(){
-LAST_HEAD=$1
-HEAD=$2
-
- if [ -z $LAST_HEAD ]; then
- echo "Previous head not set... exiting"
- exit 1
- fi
-
- if [ -z $HEAD ]; then
- HEAD="HEAD"
- fi
-
- echo "$(git log --oneline $LAST_HEAD.. | wc -l)"
-}
-
-print_head(){
- if [ "$1" == "short" ]; then
- HEAD=$(git log --oneline --format="%h" -1)
- else
- HEAD=$(git log --oneline --format="%H" -1)
- fi
- echo "$HEAD"
-}
-
-##### COMMON END #####
-
-
-##### FOR-NEXT UPDATE #####
-compose_fornext_email(){
-
- MAIL_FILE=$(mktemp)
- LAST_HEAD=$1
-
-if [ -z $LAST_HEAD ]; then
- echo "compose_email: Previous head not set... exiting"
- exit 1
-fi
-
-# BEGIN_OF_MESSAGE
-cat << EOF > $MAIL_FILE
-Hello.
-
-The xfsdump for-next branch, located at:
-
-https://git.kernel.org/pub/scm/fs/xfs/xfsdump-dev.git/refs/?h=for-next
-
-Has just been updated.
-
-Patches often get missed, so if your outstanding patches are properly reviewed on
-the list and not included in this update, please let me know.
-
-The new head of the for-next branch is commit:
-
-$(print_head)
-
-$(print_commit_count $LAST_HEAD) new commits:
-
-$(print_shortlog $LAST_HEAD)
-
-Code Diffstat:
-
-$(print_diffstat $LAST_HEAD)
-EOF
-# END_OF_MESSAGE
-
-echo $MAIL_FILE
-}
-
-compose_release_email(){
-
- MAIL_FILE=$(mktemp)
- LAST_HEAD=$1
-
-cat << EOF > $MAIL_FILE
-Hi folks,
-
-The xfsdump repository at:
-
- git://git.kernel.org/pub/scm/fs/xfs/xfsdump-dev.git
-
-has just been updated.
-
-Patches often get missed, so if your outstanding patches are properly reviewed
-on the list and not included in this update, please let me know.
-
-The for-next branch has also been updated to match the state of master.
-
-The new head of the master branch is commit:
-
-$(print_head)
-
-New commits:
-
-$(print_shortlog $LAST_HEAD)
-
-Code Diffstat:
-
-$(print_diffstat $LAST_HEAD)
-EOF
-
-#END_OF_MESSAGE
-echo $MAIL_FILE
-
-}
-fornext_announce(){
-
- LAST_HEAD=$1
-
- if [ -z $LAST_HEAD ]; then
- echo "No starting HEAD specified... exiting"
- exit 1
- fi
-
- SUBJECT="[ANNOUNCE] xfsdump: for-next updated to $(print_head short)"
- BODY=$(compose_fornext_email $LAST_HEAD)
-
- send_email "$SUBJECT" $BODY
-}
-
-release_announce(){
- LAST_HEAD=$1
- RELEASE=$(git describe --abbrev=0)
-
- if [ -z $LAST_HEAD ]; then
- echo "No starting HEAD specified... exiting"
- exit 1
- fi
-
- SUBJECT="[ANNOUNCE] xfsdump $RELEASE released"
- BODY=$(compose_release_email $LAST_HEAD)
-
- send_email "$SUBJECT" $BODY
-}
-##### FOR-NEXT UPDATE #####
-
-##### RELEASE SETUP ######
-update_version_file(){
- echo "updating version"
- sed -i -e "s/^PKG_MAJOR=.*/PKG_MAJOR=$VER_MAJ/" $VERSION_FILE
- sed -i -e "s/^PKG_MINOR=.*/PKG_MINOR=$VER_MIN/" $VERSION_FILE
- sed -i -e "s/^PKG_REVISION=.*/PKG_REVISION=$VER_REV/" $VERSION_FILE
-}
-
-update_configure_file(){
- CONF_AC="AC_INIT([xfsdump],[$VER_MAJ.$VER_MIN.$VER_REV],[[email protected]])"
-
- sed -i "s/^AC_INIT.*/$CONF_AC/" $CONFIGURE_FILE
-}
-
-update_debian_changelog(){
-#if [ ! -s $CHANGELOG_FILE ]; then
-# echo "Error: changelog does not exist or empty. Exiting..."
-# exit
-#fi
-
-sed -i "1s/^/\n/" $DEB_FILE
-sed -i "1s/^/ -- Nathan Scott <[email protected]> `date -R`\n/" $DEB_FILE
-sed -i "1s/^/\n/" $DEB_FILE
-
-#while read -r LINE; do
-# sed -i "1s/^/ * $LINE\n/" $DEB_FILE
-#done <$CHANGELOG_FILE
-
-sed -i "1s/^/ * New upstream release\n/" $DEB_FILE
-sed -i "1s/^/\n/" $DEB_FILE
-sed -i "1s/^/xfsdump ($VER_MAJ.$VER_MIN.$VER_REV) unstable; urgency=low\n/" $DEB_FILE
-}
-
-# Get user inputs for each changelog entry
-# XXX this should be automated based on patches subjects
-get_changelog(){
- LOG=""
- while [ 1 ]; do
- read -p "Changelog entry:" tmplog
-
- if [ -z "$tmplog" ]; then
- break;
- fi
- echo "$tmplog" >> $CHANGELOG_FILE
- done
-}
-
-
-#MOVE TO THE CORRECT REPO
-#cd $FORNEXT_DIR
-
-#check_args
-#get_changelog
-#update_version_file
-#update_configure_file
-#update_debian_changelog
-#rm $CHANGELOG_FILE
-#email_fornext $1
-#fornext_announce 37e6e80a6
-
-while getopts "n:r:" opt; do
- case $opt in
- n) # for-next
- LAST_HEAD=$OPTARG
- fornext_announce $LAST_HEAD
- ;;
- r) # Release
- LAST_HEAD=$OPTARG
- release_announce $LAST_HEAD
- ;;
- *)
- usage
- ;;
- esac
-done
diff --git a/bin/xfsprogs-summary.sh b/bin/xfsprogs-summary.sh
deleted file mode 100755
index ca82955..0000000
--- a/bin/xfsprogs-summary.sh
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/bash
-
-MAINTAINER="Eric Sandeen <[email protected]>"
-
-IFS=$(echo -en "\n\b")
-
-for PATCH in `guilt applied -c`; do
- COMMIT=`echo $PATCH | awk '{print $1}'`
- FILENAME=`echo $PATCH | awk '{print $2}'`
-
- SUBJECT=`git show --pretty=format:%s $COMMIT | head -n 1`
- AUTHOR=`git show $COMMIT | grep ^Author | awk -F": " '{print $2}'`
- AUTHOR_SOB=`git show $COMMIT | grep -i Signed-off-by: | head -n 1 | awk -F": " '{print $2}'`
- COMMITTER_SOB=`git show $COMMIT | grep -i Signed-off-by: | tail -n 1 | awk -F": " '{print $2}'`
- REVIEWED_BY=`git show $COMMIT | grep -i Reviewed-by: | tail -n 1 | awk -F": " '{print $2}'`
-
- echo -n "PATCH: $PATCH"
-
- # Check for double spaces in subject
- if [[ "$SUBJECT" == *" "* ]]; then
- DOUBLE="true"
- else
- DOUBLE="false"
- fi
-
- if [ "$REVIEWED_BY" != "" -a \
- "$AUTHOR" == "$AUTHOR_SOB" -a \
- "$COMMITTER_SOB" == "$MAINTAINER" -a \
- "$DOUBLE" == "false" ]; then
- echo " - OK"
- else
- echo
- fi
-
- if [[ "$SUBJECT" == *" "* ]]; then
- echo " double spaces in: $SUBJECT"
- fi
- if [ "$REVIEWED_BY" == "" ]; then
- echo " no Reviewed-by:"
- fi
- if [ "$AUTHOR" != "$AUTHOR_SOB" ]; then
- echo " author $AUTHOR sob $AUTHOR_SOB"
- fi
- if [ "$COMMITTER_SOB" != "$MAINTAINER" ]; then
- echo " committer $COMMITTER_SOB maintainer $MAINTAINER"
- fi
-
-done
-[root@intel-lizardhead-04 ~]# cat /usr/local/bin/xfsprogs-summary.sh
-#!/bin/bash
-
-cat << EOF
-Hi folks,
-
-The xfsprogs repository at:
-
- git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git
-
-has just been updated.
-
-Patches often get missed, so please check if your outstanding
-patches were in this update. If they have not been in this update,
-please resubmit them to [email protected] so they can be
-picked up in the next update.
-
-The new head of the master branch is commit:
-
-EOF
-
-git log --oneline -n 1 $* #v6.4.0
-
-echo
-echo New Commits:
-echo
-git shortlog --format="[%h] %s" $*
-
-echo
-echo Code Diffstat:
-echo
-git diff --stat --summary -C -M $*
-
diff --git a/bin/xfsprogs_release.sh b/bin/xfsprogs_release.sh
deleted file mode 100755
index 104adc8..0000000
--- a/bin/xfsprogs_release.sh
+++ /dev/null
@@ -1,303 +0,0 @@
-#!/bin/bash
-
-SOURCE="$PWD"
-VERSION_FILE="$SOURCE/VERSION"
-CONFIGURE_FILE="$SOURCE/configure.ac"
-DEB_FILE="$SOURCE/debian/changelog"
-FORNEXT_DIR="~/Source/xfsprogs/for-next"
-LAST_HEAD=""
-DEBUG=1
-
-VER_MAJ="$1"
-VER_MIN="$2"
-VER_REV="$3"
-
-CHANGELOG_FILE="/tmp/changelog.$$"
-
-##### COMMON #####
-
-# Print Usage information
-usage(){
- echo " ./xfsprogs_relase.sh <maj_ver> <min_ver> <revision>"
- exit
-}
-
-# Check update versioning
-check_args(){
- if [ -z ${VER_MAJ} ]; then
- echo "SET MAJ VERSION"
- usage
- fi
- if [ -z ${VER_MIN} ]; then
- echo "SET MIN VERSION"
- usage
- fi
- if [ -z ${VER_REV} ]; then
- echo "SET REVISION"
- usage
- fi
-}
-
-# Open neomutt with the composed message to send
-send_email(){
-SUBJECT="$1"
-BODY="$2"
-
- if [ -z "$SUBJECT" ]; then
- echo "No subject... exiting"
- exit 1
- fi
-
- if [ -f $BODY ]; then
- neomutt -F ~/.mutt/muttrc-kernel -s "$SUBJECT" $LIST -i $BODY
- else
- echo "No message body... exiting"
- exit 1
- fi
-
-}
-
-print_shortlog(){
-LAST_HEAD=$1
-HEAD=$2
-
- if [ -z $LAST_HEAD ]; then
- echo "Previous head not set... exiting"
- exit 1
- fi
-
- if [ -z $HEAD ]; then
- HEAD="HEAD"
- fi
-
- echo "$(git shortlog --format="[%h] %s" $LAST_HEAD..$HEAD)"
-}
-
-print_diffstat(){
-LAST_HEAD=$1
-HEAD=$2
-
- if [ -z $LAST_HEAD ]; then
- echo "Previous head not set... exiting"
- exit 1
- fi
-
- if [ -z $HEAD ]; then
- HEAD="HEAD"
- fi
-
- echo "$(git diff --stat --summary -C -M $LAST_HEAD..$HEAD)"
-}
-
-print_commit_count(){
-LAST_HEAD=$1
-HEAD=$2
-
- if [ -z $LAST_HEAD ]; then
- echo "Previous head not set... exiting"
- exit 1
- fi
-
- if [ -z $HEAD ]; then
- HEAD="HEAD"
- fi
-
- echo "$(git log --oneline $LAST_HEAD.. | wc -l)"
-}
-
-print_head(){
- if [ "$1" == "short" ]; then
- HEAD=$(git log --oneline --format="%h" -1)
- else
- HEAD=$(git log --oneline --format="%H" -1)
- fi
- echo "$HEAD"
-}
-
-##### COMMON END #####
-
-
-##### FOR-NEXT UPDATE #####
-compose_fornext_email(){
-
- MAIL_FILE=$(mktemp)
- LAST_HEAD=$1
-
-if [ -z $LAST_HEAD ]; then
- echo "compose_email: Previous head not set... exiting"
- exit 1
-fi
-
-# BEGIN_OF_MESSAGE
-cat << EOF > $MAIL_FILE
-Hello.
-
-The xfsprogs for-next branch, located at:
-
-https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/refs/?h=for-next
-
-Has just been updated.
-
-Patches often get missed, so if your outstanding patches are properly reviewed on
-the list and not included in this update, please let me know.
-
-The new head of the for-next branch is commit:
-
-$(print_head)
-
-$(print_commit_count $LAST_HEAD) new commits:
-
-$(print_shortlog $LAST_HEAD)
-
-Code Diffstat:
-
-$(print_diffstat $LAST_HEAD)
-EOF
-# END_OF_MESSAGE
-
-echo $MAIL_FILE
-}
-
-compose_release_email(){
-
- MAIL_FILE=$(mktemp)
- LAST_HEAD=$1
-
-cat << EOF > $MAIL_FILE
-Hi folks,
-
-The xfsprogs repository at:
-
- git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git
-
-has just been updated.
-
-Patches often get missed, so if your outstanding patches are properly reviewed
-on the list and not included in this update, please let me know.
-
-The for-next branch has also been updated to match the state of master.
-
-The new head of the master branch is commit:
-
-$(print_head)
-
-New commits:
-
-$(print_shortlog $LAST_HEAD)
-
-Code Diffstat:
-
-$(print_diffstat $LAST_HEAD)
-EOF
-
-#END_OF_MESSAGE
-echo $MAIL_FILE
-
-}
-fornext_announce(){
-
- LAST_HEAD=$1
-
- if [ -z $LAST_HEAD ]; then
- echo "No starting HEAD specified... exiting"
- exit 1
- fi
-
- SUBJECT="[ANNOUNCE] xfsprogs: for-next updated to $(print_head short)"
- BODY=$(compose_fornext_email $LAST_HEAD)
-
- send_email "$SUBJECT" $BODY
-}
-
-release_announce(){
- LAST_HEAD=$1
- RELEASE=$(git describe --abbrev=0)
-
- if [ -z $LAST_HEAD ]; then
- echo "No starting HEAD specified... exiting"
- exit 1
- fi
-
- SUBJECT="[ANNOUNCE] xfsprogs $RELEASE released"
- BODY=$(compose_release_email $LAST_HEAD)
-
- send_email "$SUBJECT" $BODY
-}
-##### FOR-NEXT UPDATE #####
-
-##### RELEASE SETUP ######
-update_version_file(){
- echo "updating version"
- sed -i -e "s/^PKG_MAJOR=.*/PKG_MAJOR=$VER_MAJ/" $VERSION_FILE
- sed -i -e "s/^PKG_MINOR=.*/PKG_MINOR=$VER_MIN/" $VERSION_FILE
- sed -i -e "s/^PKG_REVISION=.*/PKG_REVISION=$VER_REV/" $VERSION_FILE
-}
-
-update_configure_file(){
- CONF_AC="AC_INIT([xfsprogs],[$VER_MAJ.$VER_MIN.$VER_REV],[[email protected]])"
-
- sed -i "s/^AC_INIT.*/$CONF_AC/" $CONFIGURE_FILE
-}
-
-update_debian_changelog(){
-#if [ ! -s $CHANGELOG_FILE ]; then
-# echo "Error: changelog does not exist or empty. Exiting..."
-# exit
-#fi
-
-sed -i "1s/^/\n/" $DEB_FILE
-sed -i "1s/^/ -- Nathan Scott <[email protected]> `date -R`\n/" $DEB_FILE
-sed -i "1s/^/\n/" $DEB_FILE
-
-#while read -r LINE; do
-# sed -i "1s/^/ * $LINE\n/" $DEB_FILE
-#done <$CHANGELOG_FILE
-
-sed -i "1s/^/ * New upstream release\n/" $DEB_FILE
-sed -i "1s/^/\n/" $DEB_FILE
-sed -i "1s/^/xfsprogs ($VER_MAJ.$VER_MIN.$VER_REV) unstable; urgency=low\n/" $DEB_FILE
-}
-
-# Get user inputs for each changelog entry
-# XXX this should be automated based on patches subjects
-get_changelog(){
- LOG=""
- while [ 1 ]; do
- read -p "Changelog entry:" tmplog
-
- if [ -z "$tmplog" ]; then
- break;
- fi
- echo "$tmplog" >> $CHANGELOG_FILE
- done
-}
-
-
-#MOVE TO THE CORRECT REPO
-#cd $FORNEXT_DIR
-
-#check_args
-#get_changelog
-#update_version_file
-#update_configure_file
-#update_debian_changelog
-#rm $CHANGELOG_FILE
-#email_fornext $1
-#fornext_announce 37e6e80a6
-
-while getopts "n:r:" opt; do
- case $opt in
- n) # for-next
- LAST_HEAD=$OPTARG
- fornext_announce $LAST_HEAD
- ;;
- r) # Release
- LAST_HEAD=$OPTARG
- release_announce $LAST_HEAD
- ;;
- *)
- usage
- ;;
- esac
-done