Patched in D option (feature from Johan)
This commit is contained in:
parent
7a1d1ce1c1
commit
9461e91a9b
2 changed files with 36 additions and 1 deletions
|
@ -6,7 +6,7 @@ LIB = $(EMHOME)/modules/lib
|
||||||
LIBS = $(LIB)/libobject.a $(LIB)/libprint.a \
|
LIBS = $(LIB)/libobject.a $(LIB)/libprint.a \
|
||||||
$(LIB)/libstring.a $(LIB)/libsystem.a
|
$(LIB)/libstring.a $(LIB)/libsystem.a
|
||||||
|
|
||||||
CFLAGS=-O -I$(EMH)
|
CFLAGS=-O -I$(EMH) -DDISTRIBUTION
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
|
|
||||||
all: arch aal
|
all: arch aal
|
||||||
|
|
|
@ -19,6 +19,9 @@ static char RcsId[] = "$Header$";
|
||||||
* p: print named files
|
* p: print named files
|
||||||
* l: temporaries in current directory instead of /tmp
|
* l: temporaries in current directory instead of /tmp
|
||||||
* c: don't give "create" message
|
* c: don't give "create" message
|
||||||
|
#ifdef DISTRIBUTION
|
||||||
|
* D: make distribution: use distr_time, uid=2, gid=2, mode=0644
|
||||||
|
#endif
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -75,6 +78,10 @@ BOOL rep_fl;
|
||||||
BOOL del_fl;
|
BOOL del_fl;
|
||||||
BOOL nocr_fl;
|
BOOL nocr_fl;
|
||||||
BOOL local_fl;
|
BOOL local_fl;
|
||||||
|
#ifdef DISTRIBUTION
|
||||||
|
BOOL distr_fl;
|
||||||
|
long distr_time;
|
||||||
|
#endif
|
||||||
|
|
||||||
int ar_fd;
|
int ar_fd;
|
||||||
|
|
||||||
|
@ -220,6 +227,11 @@ char *argv[];
|
||||||
case 'l' :
|
case 'l' :
|
||||||
local_fl = TRUE;
|
local_fl = TRUE;
|
||||||
break;
|
break;
|
||||||
|
#ifdef DISTRIBUTION
|
||||||
|
case 'D' :
|
||||||
|
distr_fl = TRUE;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
default :
|
default :
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
|
@ -227,6 +239,14 @@ char *argv[];
|
||||||
|
|
||||||
if (needs_arg && argc <= 3)
|
if (needs_arg && argc <= 3)
|
||||||
usage();
|
usage();
|
||||||
|
#ifdef DISTRIBUTION
|
||||||
|
if (distr_fl) {
|
||||||
|
struct stat statbuf;
|
||||||
|
|
||||||
|
stat(progname, &statbuf);
|
||||||
|
distr_time = statbuf.st_mtime;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (local_fl) strcpy(temp_arch, "ar.XXXXXX");
|
if (local_fl) strcpy(temp_arch, "ar.XXXXXX");
|
||||||
else strcpy(temp_arch, "/tmp/ar.XXXXXX");
|
else strcpy(temp_arch, "/tmp/ar.XXXXXX");
|
||||||
|
|
||||||
|
@ -433,6 +453,14 @@ char *mess;
|
||||||
member.ar_mode = status.st_mode;
|
member.ar_mode = status.st_mode;
|
||||||
member.ar_date = status.st_mtime;
|
member.ar_date = status.st_mtime;
|
||||||
member.ar_size = status.st_size;
|
member.ar_size = status.st_size;
|
||||||
|
#ifdef DISTRIBUTION
|
||||||
|
if (distr_fl) {
|
||||||
|
member.ar_uid = 2;
|
||||||
|
member.ar_gid = 2;
|
||||||
|
member.ar_mode = 0644;
|
||||||
|
member.ar_date = distr_time;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
wr_arhdr(fd, &member);
|
wr_arhdr(fd, &member);
|
||||||
#ifdef AAL
|
#ifdef AAL
|
||||||
do_object(src_fd, member.ar_size);
|
do_object(src_fd, member.ar_size);
|
||||||
|
@ -601,6 +629,13 @@ write_symdef()
|
||||||
arbuf.ar_uid = getuid();
|
arbuf.ar_uid = getuid();
|
||||||
arbuf.ar_gid = getgid();
|
arbuf.ar_gid = getgid();
|
||||||
arbuf.ar_mode = 0444;
|
arbuf.ar_mode = 0444;
|
||||||
|
#ifdef DISTRIBUTION
|
||||||
|
if (distr_fl) {
|
||||||
|
arbuf.ar_uid = 2;
|
||||||
|
arbuf.ar_gid = 2;
|
||||||
|
arbuf.ar_date = distr_time;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
wr_arhdr(ar_fd,&arbuf);
|
wr_arhdr(ar_fd,&arbuf);
|
||||||
wr_long(ar_fd, (long) tnum);
|
wr_long(ar_fd, (long) tnum);
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue