diff options
-rw-r--r-- | meta/classes/sstate.bbclass | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index ba2c9fee35..566a58dafb 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass | |||
@@ -852,14 +852,18 @@ sstate_create_package () { | |||
852 | fi | 852 | fi |
853 | chmod 0664 $TFILE | 853 | chmod 0664 $TFILE |
854 | # Skip if it was already created by some other process | 854 | # Skip if it was already created by some other process |
855 | if [ ! -e ${SSTATE_PKG} ]; then | 855 | if [ -h ${SSTATE_PKG} ] && [ ! -e ${SSTATE_PKG} ]; then |
856 | # There is a symbolic link, but it links to nothing. | ||
857 | # Forcefully replace it with the new file. | ||
858 | ln -f $TFILE ${SSTATE_PKG} || true | ||
859 | elif [ ! -e ${SSTATE_PKG} ]; then | ||
856 | # Move into place using ln to attempt an atomic op. | 860 | # Move into place using ln to attempt an atomic op. |
857 | # Abort if it already exists | 861 | # Abort if it already exists |
858 | ln $TFILE ${SSTATE_PKG} && rm $TFILE | 862 | ln $TFILE ${SSTATE_PKG} || true |
859 | else | 863 | else |
860 | rm $TFILE | 864 | touch ${SSTATE_PKG} 2>/dev/null || true |
861 | fi | 865 | fi |
862 | touch ${SSTATE_PKG} 2>/dev/null || true | 866 | rm $TFILE |
863 | } | 867 | } |
864 | 868 | ||
865 | python sstate_sign_package () { | 869 | python sstate_sign_package () { |
@@ -889,7 +893,7 @@ python sstate_report_unihash() { | |||
889 | sstate_unpack_package () { | 893 | sstate_unpack_package () { |
890 | tar -xvzf ${SSTATE_PKG} | 894 | tar -xvzf ${SSTATE_PKG} |
891 | # update .siginfo atime on local/NFS mirror if it is a symbolic link | 895 | # update .siginfo atime on local/NFS mirror if it is a symbolic link |
892 | [ ! -h ${SSTATE_PKG}.siginfo ] || touch -a ${SSTATE_PKG}.siginfo 2>/dev/null || true | 896 | [ ! -h ${SSTATE_PKG}.siginfo ] || [ ! -e ${SSTATE_PKG}.siginfo ] || touch -a ${SSTATE_PKG}.siginfo 2>/dev/null || true |
893 | # update each symbolic link instead of any referenced file | 897 | # update each symbolic link instead of any referenced file |
894 | touch --no-dereference ${SSTATE_PKG} 2>/dev/null || true | 898 | touch --no-dereference ${SSTATE_PKG} 2>/dev/null || true |
895 | [ ! -e ${SSTATE_PKG}.sig ] || touch --no-dereference ${SSTATE_PKG}.sig 2>/dev/null || true | 899 | [ ! -e ${SSTATE_PKG}.sig ] || touch --no-dereference ${SSTATE_PKG}.sig 2>/dev/null || true |