@ -1,48 +0,0 @@ |
|||
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
|||
# |
|||
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|||
# Please add additional copyright information _after_ the line containing |
|||
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
|||
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
|||
# |
|||
# ROCK Linux: rock-src/package/base/mine/hotfix.patch |
|||
# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf |
|||
# |
|||
# This program is free software; you can redistribute it and/or modify |
|||
# it under the terms of the GNU General Public License as published by |
|||
# the Free Software Foundation; either version 2 of the License, or |
|||
# (at your option) any later version. A copy of the GNU General Public |
|||
# License can be found at Documentation/COPYING. |
|||
# |
|||
# Many people helped and are helping developing ROCK Linux. Please |
|||
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM |
|||
# file for details. |
|||
# |
|||
# --- ROCK-COPYRIGHT-NOTE-END --- |
|||
|
|||
--- ./Makefile.orig 2003-09-29 00:26:40.000000000 +0200
|
|||
+++ ./Makefile 2003-09-29 00:26:42.000000000 +0200
|
|||
@@ -79,10 +79,10 @@
|
|||
all: $(targets) |
|||
|
|||
mine: $(MINE_ALL_OBJS) |
|||
- gcc $(MINE_ALL_OBJS) $(MINE_LDFLAGS) -o mine
|
|||
+ $(CC) $(MINE_ALL_OBJS) $(MINE_LDFLAGS) -o mine
|
|||
|
|||
gasgui: $(GAS_OBJ) |
|||
- gcc $(GAS_OBJ) -ldialog -lcurses -lm -o gasgui
|
|||
+ $(CC) $(GAS_OBJ) -ldialog -lcurses -lm -o gasgui
|
|||
|
|||
install: |
|||
install mine $(sysprefix)/bin/mine |
|||
--- ./selector.c (revision 15)
|
|||
+++ ./selector.c (revision 16)
|
|||
@@ -551,7 +551,7 @@
|
|||
} |
|||
|
|||
if ( !pkgcount && !bigmain ) { |
|||
- char *dirname = "All Packages";
|
|||
+ char *dirname = "all";
|
|||
struct directory_entry * e; |
|||
if ( instmenu1() == 1 ) dirname = "base"; |
|||
for (e = rootdir->list; e != NULL; e = e->next) { |
@ -1,38 +0,0 @@ |
|||
--- ./Makefile.orig 2003-10-18 11:26:04.000000000 +0300
|
|||
+++ ./Makefile 2003-10-18 11:26:13.000000000 +0300
|
|||
@@ -23,7 +23,6 @@
|
|||
MINE_VER = 0.15 |
|||
MINE_OBJ = create.o install.o remove.o pkglist.o |
|||
MINE_OBJ += showfile.o showkey.o memdb.o md5.o md5sum.o mine.o |
|||
-MINE_LDFLAGS = -static
|
|||
|
|||
# GAS |
|||
# |
|||
@@ -63,7 +62,7 @@
|
|||
|
|||
# What do we want to build |
|||
# |
|||
-targets = mine
|
|||
+targets = mine mine.static
|
|||
ifeq ($(USE_GAS), 1) |
|||
targets += gasgui |
|||
endif |
|||
@@ -79,13 +78,17 @@
|
|||
all: $(targets) |
|||
|
|||
mine: $(MINE_ALL_OBJS) |
|||
- $(CC) $(MINE_ALL_OBJS) $(MINE_LDFLAGS) -o mine
|
|||
+ $(CC) $(MINE_ALL_OBJS) -o mine
|
|||
+
|
|||
+mine.static:
|
|||
+ $(CC) $(MINE_ALL_OBJS) -static -o mine.static
|
|||
|
|||
gasgui: $(GAS_OBJ) |
|||
$(CC) $(GAS_OBJ) -ldialog -lcurses -lm -o gasgui |
|||
|
|||
install: |
|||
install mine $(sysprefix)/bin/mine |
|||
+ install mine.static $(sysprefix)/bin/mine.static
|
|||
install tarbz2gem.sh $(prefix)/sbin/tarbz2gem |
|||
install rocket.sh $(prefix)/sbin/rocket |
|||
ifeq ($(USE_GAS), 1) |
@ -1,83 +0,0 @@ |
|||
|
|||
Our ober-guru did not wanted a new mine release - so here is |
|||
my single fix. |
|||
|
|||
- (Slave) Rene Rebe <rene@rocklinux.org> |
|||
|
|||
Index: remove.c
|
|||
===================================================================
|
|||
--- ./remove.c (revision 17)
|
|||
+++ ./remove.c (revision 18)
|
|||
@@ -70,37 +70,47 @@
|
|||
printf("%s: ", package); |
|||
printf("removing %s\n", filename); |
|||
} |
|||
- else
|
|||
- if ( ! strncmp(filename, "var/adm/", 8) ) {
|
|||
- if ( mode_verbose )
|
|||
- printf("%s: moving %s to var/adm/backup\n",
|
|||
+ else {
|
|||
+ struct stat statbuf;
|
|||
+
|
|||
+ snprintf(realfn1, 1024, "%s/%s", root, filename);
|
|||
+ if ( stat(realfn1, &statbuf) )
|
|||
+ printf("WARNING: Could not stat file %s.\n",
|
|||
+ realfn1);
|
|||
+
|
|||
+ if ( ! strncmp(filename, "var/adm/", 8) &&
|
|||
+ ! (S_ISDIR(statbuf.st_mode)) ) {
|
|||
+ if ( mode_verbose )
|
|||
+ printf("%s: moving %s to var/adm/backup\n",
|
|||
package, filename); |
|||
|
|||
- snprintf(realfn1, 1024, "%s/var/adm/backup", root);
|
|||
- mkdir(realfn1, 0700);
|
|||
+ snprintf(realfn1, 1024, "%s/var/adm/backup",
|
|||
+ root);
|
|||
+ mkdir(realfn1, 0700);
|
|||
|
|||
- snprintf(realfn1, 1024, "%s", filename+8);
|
|||
- sscanf(realfn1, "%[^/]/%[^/]", buf1, buf2);
|
|||
+ snprintf(realfn1, 1024, "%s", filename+8);
|
|||
+ sscanf(realfn1, "%[^/]/%[^/]", buf1, buf2);
|
|||
|
|||
- snprintf(realfn1, 1024, "%s/%s", root, filename);
|
|||
- snprintf(realfn2, 1024, "%s/var/adm/backup/%s_%s",
|
|||
- root, buf2, buf1);
|
|||
+ snprintf(realfn1, 1024, "%s/%s", root, filename);
|
|||
+ snprintf(realfn2, 1024, "%s/var/adm/backup/%s_%s",
|
|||
+ root, buf2, buf1);
|
|||
|
|||
- if ( rename(realfn1, realfn2) ) {
|
|||
- printf("While removing package %s: %s: %s\n",
|
|||
- package, realfn1, strerror(errno));
|
|||
- errors++;
|
|||
+ if ( rename(realfn1, realfn2) ) {
|
|||
+ printf("While removing package %s: %s: %s\n",
|
|||
+ package, realfn1, strerror(errno));
|
|||
+ errors++;
|
|||
+ }
|
|||
} |
|||
- }
|
|||
- else
|
|||
- {
|
|||
- if ( mode_verbose )
|
|||
- printf("%s: removing %s\n", package, filename);
|
|||
- snprintf(realfn1, 1024, "%s/%s", root, filename);
|
|||
- if ( remove(realfn1) ) {
|
|||
- printf("While removing package %s: %s: %s\n",
|
|||
- package, realfn1, strerror(errno));
|
|||
- errors++;
|
|||
+ else
|
|||
+ {
|
|||
+ if ( mode_verbose )
|
|||
+ printf("%s: removing %s\n",
|
|||
+ package, filename);
|
|||
+ if ( remove(realfn1) ) {
|
|||
+ printf("While removing package %s: %s: %s\n",
|
|||
+ package, realfn1, strerror(errno));
|
|||
+ errors++;
|
|||
+ }
|
|||
} |
|||
} |
|||
} |
@ -1,177 +0,0 @@ |
|||
|
|||
I know that a: |
|||
md5sum --check var/adm/md5sums/$pkg |
|||
|
|||
is sufficent for the check task - but a statically linked version for |
|||
rescue situations are a nice-to-have (ehrm yes - I had to solve some stability |
|||
problems on my iBook in the last days ....). Mine should be the right place |
|||
for a common package check interface. |
|||
|
|||
- Rene Rebe <rene@rockliunx.org> |
|||
|
|||
--- mine-0.15/mine.h 2003-09-27 15:20:58.000000000 +0200
|
|||
+++ mine-0.15-check/mine.h 2003-12-25 20:00:37.000000000 +0100
|
|||
@@ -20,6 +20,8 @@
|
|||
#ifndef MINE_H |
|||
#define MINE_H |
|||
|
|||
+extern int gem_check(char * root, char * package);
|
|||
+
|
|||
extern int gem_create(char * varadm, char * tarbz2, |
|||
char * package, char * outfile); |
|||
|
|||
--- mine-0.15/check.c 1970-01-01 01:00:00.000000000 +0100
|
|||
+++ mine-0.15-check/check.c 2003-12-25 21:10:25.000000000 +0100
|
|||
@@ -0,0 +1,73 @@
|
|||
+/*
|
|||
+ * GEM MINE - The ROCK Linux Package Manager
|
|||
+ * Copyright (C) 2002-2003 Clifford Wolf and Rene Rebe
|
|||
+ *
|
|||
+ * This program is free software; you can redistribute it and/or modify
|
|||
+ * it under the terms of the GNU General Public License as published by
|
|||
+ * the Free Software Foundation; either version 2 of the License, or
|
|||
+ * (at your option) any later version.
|
|||
+ *
|
|||
+ * This program is distributed in the hope that it will be useful,
|
|||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|||
+ * GNU General Public License for more details.
|
|||
+ *
|
|||
+ * You should have received a copy of the GNU General Public License
|
|||
+ * along with this program; if not, write to the Free Software
|
|||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|||
+ */
|
|||
+
|
|||
+#include <sys/types.h>
|
|||
+#include <sys/stat.h>
|
|||
+#include <stdlib.h>
|
|||
+#include <unistd.h>
|
|||
+#include <string.h>
|
|||
+#include <dirent.h>
|
|||
+#include <stdio.h>
|
|||
+#include <fcntl.h>
|
|||
+#include <errno.h>
|
|||
+
|
|||
+#include "mine.h"
|
|||
+#include "md5sum.h"
|
|||
+
|
|||
+
|
|||
+
|
|||
+int gem_check(char * root, char * package)
|
|||
+{
|
|||
+ char buffer[1024];
|
|||
+ char *filename;
|
|||
+ int modified = 0;
|
|||
+ FILE *f;
|
|||
+
|
|||
+
|
|||
+ md5sum_initdb(root, 0 /* verbose */);
|
|||
+
|
|||
+
|
|||
+
|
|||
+ snprintf(buffer, 1024, "%s/var/adm/flists/%s", root, package);
|
|||
+ f = fopen(buffer, "r");
|
|||
+ if ( f == NULL ) {
|
|||
+ fprintf(stderr, "No such package: %s\n", package);
|
|||
+ return 1;
|
|||
+ }
|
|||
+
|
|||
+ while ( fgets(buffer, 1024, f) != NULL )
|
|||
+ {
|
|||
+ strtok(buffer, " \t\n");
|
|||
+ filename = strtok(NULL, "\n");
|
|||
+
|
|||
+ if ( md5sum_check(root, filename) ) {
|
|||
+ printf("Modified/duplicate "
|
|||
+ "file: %s\n", filename);
|
|||
+ modified++;
|
|||
+ }
|
|||
+ }
|
|||
+
|
|||
+ fclose(f);
|
|||
+
|
|||
+ if ( modified )
|
|||
+ fprintf(stderr, "%d modified file%s of package %s.\n",
|
|||
+ modified, modified != 1 ? "s" : "", package);
|
|||
+ return modified == 0;
|
|||
+}
|
|||
+
|
|||
--- mine-0.15/Makefile 2003-09-27 15:20:58.000000000 +0200
|
|||
+++ mine-0.15-check/Makefile 2003-12-25 19:58:20.000000000 +0100
|
|||
@@ -21,7 +21,7 @@
|
|||
# Mine Itself |
|||
# |
|||
MINE_VER = 0.15 |
|||
-MINE_OBJ = create.o install.o remove.o pkglist.o
|
|||
+MINE_OBJ = check.o create.o install.o remove.o pkglist.o
|
|||
MINE_OBJ += showfile.o showkey.o memdb.o md5.o md5sum.o mine.o |
|||
MINE_LDFLAGS = -static |
|||
|
|||
--- mine-0.15-reference/mine.c 2003-09-27 15:20:58.000000000 +0200
|
|||
+++ mine-0.15/mine.c 2003-12-26 00:18:25.000000000 +0100
|
|||
@@ -32,7 +32,8 @@
|
|||
MINE_MODE_REMOVE, |
|||
MINE_MODE_PKGLIST, |
|||
MINE_MODE_SHOWFILE, |
|||
- MINE_MODE_SHOWKEY
|
|||
+ MINE_MODE_SHOWKEY,
|
|||
+ MINE_MODE_CHECK
|
|||
}; |
|||
|
|||
int mine_mode = MINE_MODE_NONE; |
|||
@@ -52,10 +53,11 @@
|
|||
" - ROCK Linux Package Management Tool\n" |
|||
"Copyright 2002, 2003 Clifford Wolf (GPL'ed)\n" |
|||
"\n" |
|||
-"Install and remove GEM packages:\n"
|
|||
+"Install, remove and chek GEM packages:\n"
|
|||
"\n" |
|||
" mine -i [ -t ] [ -v ] [ -f ] [ -R root ] package1.gem [ .. ]\n" |
|||
" mine -r [ -t ] [ -v ] [ -f ] [ -R root ] package1 [ package2 [ .. ] ]\n" |
|||
+" mine -y [ -R root ] package1 [ package2 [ .. ] ]\n"
|
|||
"\n" |
|||
"Query installed packages or GEM package files:\n" |
|||
"\n" |
|||
@@ -168,7 +170,7 @@
|
|||
} |
|||
|
|||
while ( (opt = getopt(argc, argv, |
|||
- "irqplmcdk:tvfhHR:")) != -1 ) {
|
|||
+ "iryqplmcdk:tvfhHR:")) != -1 ) {
|
|||
switch (opt) { |
|||
case 'i': |
|||
set_mode(MINE_MODE_INSTALL); |
|||
@@ -176,7 +178,9 @@
|
|||
case 'r': |
|||
set_mode(MINE_MODE_REMOVE); |
|||
break; |
|||
-
|
|||
+ case 'y':
|
|||
+ set_mode(MINE_MODE_CHECK);
|
|||
+ break;
|
|||
case 'q': |
|||
set_mode(MINE_MODE_PKGLIST); |
|||
break; |
|||
@@ -290,6 +294,10 @@
|
|||
argv[optind]); |
|||
break; |
|||
|
|||
+ case MINE_MODE_CHECK:
|
|||
+ rc = gem_check(mine_root_dir, argv[optind]);
|
|||
+ break;
|
|||
+
|
|||
case MINE_MODE_PKGLIST: |
|||
rc = gem_pkglist(argv[optind]); |
|||
break; |
|||
@@ -340,6 +348,11 @@
|
|||
mine_mode_header_block, |
|||
namelist[n]->d_name); |
|||
break; |
|||
+
|
|||
+
|
|||
+ case MINE_MODE_CHECK:
|
|||
+ rc = gem_check(mine_root_dir, namelist[n]->d_name);
|
|||
+ break;
|
|||
} |
|||
free(namelist[n]); |
|||
if ( rc > ret ) ret = rc; |
@ -1,72 +0,0 @@ |
|||
|
|||
Is is highly useful to have a software possibility to eject CD's for |
|||
soft-eject CD-ROMs, like always in use in Apple hardware ... |
|||
|
|||
- Rene Rebe <rene@rocklinux.org> |
|||
|
|||
--- mine-0.15/gasgui.c 2003-09-27 15:20:58.000000000 +0200
|
|||
+++ mine-0.15-cdeject/gasgui.c 2003-12-26 17:38:38.880000000 +0100
|
|||
@@ -1,6 +1,6 @@
|
|||
/* |
|||
* GEM MINE - The ROCK Linux Package Manager |
|||
- * Copyright (C) 2002-2003 Clifford Wolf
|
|||
+ * Copyright (C) 2002-2003 Clifford Wolf and Rene Rebe
|
|||
* |
|||
* This program is free software; you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
@@ -23,6 +23,11 @@
|
|||
#include <unistd.h> |
|||
#include <stdlib.h> |
|||
|
|||
+/* disk eject ... */
|
|||
+#include <fcntl.h>
|
|||
+#include <sys/ioctl.h>
|
|||
+#include <linux/cdrom.h>
|
|||
+
|
|||
#ifndef ROCKCFG_ID |
|||
# define ROCKCFG_ID "1.7-x86-reference" |
|||
#endif |
|||
@@ -66,6 +71,23 @@
|
|||
); |
|||
} |
|||
|
|||
+void eject_disk ()
|
|||
+{
|
|||
+ int status;
|
|||
+ int fd = open(sourcedev, O_RDONLY|O_NONBLOCK);
|
|||
+
|
|||
+ if (fd == -1) {
|
|||
+ printf ("Unable to open %s\n", sourcedev);
|
|||
+ return;
|
|||
+ }
|
|||
+
|
|||
+ status = ioctl(fd, CDROMEJECT);
|
|||
+ if (status != 0) {
|
|||
+ printf ("Eject failed\n");
|
|||
+ }
|
|||
+ close (fd);
|
|||
+}
|
|||
+
|
|||
void remove_package(struct package *p, int just_print_commands) |
|||
{ |
|||
char command[1024]; |
|||
@@ -138,14 +160,17 @@
|
|||
printf("Can't find: %s/%s/pkgs/%s.gem\n", |
|||
sourcedir, config, p->name); |
|||
printf("Not found on current disk: %s\n\n", p->name); |
|||
- printf("Please insert Disk #%d and press ENTER.\n\n", p->disk_number);
|
|||
+ printf("Please insert Disk #%d and press ENTER.\n\n",
|
|||
+ p->disk_number);
|
|||
while (1) { |
|||
- printf("Skip or Retry (default=Retry) > ");
|
|||
+ printf("Skip, Retry or Eject disk (default=Retry) > ");
|
|||
fflush(stdout); |
|||
fgets(command, 1024, stdin); |
|||
if ( command[0] == 0 || command[0] == '\n' || |
|||
command[0] == 'r' || command[0] == 'R' ) break; |
|||
if ( command[0] == 's' || command[0] == 'S' ) return NULL; |
|||
+ if ( command[0] == 'e' || command[0] == 'E' )
|
|||
+ eject_disk ();
|
|||
} |
|||
|
|||
snprintf(gemfile, 1024, "%s/%s/pkgs/%s-%s.gem", |