dir=$1
+if [ $# -lt 1 ]
+then echo "Usage: $0 packagedir"
+ exit 1
+fi
+
if [ ! -d "$dir" ]
then echo "Error: $dir isn't a directory."
exit 1
touch $packagestart
sleep 1
cd $dir
+
+if [ ! -f build ]
+then echo "Error: No build script in $dir."
+ exit 1
+fi
+
sh build
cd /
echo " * Making file index, writing $targz"
#define DEF_INODES 63
#define DEF_INDENTSTR "\t"
+#ifndef major
#define major(x) ( (x>>8) & 0377)
#define minor(x) (x & 0377)
+#endif
/* Globals. */
int count, origlen, tabs;
#define SUPER_USER (uid_t) 0 /* uid_t of superuser */
-/* Devices. */
-#define MAJOR 8 /* major device = (dev>>MAJOR) & 0377 */
-#define MINOR 0 /* minor device = (dev>>MINOR) & 0377 */
-
#define NULL ((void *)0) /* null pointer */
#define CPVEC_NR 16 /* max # of entries in a SYS_VCOPY request */
#define CPVVEC_NR 64 /* max # of entries in a SYS_VCOPY request */
typedef unsigned long u_long;
typedef char *caddr_t;
+/* Devices. */
+#define MAJOR 8 /* major device = (dev>>MAJOR) & 0377 */
+#define MINOR 0 /* minor device = (dev>>MINOR) & 0377 */
+
+#ifndef minor
+#define minor(dev) (((dev) >> MINOR) & 0xff)
+#endif
+
+#ifndef major
+#define major(dev) (((dev) >> MAJOR) & 0xff)
+#endif
+
#ifndef makedev
-#define minor(dev) (((dev) >> MINOR) & BYTE)
-#define major(dev) (((dev) >> MAJOR) & BYTE)
#define makedev(major, minor) \
((dev_t) (((major) << MAJOR) | ((minor) << MINOR)))
#endif