From: Damien Miller Date: Mon, 14 Mar 2016 23:07:26 +0000 (-0400) Subject: gen-android-files: create the MODULE_LICENSE_GPL and README.version files X-Git-Tag: v1.43-WIP-2016-03-15~6 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=9dd404897d5f3100ed0234d39ea99f8860c1d0a1;p=tools%2Fe2fsprogs.git gen-android-files: create the MODULE_LICENSE_GPL and README.version files These package version metadata files will be used for automated notification of external vulnerability reports in Android. Signed-off-by: Theodore Ts'o --- diff --git a/MODULE_LICENSE_GPL b/MODULE_LICENSE_GPL deleted file mode 100644 index e69de29..0000000 diff --git a/util/android-README.version.in b/util/android-README.version.in new file mode 100644 index 0000000..0fe3cba --- /dev/null +++ b/util/android-README.version.in @@ -0,0 +1,3 @@ +URL: https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/testing/v@VER@/e2fsprogs.@FN@.tar.gz +Version: @FN@ +BugComponent: 95221 diff --git a/util/gen-android-files b/util/gen-android-files index 0c1888d..994337b 100755 --- a/util/gen-android-files +++ b/util/gen-android-files @@ -9,7 +9,7 @@ ANDROID_GENERATED_FILES="lib/ext2fs/ext2_err.c lib/ext2fs/ext2_err.h \ lib/ss/std_rqs.c debugfs/debug_cmds.c debugfs/ro_debug_cmds.c \ debugfs/extent_cmds.c debugfs/e2freefrag.c debugfs/create_inode.c \ debugfs/recovery.c debugfs/revoke.c \ - MODULE_LICENSE_GPL" + MODULE_LICENSE_GPL README.version" SS_DIR=$(pwd)/lib/ss MK_CMDS=/tmp/mk_cmds$$.sh @@ -53,6 +53,56 @@ rm -f ./gen_crc32table ./gen_crc32ctable lib/ext2fs/ext2_err.et touch MODULE_LICENSE_GPL +E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION version.h \ + | awk '{print $3}' | tr \" " " | awk '{print $1}'` +DATE=`grep E2FSPROGS_DATE version.h | awk '{print $3}' \ + | tr \" " "` +E2FSPROGS_DAY=$(echo $DATE | awk -F- '{print $1}' | sed -e '/^[1-9]$/s/^/0/') +MONTH=`echo $DATE | awk -F- '{print $2}'` +YEAR=`echo $DATE | awk -F- '{print $3}'` + +if expr $YEAR ">" 1900 > /dev/null ; then + E2FSPROGS_YEAR=$YEAR +elif expr $YEAR ">" 90 >/dev/null ; then + E2FSPROGS_YEAR=19$YEAR +else + E2FSPROGS_YEAR=20$YEAR +fi + +case $MONTH in +Jan) MONTH_NUM=01; E2FSPROGS_MONTH="January" ;; +Feb) MONTH_NUM=02; E2FSPROGS_MONTH="February" ;; +Mar) MONTH_NUM=03; E2FSPROGS_MONTH="March" ;; +Apr) MONTH_NUM=04; E2FSPROGS_MONTH="April" ;; +May) MONTH_NUM=05; E2FSPROGS_MONTH="May" ;; +Jun) MONTH_NUM=06; E2FSPROGS_MONTH="June" ;; +Jul) MONTH_NUM=07; E2FSPROGS_MONTH="July" ;; +Aug) MONTH_NUM=08; E2FSPROGS_MONTH="August" ;; +Sep) MONTH_NUM=09; E2FSPROGS_MONTH="September" ;; +Oct) MONTH_NUM=10; E2FSPROGS_MONTH="October" ;; +Nov) MONTH_NUM=11; E2FSPROGS_MONTH="November" ;; +Dec) MONTH_NUM=12; E2FSPROGS_MONTH="December" ;; +*) MONTH_NUM=13; E2FSPROGS_MONTH="UNKNOWN" ;; +esac + +base_ver=`echo $E2FSPROGS_VERSION | \ + sed -e 's/-WIP//' -e 's/pre-//' -e 's/-PLUS//'` + +date_spec=${E2FSPROGS_YEAR}${MONTH_NUM}${E2FSPROGS_DAY} + +case $E2FSPROGS_VERSION in +*-WIP|pre-*) + VER="$base_ver-WIP-$date_spec" + FN="$base_ver~WIP.$E2FSPROGS_YEAR.$MONTH_NUM.$E2FSPROGS_DAY" + ;; +*) + VER="$base_ver" + FN="$base_ver" + ;; +esac + +sed -e "s/@VER@/$VER/g" -e "s/@FN@/$FN/" < util/android-README.version.in > README.version + git add -f $ANDROID_GENERATED_FILES if test -f COPYING then