Gentoo Archives: gentoo-commits

From: "Paul Varner (fuzzyray)" <fuzzyray@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoolkit r499 - trunk/src/revdep-rebuild
Date: Mon, 21 Jul 2008 18:38:38
Message-Id: E1KL0HL-0004GS-HK@stork.gentoo.org
1 Author: fuzzyray
2 Date: 2008-07-21 18:38:34 +0000 (Mon, 21 Jul 2008)
3 New Revision: 499
4
5 Modified:
6 trunk/src/revdep-rebuild/revdep-rebuild
7 Log:
8 Moved temporary files from /tmp to /var/tmp. Use a to avoid unprintable characters when using --library
9
10 Modified: trunk/src/revdep-rebuild/revdep-rebuild
11 ===================================================================
12 --- trunk/src/revdep-rebuild/revdep-rebuild 2008-07-21 16:53:41 UTC (rev 498)
13 +++ trunk/src/revdep-rebuild/revdep-rebuild 2008-07-21 18:38:34 UTC (rev 499)
14 @@ -512,7 +512,7 @@
15 else
16 die 1 "Unable to find or create a satisfactory location for temporary files"
17 fi
18 - [[ $VERBOSE ]] && einfo "Temporary files are located in $PWD"
19 + [[ $VERBOSE ]] && einfo "Temporary cache files are located in $PWD"
20 setup_rm
21 }
22 get_search_env() {
23 @@ -521,7 +521,7 @@
24 local uid=$(python -c 'import os; import pwd; print pwd.getpwuid(os.getuid())[0]')
25 # Find a place to put temporary files
26 # Use "${TMPDIR}/revdep-rebuild" or /tmp/revdep-rebuild
27 - local tmp_target="${TMPDIR:=/tmp}/${APP_NAME}-${uid}"
28 + local tmp_target="/var/tmp/${APP_NAME}-${uid}-cache"
29
30 # From here on all work is done inside the temporary directory
31 setup_tmpdir "$tmp_target" "$uid"
32 @@ -542,14 +542,18 @@
33 # Set to "<tab>$SONAME<space>"
34 SONAME_SEARCH=$'\t'"$SONAME "
35 fi
36 - local uuid="${SONAME##*/}"
37 - uuid="${uuid//[[:space:]]}"
38 - uuid="${uuid//\*}"
39 - uuid="${uuid//\\}"
40 + # Hash the SONAME, to avoid unprintable characters. We are using HMAC since
41 + # the interface has remained consistent since python 2.2
42 + local uuid_hash=$(python -c "import hmac; print hmac.new('revdep-rebuild',\"${SONAME##*/}\").hexdigest()")
43 + # Delete me - keeping for reference if needed
44 + #local uuid="${SONAME##*/}"
45 + #uuid="${uuid//[[:space:]]}"
46 + #uuid="${uuid//\*}"
47 + #uuid="${uuid//\\}"
48 HEAD_TEXT="using $SONAME"
49 OK_TEXT="There are no dynamic links to $SONAME"
50 unset WORKING_TEXT
51 - setup_tmpdir $tmp_target"/"$uuid" "$uid"
52 + setup_tmpdir "$tmp_target"/"$uuid_hash" "$uid"
53 fi
54
55 # If any of our temporary files are older than 1 day, remove them all