]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/freeze/files/unfreeze
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / freeze / files / unfreeze
1 #!/bin/sh
2 #
3 # This script must be executed with the following environment variables
4 # and arguments:
5 #
6 # export FROZEN_DIR=<place to write conf files>
7 # export DISTRO=<distro being frozen>
8 # unfreeze
9 #
10 # If not given or empty FROZEN_DIR defaults to the directory on BBPATH containing
11 # conf/local.conf.
12 #
13 # The output of the script consists of two files:
14 #       $FROZEN_DIR/$DISTRO-bbfiles.conf
15 #         empty
16 #
17 #       $FROZEN_DIR/$DISTRO-packages.conf
18 #         empty
19 #
20 # Check the arguments.
21 test -n "$DISTRO" || {
22         echo "FATAL: unfreeze: set \$DISTRO to the name of the distro to freeze" >&2
23         exit 1
24 }
25 if test -n "$FROZEN_DIR" -a -d "$FROZEN_DIR"
26 then
27         : # ok, given a directory
28 else
29         if test -n "$BBPATH"
30         then
31                 FROZEN_DIR=""
32                 for d in ${BBPATH//:/ }
33                 do
34                         if test -r "$d/conf/local.conf"
35                         then
36                                 FROZEN_DIR="$d/conf"
37                                 break
38                         elif test -z "$FROZEN_DIR" -a -d "$d"
39                         then
40                                 # default to the first existing directory on
41                                 # the path
42                                 FROZEN_DIR="$d"
43                         fi
44                 done
45         fi
46         if test -n "$FROZEN_DIR"
47         then
48                 echo "NOTE: unfreeze: \$FROZEN_DIR=\"$FROZEN_DIR\"" >&2
49                 echo "NOTE:           (defaulted from \$BBPATH=\"$BBPATH\")" >&2
50         else
51                 echo "FATAL: unfreeze: set \$FROZEN_DIR to the directory for the new .conf files" >&2
52                 exit 1
53         fi
54 fi
55 #
56 # do it
57 #
58 # the simple bb file list (package/bbfile.bb)
59 out="$FROZEN_DIR/$DISTRO-bbfiles.conf"
60 echo '# automatically generated by bitbake unfreeze' >"$out"
61 #
62 # the package directories list (package)
63 out="$FROZEN_DIR/$DISTRO-packages.conf"
64 echo '# automatically generated by bitbake unfreeze' >"$out"
65 echo 'BBFILES := "${PKGDIR}/packages/*/*.bb"' >>"$out"