Subversion Repositories general

Compare Revisions

No changes between revisions

Ignore whitespace Rev 1173 → Rev 1172

/rebootd/trunk/output
Property changes:
Deleted: svn:ignore
-*
/rebootd/trunk/Makefile.package
File deleted
/rebootd/trunk/ports/freebsd/pkg-descr
File deleted
/rebootd/trunk/ports/freebsd/pkg-plist
File deleted
/rebootd/trunk/ports/freebsd/Makefile
File deleted
/rebootd/trunk/rebootd.c
32,6 → 32,8
 
/* name version number */
#define APP_NAME "rebootd"
#define VERSION "1.0"
#define REVISION "$Rev$"
 
#define DEFAULT_PORT 19
#define DEFAULT_CFG_FILE "/etc/rebootd.conf"
92,6 → 94,7
 
static int parse_cmd_line(struct config *cfg, int argc, const char* argv[]);
static int parse_config_file(struct config *cfg, const char *config_name);
static int get_revision(void);
static void check_return(int res);
 
static uint min(uint a, uint b)
164,7 → 167,7
 
static void print_version(void)
{
printf("%s %s.%s.%s\n", APP_NAME, VER_MAJOR, VER_MINOR, VER_REVISION);
printf("%s %s.%d\n", APP_NAME, VERSION, get_revision());
}
 
static void pring_usage(int argc, const char* argv[])
614,6 → 617,20
return RESULT_OK;
}
 
static int get_revision(void)
{
int r;
const char *begin;
 
begin = REVISION;
while(begin[0] != '\0' && begin[0] != ':') begin++;
if(begin[0] == '\0') return 0;
begin++;
r = (int)strtol(begin, (char**)NULL, 10);
 
return r;
}
 
static int save_pid(const char *pid_file, const pid_t pid)
{
int fd;
/rebootd/trunk/TODO
1,6 → 1,7
rebootd todo
============
 
- update revision number for any changed file
- split code to several files
- man page
- FreeBSD port, Debian package
/rebootd/trunk/Makefile
1,47 → 1,20
# rebootd
 
PROJ= rebootd
OUTDIR= output
PROG= $(OUTDIR)/$(PROJ)
SRCS= rebootd.c
PROG= rebootd
SRCS= rebootd.c
 
VER_MAJOR= 1
VER_MINOR= 0
VER_REVISION!= svnversion
RELEASE_NAME= $(PROJ)-$(VER_MAJOR).$(VER_MINOR).$(VER_REVISION)
 
SAMPLES= rebootd.conf
PKGDIR= $(OUTDIR)/package
 
$(PROG): $(SRCS)
cc -pedantic-errors -Wall -o $(PROG) \
-DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
$(SRCS)
cc -pedantic-errors -Wall -o $(PROG) $(SRCS)
 
all: clean $(PROG)
 
pedantic:
lint -x -s -p -n -h -e -c -b -aa \
-DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
$(SRCS) \
| grep -E '^$(PROJ)'
lint -x -s -p -n -h -e -c -b -aa $(SRCS) | grep -E '^$(PROG)'
cc -Wnested-externs -Wredundant-decls -Wmissing-declarations \
-Wmissing-prototypes -Wstrict-prototypes -Waggregate-return \
-Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith \
-Wshadow -pedantic-errors -Wall \
-DVER_MAJOR=\"$(VER_MAJOR)\" -DVER_MINOR=\"$(VER_MINOR)\" -DVER_REVISION=\"$(VER_REVISION)\" \
-o /dev/null $(SRCS)
-Wshadow -pedantic-errors -Wall -o $(PROG) $(SRCS)
 
package:
rm -rf $(PKGDIR)
mkdir $(PKGDIR) $(PKGDIR)/$(RELEASE_NAME)
cp $(SRCS) $(SAMPLES) $(PKGDIR)/$(RELEASE_NAME)
sed -e 's/%VER_MAJOR%/$(VER_MAJOR)/' -e 's/%VER_MINOR%/$(VER_MINOR)/' \
-e 's/%VER_REVISION%/$(VER_REVISION)/' Makefile.package \
> $(PKGDIR)/$(RELEASE_NAME)/Makefile
tar cf - -C $(PKGDIR) $(RELEASE_NAME) | gzip > $(OUTDIR)/$(RELEASE_NAME).tar.gz
rm -rf $(PKGDIR)
 
clean:
rm -f $(PROG)
 
/rebootd/trunk/.
Property changes:
Added: svn:ignore
+rebootd
+rebootd.pid