I keep getting this error with HG (Mercurial), it seems like it's having a problem with the file, but i have permissions on the file, so i'm not sure why it's returning an error:
me#server:/repo$ hg up -v
resolving manifests
getting __init__.py
abort: Operation not permitted: /repo/__init__.py.orig
me#server:/repo$ ls -l /repo/__init__.py
-rw-rw-r-- 1 www-data www-data 3022 2012-03-22 14:13 /repo/__init__.py
me#server:/repo$ ls -ld /repo/
-rwxrwxr-x 3 www-data www-data 4096 2012-03-22 13:23 /repo/
here is another sample:
me#server:/repo$ ls -l /repo/modular.py.orig
-rw-rw-r-- 1 www-data www-data 34188 2012-03-29 12:50 /repo/modular.py.orig
me#server:/repo$ ls -l /repo/ -d
drwxrwxr-x 2 www-data www-data 4096 2012-03-29 12:50 /repo/
Any ideas how i can prevent this in the future?
I think it's saying it's unable to create the file /repo/__init__.py.orig. Check these permissions:
ls -l /repo/__init__.py.orig
and
ls -l /repo/
You need write access for both of those for user 'me'
Related
I'm building Octave from sources in order to include the ATLAS libraries. Did I get them included correctly? I don't know what to expect from the Octave configure script. I find "-llapack" suspiciously generic.
./configure --with-lapack=/usr/local/atlas
Source directory: .
Installation prefix: /usr/local
C compiler: gcc -Wall -W -Wshadow -Wformat -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wcast-align -Wcast-qual -g -O2 -pthread
C++ compiler: g++ -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -g -O2 -pthread
Fortran compiler: gfortran -O
Fortran libraries: -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.. -lgfortran -lm -lquadmath
Lex libraries:
LIBS: -lutil -lm
...
HDF5 libraries: -lhdf5
Java home: /usr/lib/jvm/java-7-openjdk-amd64
Java JVM path: /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server
Java CPPFLAGS: -I/usr/lib/jvm/java-7-openjdk-amd64/include -I/usr/lib/jvm/java-7-openjdk-amd64/include/linux
Java libraries:
LAPACK libraries: -llapack
LLVM CPPFLAGS:
LLVM LDFLAGS:
LLVM libraries:
Magick++ CPPFLAGS: -I/usr/include/GraphicsMagick
Magick++ LDFLAGS:
Magick++ libraries: -lGraphicsMagick++ -lGraphicsMagick
...
allusers#vbubuntu:~/Downloads/octave-3.8.1$ ll -R /usr/local/atlas/
/usr/local/atlas/:
total 16
drwxr-xr-x 4 root root 4096 May 25 23:01 ./
drwxr-xr-x 13 root root 4096 May 25 23:01 ../
drwxr-xr-x 3 root root 4096 May 25 23:01 include/
drwxr-xr-x 2 root root 4096 May 25 23:01 lib/
/usr/local/atlas/include:
total 60
drwxr-xr-x 3 root root 4096 May 25 23:01 ./
drwxr-xr-x 4 root root 4096 May 25 23:01 ../
drwxr-xr-x 2 root root 4096 May 25 23:01 atlas/
-rw-r--r-- 1 root root 33962 May 25 23:06 cblas.h
-rw-r--r-- 1 root root 9708 May 25 23:06 clapack.h
/usr/local/atlas/include/atlas:
total 604
drwxr-xr-x 2 root root 4096 May 25 23:01 ./
drwxr-xr-x 3 root root 4096 May 25 23:01 ../
-rw-r--r-- 1 root root 2089 May 25 23:06 atlas_buildinfo.h
-rw-r--r-- 1 root root 90 May 25 23:06 atlas_cacheedge.h
...
-rw-r--r-- 1 root root 2716 May 25 23:06 zmm.h
-rw-r--r-- 1 root root 552 May 25 23:06 zXover.h
/usr/local/atlas/lib:
total 26548
drwxr-xr-x 2 root root 4096 May 25 23:01 ./
drwxr-xr-x 4 root root 4096 May 25 23:01 ../
-rw-r--r-- 1 root root 14165306 May 25 23:06 libatlas.a
-rw-r--r-- 1 root root 455844 May 25 23:06 libcblas.a
-rw-r--r-- 1 root root 572392 May 25 23:06 libf77blas.a
-rw-r--r-- 1 root root 10942494 May 25 23:06 liblapack.a
-rw-r--r-- 1 root root 456426 May 25 23:06 libptcblas.a
-rw-r--r-- 1 root root 572788 May 25 23:06 libptf77blas.a
allusers#vbubuntu:~/Downloads/octave-3.8.1$
Additional info:
After spamming echo statements in the config file I've noticed the following:
This line:
$as_echo "$as_me:${as_lineno-$LINENO}: checking for $cheev in $LAPACK_LIBS" >&5
has the correct $LAPACK_LIBS variable in it (the one I passed in). It's this line that appears to be the first failure to find something in the lapack libraries I'm telling it about:
if ac_fn_c_try_link "$LINENO"; then :
Just before that line I see the config file define some c code that I believe it's running to identify whether whatever 'cheeve' is, is found in the libraries.
checking for cheev_ in /usr/local/atlas/lib/... no
checking for cheev_... no
checking for cheev_ in -llapack... yes
configuration script
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char $cheev ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
return $cheev ();
;
return 0;
}
_ACEOF
At this point the C code has gone beyond my comprehension level. It seems like it has something to do with whether the F77 compiler (compiler translator??) is being invoked or not.
Well, I think I worked this out after a marathon debugging session.
Octave doesn't appear to recognize the atlas libraries unless they're in shared format (.so files not the .a files that are generated by default).
When I build ATLAS with the --shared option added, and I reference the .so files generated by ATLAS, the Octave config script accepts them. Note: Make sure you use libtatlas.so, not libsatlas.so, assuming you want the multithreaded libraries.
Reference material:
ATLAS ./configure arguments:
../configure --shared -b 64 -D c -DPentiumCPS=3000 --with-netlib-lapack-tarfile=/home/allusers/Downloads/lapack-3.5.0.tgz
Octave ./configure arguments:
./configure --with-lapack=/usr/local/atlas/lib/libtatlas.so --with-blas=/usr/local/atlas/lib/libtatlas.so
Expected Octave ./configure output:
...
BLAS libraries: /usr/local/atlas/lib/libtatlas.so
...
LAPACK libraries: /usr/local/atlas/lib/libtatlas.so
...
Incorrect Octave ./configure output:
...
BLAS libraries: -lblas
...
LAPACK libraries: -llapack
...
My full build process for ATLAS and Octave:
ATLAS setup:
bunzip2 -c atlas3.10.x.tar.bz2 | tar xfm -
mv ATLAS atlas3.10.1
cd atlas3.10.1
mkdir build_vbubuntu
cd build_vbubuntu
sudo apt-get install gfortran f2c libcnf-dev # ???
../configure --shared -b 64 -D c -DPentiumCPS=3000 --with-netlib-lapack-tarfile=/home/allusers/Downloads/lapack-3.5.0.tgz
make build
make check # test serial routines
make ptcheck # check parallel routines
make time
sudo make install
Octave setup:
sudo apt-get build-dep octave
./configure --with-lapack=/usr/local/atlas/lib/libtatlas.so --with-blas=/usr/local/atlas/lib/libtatlas.so
sudo make install
Full disclosure: While I've written up this answer because I got octave to admit that the atlas libraries exist (and I don't want to forget to write it later), the end result is still not working, a large scale matrix multiplication doesn't use multiple cores. Hence, if the cause of that issue is related I may be back to edit this answer in the future.
My successful attempt to compile octave (3.8.2) on CENTOS including atlas:
(make sure to remove blas-devel and lapack-devel, just in case)
> yum install atlas-sse3.x86_64
> setenv LDFLAGS -L/usr/lib64/atlas-sse3
>./configure --with-lapack=-latlas --with-blas=-latlas --enable-jit
> make -j20
(as root)> make install
After configure you should see:
BLAS libraries: -lcblas -lf77blas -latlas
LAPACK libraries: -llapack
I have installed the following packages --
libevent-2.0.21
memcached-1.4.17
libmemcached-0.34
memcached_functions_mysql_1.1
All of the above have been installed successfully.
The output of the ldconfig -v command (the part where it shows that libmemcached libraries have been included) is as follows:
$ldconfig -v
/usr/local/libmemcached/lib:
libmemcached.so.3 -> libmemcached.so.3.0.0
libmemcachedprotocol.so.0 -> libmemcachedprotocol.so.0.0.0
libmemcachedutil.so.0 -> libmemcachedutil.so.0.0.0
But when I try to load UDF's into mysql using the install_functions.sql that is shipped with memcache_functions it throws the following error:
ERROR 1126 (HY000) at line 38: Can't open shared library 'libmemcached_functions_mysql.so' (errno: 0 libmemcached.so.3: cannot open shared object file: No such file or directory)
And the contents of the plugin directory are:
-rw-r--r-- 1 root root 6.1K Jan 21 13:49 adt_null.so
-rw-r--r-- 1 root root 11K Jan 21 13:49 auth.so
-rw-r--r-- 1 root root 6.0K Jan 21 13:49 auth_socket.so
-rw-r--r-- 1 root root 6.2K Jan 21 13:49 auth_test_plugin.so
-rw-r--r-- 1 root root 35K Jan 21 13:49 ha_example.so
-rw-r--r-- 1 root root 10K Jan 21 13:49 libdaemon_example.so
-rw-r--r-- 1 root root 361K Feb 13 02:47 libmemcached_functions_mysql.a
-rwxr-xr-x 1 root root 1.1K Feb 13 02:47 libmemcached_functions_mysql.la
-rwxr-xr-x 1 root root 167K Feb 13 02:47 libmemcached_functions_mysql.so
-rwxr-xr-x 1 root root 167K Feb 13 02:47 libmemcached_functions_mysql.so.0
-rwxr-xr-x 1 root root 167K Feb 13 02:47 libmemcached_functions_mysql.so.0.0.0
-rw-r--r-- 1 root root 11K Jan 21 13:49 mypluglib.so
-rw-r--r-- 1 root root 5.9K Jan 21 13:49 qa_auth_client.so
-rw-r--r-- 1 root root 11K Jan 21 13:49 qa_auth_interface.so
-rw-r--r-- 1 root root 6.0K Jan 21 13:49 qa_auth_server.so
-rw-r--r-- 1 root root 39K Jan 21 13:49 semisync_master.so
-rw-r--r-- 1 root root 15K Jan 21 13:49 semisync_slave.so
Installing memcached on Ubuntu 12.04.1 LTS (64 bit)
Python - 2.6.8
MySQL – 5.5.28
Zope – 2.12.19
1. Install memcached
apt-get install memcached
2. Install libmemcached -0 .34 (Version is very important. May or may not work with other versions).
Download it from https://launchpad.net/libmemcached/
tar xvf libmemcached-0.34.tar.gz
sudo ./configure --prefix=/usr/lib/libmemcached --with-memcached=/usr/bin/memcached
sudo make
sudo make install.
3. Install memcached_functions_mysql (Version 1.1 used at the time of the installation. (To create UDF’s that are invoked by triggers to manipulate the cache).
Downloading from https://launchpad.net/memcached-udfs
sudo ./configure --prefix=/usr/local/memcached_mysql --libdir=/usr/lib/mysql/plugin --with-mysql=/usr/bin/mysql_config --with-libmemcached=/usr/lib/libmemcached
sudo make
sudo make install
Navigate to the “sql” folder inside the memcached_mysql_functions directory.
mysql –u <username> -p < install_functions.sql
4. For Zope users
Install python-memcached-1.53
Download it from https://pypi.python.org/pypi/python-memcached/
Navigate to the extracted python-memcached directory.
/home/zope/zope/bin/python setup.py install
5. Edit the script containing which imports the modules.
allow_module('memcache')
from memcache import Client
allow_class(Client)
allow_module('memcache.Client.get')
allow_module('memcache.Client.set')
This is done so that memcache can be imported and used in your Restricted Python scripts.
If an external method is used to handle the above case, then the file does need to be updated with the above content.
Is there some equivalent in Mercurial to NIX soft- or hard- links to directories or files.
Basically that a file (or directory) is linked to a file "somewhere else" and follows the version of that location (Unlike a regular branch I think, where one would have to merge)
Mercurial versions soft links that are internal to the repository just great. It'll detect them, record them, and create them for you. Is there a specific use case you're looking for? The closest thing to an link that reaches outside the repository is a subrepo, which is a pointer to a specific version of another repo.
Symlinks work
(df)Ry4ans-MacBook-Air:~ ry4an$ hg init olav
(df)Ry4ans-MacBook-Air:~ ry4an$ cd olav/
(df)Ry4ans-MacBook-Air:olav ry4an$ echo this > target
(df)Ry4ans-MacBook-Air:olav ry4an$ ln -s target link
(df)Ry4ans-MacBook-Air:olav ry4an$ ls -l
total 16
lrwxr-xr-x 1 ry4an staff 6B Feb 16 19:25 link# -> target
-rw-r--r-- 1 ry4an staff 5B Feb 16 19:25 target
(df)Ry4ans-MacBook-Air:olav ry4an$ hg commit -A -m "link and its target"
adding link
adding target
(df)Ry4ans-MacBook-Air:olav ry4an$ hg log -p
changeset: 0:42a41a431661
tag: tip
user: Ry4an Brase <ry4an-hg#ry4an.org>
date: Sat Feb 16 19:26:17 2013 -0500
summary: link and its target
diff -r 000000000000 -r 42a41a431661 link
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/link Sat Feb 16 19:26:17 2013 -0500
## -0,0 +1,1 ##
+target
\ No newline at end of file
diff -r 000000000000 -r 42a41a431661 target
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/target Sat Feb 16 19:26:17 2013 -0500
## -0,0 +1,1 ##
+this
(df)Ry4ans-MacBook-Air:olav ry4an$ hg update null
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
(df)Ry4ans-MacBook-Air:olav ry4an$ ls -l
(df)Ry4ans-MacBook-Air:olav ry4an$ hg update tip
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
(df)Ry4ans-MacBook-Air:olav ry4an$ ls -l
total 16
lrwxr-xr-x 1 ry4an staff 6B Feb 16 19:26 link# -> target
-rw-r--r-- 1 ry4an staff 5B Feb 16 19:26 target
But hardlinks don't
$hg commit -Am "hardlinks target"
adding link
adding target
$hg log -p
changeset: 0:ec9407634133
tag: tip
user: Chris Wesseling <chris.wesseling#cwi.nl>
date: Wed Mar 13 23:14:44 2013 +0100
summary: hardlinks target
diff -r 000000000000 -r ec9407634133 link
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/link Wed Mar 13 23:14:44 2013 +0100
## -0,0 +1,1 ##
+foo
diff -r 000000000000 -r ec9407634133 target
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/target Wed Mar 13 23:14:44 2013 +0100
## -0,0 +1,1 ##
+foo
$ls -lin
total 8
276702 -rw-r--r-- 2 1204653 5900 4 13 mrt 23:14 link
276702 -rw-r--r-- 2 1204653 5900 4 13 mrt 23:14 target
$hg update null
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
$hg update tip
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ls -lin
total 8
276719 -rw-r--r-- 1 1204653 5900 4 13 mrt 23:15 link
276721 -rw-r--r-- 1 1204653 5900 4 13 mrt 23:15 target
Path auditing on *nix
On *nix systems, hg Mercurial audits symbolic links ("symlinks") for referred path security.
For example, absolute and empty paths are considered unsafe and will therefore not be added to the repository.
Mercurial developers have not documented this feature. However, the source code contains a comment with a somewhat vague explanation:
class pathauditor(object):
'''ensure that a filesystem path contains no banned components.
the following properties of a path are checked:
- ends with a directory separator
- under top-level .hg
- starts at the root of a windows drive
- contains ".."
- traverses a symlink (e.g. a/symlink_here/b)
- inside a nested repository (a callback can be used to approve
some nested repositories, e.g., subrepositories)
'''
On Windows, symbolic links are not supported for various reasons, see:
https://www.mercurial-scm.org/bts/issue1825
https://www.mercurial-scm.org/bts/issue2579
Sorry in advance for my bad english...
I'm trying to clone an hg repository using Eclipse on Ubuntu.
I always have the following error message which is exactly the same when I perform a "hg clone" command :
"Operation not permitted: <workspace_folder>/<project_name>/.hg/requires"
Here is the /.hg content :
ls -al .hg/
total 40K
drwxrwxr-x 4 www-data web 4.0K Apr 18 09:33 .
drwxrwxr-x 3 www-data svn 4.0K Mar 5 17:52 ..
-rwxrwxr-x 1 www-data web 57 Mar 5 17:48 00changelog.i
drwxrwxr-x 2 www-data web 4.0K Apr 18 09:33 cache
-rwxrwxr-x 1 www-data web 40 Mar 5 17:51 dirstate
-rwxrwxrwx 1 www-data web 40 Apr 18 21:45 requires
drwxrwxr-x 3 www-data web 4.0K Apr 18 09:33 store
-rw-rw-r-- 1 nico web 0 Apr 18 09:33 undo.bookmarks
-rw-rw-r-- 1 nico web 7 Apr 18 09:33 undo.branch
-rw-rw-r-- 1 nico web 38 Apr 18 09:33 undo.desc
-rw-rw-r-- 1 nico web 40 Apr 18 09:33 undo.dirstate
And here is the /.hg/requires file content :
revlogv1
store
fncache
dotencode
Here is the output of the hg clone command :
running ssh nico#www.there.com "hg -R /var/dev/projects/my_hg_project serve --stdio"
sending hello command
sending between command
nico#www.there.com's password:
remote: 145
remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch stream unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024
remote: 1
destination directory: my_hg_project
abandon : Operation not permitted : /media/data/workspaces/my_workspace/my_hg_project/.hg/requires
I tried many things such as chmod and chown... I'm not a linux expert so I googled my error message but there is not many results.
Has anyone an idea about this?
Thank you very much in advance
You're right to be thinking file permissions because that's the root cause, but I'm a little confused. Are you showing up the file permissions on the server, but seeing that message on the your workstation? Where exactly are you trying to clone from and to? Are you cloning over http or ssh? What user are you running the clone command as?
I am getting the following error when trying to run hg update:
abort: Operation not permitted:
/var/www/simira/web/public/images/nominations/13/big/4f196667cf5a2.jpg
Here is some info:
$ cd /var/www/simira/web/public/images/nominations/13/big/
$ ll ./4f196667cf5a2.jpg
-rw-rw-r-- 1 martin portadesign 15356 Feb 2 22:10 4f196667cf5a2.jpg
$ ll -d ./
drwxrwxr-x 2 martin portadesign 4096 Feb 2 22:10 ./
$ id
uid=5004(clime) gid=5007(portadesign) groups=5007(portadesign),10(wheel),48(apache)
Tell me what is wrong, please...
The problem was caused by hg attempting to change the permissions of the file:
$ sudo hg update
$ ll ./4f196667cf5a2.jpg
./ -rwxrwxr-x 1 martin portadesign 15356 Feb 2 22:10 4f196667cf5a2.jpg
As can be seen, it added executable bit to the image. That is the only bit that hg acually tracks and there does not seem to be a "switch-off" option. The problem is that only an owner of the file can change its permissions.