diff options
Diffstat (limited to 'trunk/src')
-rw-r--r-- | trunk/src/createpkg | 1 | ||||
-rwxr-xr-x | trunk/src/mkbuild | 90 |
2 files changed, 90 insertions, 1 deletions
diff --git a/trunk/src/createpkg b/trunk/src/createpkg index 2344a1b..325d120 100644 --- a/trunk/src/createpkg +++ b/trunk/src/createpkg @@ -175,6 +175,7 @@ function find_slackbuild { OUTPUT=`find $SLACKBUILDS_DIR -iname $1.SlackBuild` [ "$OUTPUT" != "" ] && EXIT_CODE=0 || EXIT_CODE=1 echo $OUTPUT + } function info_builds { diff --git a/trunk/src/mkbuild b/trunk/src/mkbuild index 551c5ad..72c970f 100755 --- a/trunk/src/mkbuild +++ b/trunk/src/mkbuild @@ -628,7 +628,11 @@ function submit_mkbuild { svn_copy $WORK/$MKBUILD_NAME $MKBUILD_PATH for i in `ls $WORK | grep -E -v '(SlackBuild|old|slack-required|.mkbuild$|.tmp$)\*{0,1}$'`; do - svn_copy $WORK/$i $MKBUILD_PATH + if ! is_the_same $(dirname $MKBUILD_PATH) $WORK; then + svn_copy $WORK/$i $MKBUILD_PATH + else + svn_add $WORK/$i + fi done # remove stuff in old places @@ -719,6 +723,87 @@ function load_parameters { TMP="`eval_parameter TMP /tmp`" } + +function file_metainfo { + + # get integrity file metainformation + # usage: file_metainfo <file> <file_type> + + local size algo sum="" file="$1" file_type="$2" + + if [ ! -e "$file" ] || [ -z "$file_type" ]; then + return 1 + fi + + for algo in md5 sha1 sha256 sha512 rmd160; do + sum="$sum `echo $algo | tr '[:lower:]' '[:upper:]'` `gethash $algo $file`" + done + + echo $file_type `basename $file` `file_size $file` $sum + +} + +function update_manifest_info { + + # update Manifest meatinfo for a given file + # usage: update_manifest_info <file> <file_type> + + local tmpfile file="$1" file_type="`echo $2 | tr '[:lower:]' '[:upper:]'`" + + if [ ! -e "$file" ]; then + return 1 + fi + + if [ -z "$file_type" ]; then + file_type="`file_extension $file | tr '[:lower:]' '[:upper:]'`" + fi + + # Update Manifest file + if [ ! -e "`dirname $file`/Manifest" ]; then + touch $WORK/Manifest + fi + + # Set temporary file + tmpfile="`mktemp $TMP/mkbuild_manifest.XXXXXX`" + + # Update metainfo + sed -e "/^$file_type `basename $file` /d" `dirname $file`/Manifest > $tmpfile + file_metainfo $file $file_type >> $tmpfile + sort $tmpfile > `dirname $file`/Manifest + + rm -f $tmpfile + +} + +function update_manifest { + + # Update Manifest file + + # Update mkbuild metainformation + uptate_manifest_info $WORK/$MKBUILD_NAME + + # Update slack-required information + uptate_manifest_info $WORK/slack-required + + # Update SlackBuild information + update_manifest_info $WORK/$SLACKBUILD + + # Update patches + for i in `find $WORK | grep -E '(.diff$|.diff.gz$|.diff.bz2$|.patch$|.patch.gz$|.patch.bz2$)\*{0,1}$'`; do + if [ ! -d "$WORK/$i" ]; then + update_manifest_info $i patch + fi + done + + # Update miscelaneous information + for i in `find $WORK | grep -E -v '(SlackBuild|old|slack-required|.mkbuild$|.tmp$)\*{0,1}$'`; do + if [ ! -d "$WORK/$i" ]; then + update_manifest_info $i misc + fi + done + +} + # ---------------------------------------------------------------- #============================= @@ -972,6 +1057,9 @@ if [ ! -z $MKBUILD_NAME ]; then [ $VERBOSE -eq $on ] && echo -e "\nEdit others [[]] parameters ..." change_others_parameters + # Update Manifest file + update_manifest + # Commit SlackBuild [ $SUBMIT_SLACKBUILD -eq $on ] && submit_slackbuild |