]> git.pld-linux.org Git - packages/apt.git/commitdiff
- should work...
authorMichal Moskal <michal@moskal.me>
Wed, 24 Apr 2002 13:54:18 +0000 (13:54 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    apt-md5-cache-dir-option.patch -> 1.1

apt-md5-cache-dir-option.patch [new file with mode: 0644]

diff --git a/apt-md5-cache-dir-option.patch b/apt-md5-cache-dir-option.patch
new file mode 100644 (file)
index 0000000..7670a5a
--- /dev/null
@@ -0,0 +1,92 @@
+diff -ur apt-0.3.19cnc52/tools/genpkglist.cc apt-0.3.19cnc52-/tools/genpkglist.cc
+--- apt-0.3.19cnc52/tools/genpkglist.cc        Thu Jul 12 23:47:33 2001
++++ apt-0.3.19cnc52-/tools/genpkglist.cc       Wed Apr 24 15:50:01 2002
+@@ -139,6 +139,7 @@
+    ~CachedMD5();
+ };
++string cache_dir;
+ CachedMD5::CachedMD5(string DirName)
+ {
+@@ -153,7 +154,7 @@
+         if (buf[i]=='/')
+          buf[i]='_';
+-    string cachedir = _config->FindDir("Dir::Cache") + "/genpkglist";
++    string cachedir = cache_dir + "/genpkglist";
+     filename = strdup(string(cachedir+string(buf)).c_str());
+     f = fopen(filename, "r");
+@@ -501,6 +502,7 @@
+    cerr << "options:" << endl;
+    cerr << " --index <file>  file to write srpm index data to" << endl;
+    cerr << " --info <file>   file to read update info from" << endl;
++   cerr << " --cache-dir <dir>   use named directory for md5 cache" << endl;
+    cerr << " --bloat         do not strip the package file list. Needed for some\ndistributions that use non-automatically generated file dependencies" << endl;
+ }
+@@ -607,6 +609,11 @@
+    int i;
+    bool fullFileList = false;
+    
++   if (getenv("TMPDIR"))
++      cache_dir = getenv("TMPDIR");
++   else
++      cache_dir = "/tmp";
++      
+    putenv("LC_ALL=");
+    for (i = 1; i < argc; i++) {
+       if (strcmp(argv[i], "--index") == 0) {
+@@ -617,6 +624,14 @@
+           cout << "genpkglist: filename missing for option --index"<<endl;
+           exit(1);
+        }
++      } else if (strcmp(argv[i], "--cache-dir") == 0) {
++       i++;
++       if (i < argc) {
++          cache_dir = argv[i];
++       } else {
++          cout << "genpkglist: filename missing for option --cache-dir"<<endl;
++          exit(1);
++       }
+       } else if (strcmp(argv[i], "--info") == 0) {
+        i++;
+        if (i < argc) {
+diff -ur apt-0.3.19cnc52/tools/gensrclist.cc apt-0.3.19cnc52-/tools/gensrclist.cc
+--- apt-0.3.19cnc52/tools/gensrclist.cc        Thu Jul 12 23:47:33 2001
++++ apt-0.3.19cnc52-/tools/gensrclist.cc       Wed Apr 24 15:52:57 2002
+@@ -90,6 +90,7 @@
+    ~CachedMD5();
+ };
++string cache_dir = "/var/cache/apt/gensrclist/";
+ CachedMD5::CachedMD5(string DirName)
+ {
+@@ -103,7 +104,7 @@
+     for (i = 0; buf[i]; i++)
+         if (buf[i]=='/')
+          buf[i]='_';
+-    filename = strdup(string("/var/cache/apt/gensrclist/"+string(buf)).c_str());
++    filename = strdup(string(cache_dir +string(buf)).c_str());
+     f = fopen(filename, "r");
+     if (!f) {
+@@ -243,8 +244,15 @@
+    bool mapi;
+    
+    putenv("LC_ALL=");
++
++   if (argv[1] && argv[2] && strcmp(argv[1], "--cache-dir") == 0) {
++      cache_dir = argv[2];
++      argv += 2;
++      argc -= 2;
++   }
++   
+    if (argc < 4 || argc > 5) {
+-      cerr << "usage: gensrclist <dir> <suffix> <srpm index>" << endl;
++      cerr << "usage: gensrclist [--cache-dir <dir>] <dir> <suffix> <srpm index>" << endl;
+       exit(1);
+    }
+    
This page took 0.034356 seconds and 4 git commands to generate.